From patchwork Tue Jul 10 02:33:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 170020 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 53FA82C0209 for ; Tue, 10 Jul 2012 12:16:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118Ab2GJCQs (ORCPT ); Mon, 9 Jul 2012 22:16:48 -0400 Received: from mga02.intel.com ([134.134.136.20]:49268 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088Ab2GJCQs (ORCPT ); Mon, 9 Jul 2012 22:16:48 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 09 Jul 2012 19:16:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,352,1309762800"; d="scan'208";a="163577750" Received: from dwillia2-linux.jf.intel.com ([10.7.137.146]) by orsmga001.jf.intel.com with ESMTP; 09 Jul 2012 19:16:47 -0700 Received: from dwillia2-linux.jf.intel.com (localhost.localdomain [IPv6:::1]) by dwillia2-linux.jf.intel.com (Postfix) with ESMTP id 707AB8003D; Mon, 9 Jul 2012 19:33:35 -0700 (PDT) Subject: [set4 resend PATCH 3/5] scsi: queue async scan work to an async_schedule domain To: jgarzik@pobox.com, JBottomley@parallels.com From: Dan Williams Cc: Len Brown , linux-scsi@vger.kernel.org, Eldad Zack , "Rafael J. Wysocki" , linux-ide@vger.kernel.org, Arjan van de Ven Date: Mon, 09 Jul 2012 19:33:35 -0700 Message-ID: <20120710023335.26249.52744.stgit@dwillia2-linux.jf.intel.com> In-Reply-To: <20120710023241.26249.13718.stgit@dwillia2-linux.jf.intel.com> References: <20120710023241.26249.13718.stgit@dwillia2-linux.jf.intel.com> User-Agent: StGit/0.16-1-g7004 MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This is preparation to enable async_synchronize_full() to be used as a replacement for scsi_complete_async_scans(), i.e. to stop leaking scsi internal details where they are not needed. Cc: Arjan van de Ven Cc: Len Brown Cc: Rafael J. Wysocki Cc: James Bottomley Tested-by: Eldad Zack Signed-off-by: Dan Williams --- drivers/scsi/scsi_scan.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index f55e5f1..dff17c1 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1845,14 +1845,13 @@ static void do_scsi_scan_host(struct Scsi_Host *shost) } } -static int do_scan_async(void *_data) +static void do_scan_async(void *_data, async_cookie_t c) { struct async_scan_data *data = _data; struct Scsi_Host *shost = data->shost; do_scsi_scan_host(shost); scsi_finish_async_scan(data); - return 0; } /** @@ -1861,7 +1860,6 @@ static int do_scan_async(void *_data) **/ void scsi_scan_host(struct Scsi_Host *shost) { - struct task_struct *p; struct async_scan_data *data; if (strncmp(scsi_scan_type, "none", 4) == 0) @@ -1876,9 +1874,11 @@ void scsi_scan_host(struct Scsi_Host *shost) return; } - p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no); - if (IS_ERR(p)) - do_scan_async(data); + /* register with the async subsystem so wait_for_device_probe() + * will flush this work + */ + async_schedule(do_scan_async, data); + /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */ } EXPORT_SYMBOL(scsi_scan_host);