From patchwork Tue Oct 18 21:52:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9383153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EC0C9600CA for ; Tue, 18 Oct 2016 21:53:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB22A2881F for ; Tue, 18 Oct 2016 21:53:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFD1129769; Tue, 18 Oct 2016 21:53:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C722881F for ; Tue, 18 Oct 2016 21:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756089AbcJRVw7 (ORCPT ); Tue, 18 Oct 2016 17:52:59 -0400 Received: from mail-by2nam03on0077.outbound.protection.outlook.com ([104.47.42.77]:4352 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756051AbcJRVw5 (ORCPT ); Tue, 18 Oct 2016 17:52:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pttXpBiyDY260nN2rNcFE+7pLDXqP3dA4wqLs3uUMSM=; b=TxmEAUZlgByA0v8wrPv/m7eAUm11zshdzDMVeZ1LXAUpVy7C0mVSELIt2AE9oMF1+wY9lhqlFPDrKcr+9zBvPUllmhlpFTMBL0kUkMHGLaS+nTgbn4myGRGme6ksfgra2vzGULiBVuKbIaNI0ZfiLNBwLKAsBfBxH9o/yGBOO3k= Received: from BLUPR02CA057.namprd02.prod.outlook.com (10.160.23.175) by SN1PR02MB1632.namprd02.prod.outlook.com (10.162.128.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Tue, 18 Oct 2016 21:52:55 +0000 Received: from BY2FFO11FD039.protection.gbl (2a01:111:f400:7c0c::165) by BLUPR02CA057.outlook.office365.com (2a01:111:e400:8ad::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11 via Frontend Transport; Tue, 18 Oct 2016 21:52:54 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; lists.infradead.org; dkim=none (message not signed) header.d=none; lists.infradead.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BY2FFO11FD039.mail.protection.outlook.com (10.1.14.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.7 via Frontend Transport; Tue, 18 Oct 2016 21:52:53 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 36.DD.26959.43796085; Tue, 18 Oct 2016 14:42:13 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 18 Oct 2016 14:52:52 -0700 X-AuditID: 0ac94369-b97ff7000001694f-72-580697341e4a Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id D8.D9.02564.5B996085; Tue, 18 Oct 2016 14:52:53 -0700 (PDT) Subject: [PATCH v3 09/11] SRP transport, scsi-mq: Wait for .queue_rq() if necessary To: Jens Axboe References: CC: Christoph Hellwig , James Bottomley , "Martin K. Petersen" , Mike Snitzer , Doug Ledford , Keith Busch , Ming Lin , Laurence Oberman , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-nvme@lists.infradead.org" From: Bart Van Assche Message-ID: <23d3615f-6905-0b60-a531-4a4d2cd9cf3f@sandisk.com> Date: Tue, 18 Oct 2016 14:52:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPIsWRmVeSWpSXmKPExsXCddJ5ka7pdLYIgzUzOCz+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi723tC3mL3vKbvHsUC+LRff1HWwW5z+8YrJYfvwfk0V7bwezRdvG r4wOvB4Tm9+xeyze85LJ48GhzSwem5fUe+y+2cDm8fHpLRaP9/uusnm8fbmT1ePzJrkAzigu m5TUnMyy1CJ9uwSujNsrNzAXbBSsmHB0HWsD4zW+LkZODgkBE4np/S9Yuxi5OIQEljJJdDSs Z4RwtjFKfOrbzQpTtW7iVzaoKkaJqTcvsIEkhAVCJU7+O8oMYosIyEp83/0aLC4kYCfxdv1O FpAGZoG9LBIPL98Cm8QmYCTx7f1MFhCbF6ho1ecDQDYHB4uAqsSdM2YgYVGBCIlNX+dAlQhK nJ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X/zO2OBqYK9NQUe9XcWy5a6/zoytzNkpv3sXdMZTjhu y0h/oXDPfNqRLTdneHFKHNO8Y6FdkvJ0gdU5C7Xuvl8qehvv9nAWM2T8VmIpzkg01GIuKk4E AO3n7bM5AgAA X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(6916009)(8676002)(5660300001)(229853001)(87936001)(47776003)(305945005)(64126003)(8936002)(189998001)(110136003)(65956001)(356003)(7846002)(4001350100001)(626004)(65806001)(31696002)(50466002)(86362001)(7416002)(69596002)(76176999)(50986999)(92566002)(54356999)(77096005)(36756003)(65826007)(230700001)(19580405001)(19580395003)(81156014)(81166006)(2270400002)(97736004)(68736007)(31686004)(586003)(83506001)(33646002)(2906002)(106466001)(53416004)(4326007)(2950100002)(23676002)(142923001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1632; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD039; 1:lYEtatfQi9gLnCyRTPBF0bOxQAgk86tQ1ouPXM/xfnn5oyuub2acrtj/aJgtCevXy469noKpdwrJUpyl8/WS2B9hQf4d/rnlatpnYE439j646TQsA/Sd3laR/OtsUkOyQkkmQgvNzhsjnTFP+sMEAjoPxhlu/lzlkEN/HnIDSaN5xTPscBRY45RTFrIwGtQiatZ0NGSnj/R/Y66V39IhjEaCO0YgVY2ID1bGS3MXlJQ+P51O4fmN7J1K07Iyl2x1Jv0fClQL3DILw9WbJeH3ksbDfm+vcZq8/p+YOtymV1d/tbhYraLD8tnyi7OE5v3BnRoDmt4WZ5Pk/74Br9O8IPDXmXbVcnImk+ERjF1PwnEAJ2rIEmR3e1RaZ9LysFGknJt95ayGWDNfFSZA4lUJHI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RVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319)(146099531331640)(42932892334569)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13016025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SN1PR02MB1632; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1632; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1632; 4:qvjTSXRKnOhRS/+xEZh2rK2LnYvqqlMroAcjEeGVlDGPmwVBAO0yNapuDTYmjTU2QAsl7sImvZKQmWhqabnE8jV6n1L2yU+Mtkqe7QoImnmXC3dGS2KUIX1OcaIHNA1Za/sFB/5Pru/H/o2IX5ZgMP8Q5AyPsNI45k5/Oo0WYa3rronO/QoZbHGLsKiw4sZapR3BP1jpL7f+b0Dl5WQCuZCkW4h/0dmhCX3LqIg7PkLDSXzuhezVwzIpMnAVUmxfrqtUqgBDnagRgMz1zbNgZDNrk9h81sIolEHUfRcfWLeIVI7RwKaK+j7ILyTYDsSPVuJOL20T00/3I5jhiMVLe/xHQ+JyQoug3TsbNQRG5caLegaMEtF1fcQDVhChIojQhpEgpZZdd349+GhpNfGH+NzynXL7yBT5nXp7GrkhZ9MS4GoagdcF5UykBw1VuAQTZjSLQ6JzAbkaLEIWcrtTAfPJ/UC+RbRPnPwoNRtfC0HWL0ObNARVE9ph3eNRs38ye3SqrmuDA00BsloHRYSK3E87rCdeYn8UeljwjQt1JaFp+IKK/U3sXTtLrYE4g3IemDUW6rv/s/WqcEPNh4QPx4vfHMgbHzUw0XWENqGRGgc= X-Forefront-PRVS: 00997889E7 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjAyTUIxNjMyOzIzOjlMekhMRzgyZG10Qm1LOGh5dHRuVW5QbFJm?= =?utf-8?B?dmF1ZE5ETXAxQS9TSjlaZEFlNW1McWYrcG5aMi9tdDFPRUlORlpsWjBQc3Bs?= =?utf-8?B?NndjcEV1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fs31kk80AZ6JkCtSmqtqg2AACzkmIEosi3/vdZlnm9XCAnrnsLPChHMet3V4oXpye X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2016 21:52:53.9999 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1632 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Rename srp_wait_for_queuecommand() into scsi_wait_for_queuecommand(). Ensure that if scsi-mq is enabled that scsi_wait_for_queuecommand() waits until ongoing shost->hostt->queuecommand() calls have finished. Signed-off-by: Bart Van Assche Cc: James Bottomley Cc: Martin K. Petersen Cc: Doug Ledford Reviewed-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a5a1b5d..b7e9662 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2724,8 +2724,6 @@ EXPORT_SYMBOL_GPL(sdev_evt_send_simple); /** * scsi_request_fn_active() - number of kernel threads inside scsi_request_fn() * @shost: SCSI host for which to count the number of scsi_request_fn() callers. - * - * To do: add support for scsi-mq in this function. */ static int scsi_request_fn_active(struct Scsi_Host *shost) { @@ -2744,11 +2742,19 @@ static int scsi_request_fn_active(struct Scsi_Host *shost) return request_fn_active; } +static void scsi_mq_wait_for_queuecommand(struct Scsi_Host *shost) +{ + struct scsi_device *sdev; + + shost_for_each_device(sdev, shost) + blk_mq_quiesce_queue(sdev->request_queue); +} + /** * scsi_wait_for_queuecommand() - wait for ongoing queuecommand() calls * * Wait until the ongoing shost->hostt->queuecommand() calls that are - * invoked from scsi_request_fn() have finished. + * invoked from either scsi_request_fn() or scsi_queue_rq() have finished. * * To do: avoid that scsi_send_eh_cmnd() calls queuecommand() after * scsi_internal_device_block() has blocked a SCSI device and remove and also @@ -2756,8 +2762,12 @@ static int scsi_request_fn_active(struct Scsi_Host *shost) */ void scsi_wait_for_queuecommand(struct Scsi_Host *shost) { - while (scsi_request_fn_active(shost)) - msleep(20); + if (shost->use_blk_mq) { + scsi_mq_wait_for_queuecommand(shost); + } else { + while (scsi_request_fn_active(shost)) + msleep(20); + } } EXPORT_SYMBOL(scsi_wait_for_queuecommand);