From patchwork Thu Sep 29 00:01:22 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: 9355401 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 0D0616077A for ; Thu, 29 Sep 2016 00:01:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F34D0296B5 for ; Thu, 29 Sep 2016 00:01:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7BC6296BB; Thu, 29 Sep 2016 00:01:44 +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=ham 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 4A56E2969B for ; Thu, 29 Sep 2016 00:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754791AbcI2ABh (ORCPT ); Wed, 28 Sep 2016 20:01:37 -0400 Received: from mail-by2nam03on0070.outbound.protection.outlook.com ([104.47.42.70]:2240 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753938AbcI2ABc (ORCPT ); Wed, 28 Sep 2016 20:01:32 -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=V1QSIWlMWFnHxvwQ+0xaS32tK1ftRDOJHDMqAdpcM+k=; b=HwNFm+uvYjdEDe5g9PxHx+kCemU4h6VMwqFkJMu8t2pNLrbmSQVVCsuqhkcjWwEzXhZgB6GW+4eEdE0l8jRnbmCzwlw/cqU0y2YnDU2gaQbruW/rTcryWJ3FCgwruXNHt/FLBrqs4Abh88LYI2SKS4wvXAJhLsIO3qIHGgKThNQ= Received: from BN6PR02CA0054.namprd02.prod.outlook.com (10.175.94.144) by SN1PR02MB2144.namprd02.prod.outlook.com (10.166.68.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Thu, 29 Sep 2016 00:01:29 +0000 Received: from BY2FFO11FD054.protection.gbl (2a01:111:f400:7c0c::162) by BN6PR02CA0054.outlook.office365.com (2603:10b6:404:f9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5 via Frontend Transport; Thu, 29 Sep 2016 00:01:29 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.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 BY2FFO11FD054.mail.protection.outlook.com (10.1.15.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.5 via Frontend Transport; Thu, 29 Sep 2016 00:01:24 +0000 Received: from MILHUBIP04.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 D6.D7.26959.0875CE75; Wed, 28 Sep 2016 16:51:28 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.301.0; Wed, 28 Sep 2016 17:01:24 -0700 X-AuditID: 0ac94369-b97ff7000001694f-1b-57ec577fd221 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 26.A4.02783.2D95CE75; Wed, 28 Sep 2016 17:01:23 -0700 (PDT) Subject: [PATCH v2 6/7] SRP transport: Port srp_wait_for_queuecommand() to scsi-mq To: Jens Axboe References: CC: Christoph Hellwig , James Bottomley , "Martin K. Petersen" , Mike Snitzer , Doug Ledford , Keith Busch , "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: Date: Wed, 28 Sep 2016 17:01:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsXCddJ5kW5D+JtwgzX7RCz+7znGZvHy/AdW i5WrjzJZrJqYZ3Hv6Bcmi723tC3mL3vKbvHsUC+LRff1HWwWy4//Y7Jo2/iV0YHbY2LzO3aP xXteMnk8OLSZxWPzknqP3Tcb2Dw+Pr3F4vF+31U2j8+b5AI4orhsUlJzMstSi/TtErgy9lza yVbQKFBx7dEi5gbGA7xdjJwcEgImEivXf2DtYuTiEBJYyiRx58NfFghnB6PEuqMPGGGqunbf Z4KqYpSYvmc+UIKdQ1ggRGKmL0iJiICsxPfdr9lAbCEBO4lp85sZQcqZBT4wS7ztPQqWYBMw kvj2fibQAg4OXqCitYfZQcIsAqoS3TN3s4DYogIRErcedoDZvAKCEidnPgEr5xSwl7j+VAPE ZBbQlFi/Sx+kgllAXmL72znMIJskBH6ySkxd8hbqBHWJk0vmM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Q49X6b6edYKJZbijERDLeai4kQAgREt6icCAAA= 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)(189002)(199003)(356003)(110136003)(50466002)(23676002)(19580405001)(36756003)(92566002)(189998001)(19580395003)(69596002)(6916009)(2950100002)(229853001)(65826007)(64126003)(97736004)(7846002)(33646002)(86362001)(626004)(31696002)(31686004)(586003)(47776003)(5660300001)(7416002)(106466001)(4001350100001)(53416004)(77096005)(83506001)(65806001)(8676002)(305945005)(87936001)(230700001)(2906002)(65956001)(81166006)(81156014)(54356999)(50986999)(76176999)(68736007)(8936002)(4326007)(11100500001)(2270400002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB2144; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD054; 1:CbbJLUEL5mxt3kJB7GChtCLflVgvjdQsYVjbXF/gFb/udKNEExx3oFH+lCH37mb7nds+7DAmrX0m6jeIcPwjUTMegMbbW3ucMq/4GlSkIKLkU0n+kdFJtsLwu37HDp8JyQP+v1V31BgigCeCYYpOUYfc8UGBuBz8qfh9ZmoCXkmZXvumco7eh8ER5WL9aNfcOEzokpzGcjUb21eRHT228ch/myGDUJv32D2QgFglvFsxp195mzbol1F+O7tDSXVDQJkWgzUHJjIbe63Clf77OQgeQxRfaX3aQ/ASNyqDweIzqJ2yryXMR3KIsbm128OF+hNf6sBwJxkLkhZk1th5UpEJyfzglMwc939gZnIAYlklDX7Qnjf09597KHBQ6IIotKzR9ALXaPbafA9Z7OTaU8ewJvhHlG4zrpuM2Ibir9CHzUfi2w+9Ms0keQ1cb1OOd82gHubDS/i1GohFav56GBT3KkDTNvGnUwa+MtTvs21P6xqWF4lRK0jQREvFKHNKLXRzMdSAuTh4iS9pHQ4XLnRRi4BumxkQgXLIz72OgwfE4quPEDntMKIIYaarfMvI X-MS-Office365-Filtering-Correlation-Id: 5b7b7209-1a3d-4f30-31a0-08d3e7fbc351 X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2144; 2:gka2KVndFg7fDy0gxENFHUUXZlgjIzFuEvbZpSv/sYJouHZzk+IfSVLzyEmLTea4hDZHTbEghF7F0xiqSv2DO0MqBhOCnV+FBF5RPn2AbnbbZNCUe0fGn4FEUKepDNEyRfvP+FIIn155Qnv1Jz4awD8ERc724IWrmveZ35e0w/GEHXpyj2IQ+JLVlVdHScIzmnVvJajHrmVwwe83I/ZN/Q==; 3:ppcCUAaOSZe8YfeOPS/bn1/YzBhLBoWEDYxLqQ8q6rAkdWHjngYL9gG8KO7rMkFX+heXz8klX7poM0oqO++5+T51dcGjznhMd+AzxtqWweNcgQc7VTzD450XZHzbQGrI7vgieg9cIWcNEuccQ2itM6Od0LUn4yer61Mcv3rB+FDExDPUYNjYu3CzKfJAlp/X7y5sdkMyfRmlqF1aHJP+y4F2KWTZ+Y80UiX1BG44L1RJDo5aFCePlz5dda+yM1qq3p1NSkrUSI9IBpd44NJMDP6VOgN/SKVPwpCSWlTkGRM= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:SN1PR02MB2144; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2144; 25:ZCf5QI8BZoqZinTeABlYrIMxVu5i/iBjUbtuI0TkpyvyoOsX6jBy6tvtWDzXaIFcwjg6kDDr3zZWYilNFsRtgLcW39/BYqh8q73eSUGsIMi0sFBPax895LLWKgtmpjW2ZWomZrYIZPNc6BgCGZoN7q//qhbS+srzob7Wr4kVUauqiElAQ273EP7ZHXjDqspiqB4D9VjVgqIx+UWvMnmNP0HhBZwljg6QYm5HROb4VgA2QTsZl3x/42Zefn5dNQBqBsn/6zuFnKypCCb49dr4VhLaBQxcIW/M9axD+beacR8pdZJCIhYGPkVH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dKT3xWxeZujK7AHTYnyug//vDXAjPQu36Jx6GKuaQsfhLtfmiZdPPA+8QwQZ+vsldB0lQT3MbjhuVoKQxaMkXUB+MavXf0kNBtY63C9nhSTO/lZxSMcgD1MaSQXqSepnACifnsG4Xjkoi6Jo09K2iNAd0KI544ZFxiCOku8jctaxYgt2rM8ekbx2MxNhU94z3rmVtvn3mUge+xV0Gn2EWY+8lS574I+mtN4tVWmTi67HNa X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319)(146099531331640)(42932892334569)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13018025)(13016025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SN1PR02MB2144; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB2144; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2144; 4:iPls/Fbn3/aGHeA+j4Fw6lk89N66MSvOIDC9tRvqmxxSzQ8I8+Uk96RJcCR6iYmTa8Ek9gLHIbDLlVd5Grk+dqYy1PiENtNOeJydm1q+eNP4kkm/w1ncNijgyJvDspZcRLCVrwu7QUrXzJSb8kbkoC35bc9688XsOCf+3aOjxP70g0KjubrB4wIP6q1kC2dFXh40Zc7esXPMgfN0RuwMGGZNu5q5gNAXTOCd8E+5wnhFkrTKz+CEfFrQhOIefZZC7rbxmTHbwZFUcQjWDHd/M5pUD+CuBrz3jbu+4iCh+WfRPay2DuZ8oWlrwwIeirI3YOKe92fkxxzEqupY/IOhTZLdWp3czL2lE8ZYO5Wsv2/9WFfCcDkP1+JXp6QsyZuuJKZ2u92QVT22Srfj/DGNegQx2wUf81YJlWdwKSR7DkkENEJW5YggEvSieTXbnoxHm+2WGhMpzc1ZDNwFpScKmfRchV23kNMQxfleBt1kN4LX2iWTwdx7DLlGHydWZNW2//MaZTlhg6z2IKjUVd6CCahWDrzPQDnTwHVgrAi20JauXYHCAyHt7XCBmS2M0sFX6uEr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1zQm5oWkhaMERIZnpxY2xUbUJiVWJVczNaWTgxa1M0?= =?utf-8?B?Y2krRFNQQ0FNSksvL2QrUT09?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2144; 6:FvuM2Ls+vKiC80d20Ct83i+06cJdFx6yaDzlY/w6bI/cMRA8Qpe5+r5xSRNQ3oX4ZHLfZbtsGmnzXEnv7bjLoFW3lYl8D83FnTMj+HMLPdr+ms1660QBzB0yBp6TCflwQ/JdjhCVIuBgDb1SIl6mOqm72SoBD1P35WW7Dc2iki3DOg3lj3ObCgJQP79+VBhv90atqkecIpM2llWaerlORFpmypOCWRbj8qeygdwfSaMM7sAzNjz1yHQ2Ru6MPQLmWmTK8PjHk7QBVIAI9IBBVLrunpnP/wt5J+NO5aVvWWB/Jp90JJ7KCSU4T8SJXNXKID68qbQwk42//hwJiD/UHSJHdDlapMCN3CgSl5SMMtM=; 5:kZt1r342QjcuvHbO/eYOcF9Z6IlirASIAlgK75gOT6BA7hvyLuQlzyoXVyk6W/0YdZ0KvH/Xcee/TCxCqni9PByvcEpKwHemnlneZxh5N1F0l4Vq7fyVFbnqS7EasepOY2k4SWkcS/VahZq+oe6q8jq6CkClvTDgolB+SgRumAI=; 24:/3IKGvRkJ+CnmXPa8tNMRb9IzTitxMNKHLPorB5lBJg+sxeBUgZF9p1oeOi+t+Fy6HpQ0dZ5UGLGne7rD8icUu1J5otYEYClwHskSmZcZ1s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2144; 7:H/Q7W5p008mqHHZS3T33bs0g00Pr3Wt6eRxN9JtEpBFMFTpl3IdAtW236QId+CyM0SDyGeySQoUBmcTBkkOSFHPS9UTSdjjqs/S4Rwal0i7Nffe39GkFy5QF4EjzVQmitPatyVIcsTDr5KdIAKuQDn5O6RCSK7u1ruX6SqeGhG1qoKPdqloAPQHUeNnEbHNqRnk24LJ04PUIzeA06DVmmQOgkj9186IO1cXRY6AhhDDzMSkQJF+kmdTNhlKoJrlhzshUm/yiwQ3/lWe4GAuMBVjlC72pkpk81+aaM+UIRQ/WpOx57oJ/iGsNTk+8ytA5gmBGd2c0k6kEwchxo2Bk0g==; 20:BKyu8djXUgROICa8G+AKJHgQQ0HgDgdkMcZ3AVPeizb5Lc45u4Z3WcGkm67nf/05RvkQXO0PFGZbw3gMeg2R5QgwR6ZZhXljf6JnCu2O9Q8U8+/42su+q14QQDT3VYM++z+kymfcAwAkj4r6ZFmLBA7CsSnZsYo7wf+wSgf0MgoFLSjXDi36BaIMBQ4N+qd7vZ0l4Ynkb8SDv7fcuKhWyELMqaJPhHLIF16+8h25bvBx+V/KC5nZ7lZNyJbSmP6i X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2016 00:01:24.9433 (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: SN1PR02MB2144 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ensure that if scsi-mq is enabled that srp_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: Hannes Reinecke --- drivers/scsi/scsi_transport_srp.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index e3cd3ec..f1d580e 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -405,8 +406,6 @@ static void srp_reconnect_work(struct work_struct *work) /** * 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) { @@ -425,11 +424,28 @@ static int scsi_request_fn_active(struct Scsi_Host *shost) return request_fn_active; } +static void srp_mq_wait_for_queuecommand(struct Scsi_Host *shost) +{ + struct scsi_device *sdev; + struct request_queue *q; + + shost_for_each_device(sdev, shost) { + q = sdev->request_queue; + + blk_mq_quiesce_queue(q); + blk_mq_resume_queue(q); + } +} + /* Wait until ongoing shost->hostt->queuecommand() calls have finished. */ static void srp_wait_for_queuecommand(struct Scsi_Host *shost) { - while (scsi_request_fn_active(shost)) - msleep(20); + if (shost->use_blk_mq) { + srp_mq_wait_for_queuecommand(shost); + } else { + while (scsi_request_fn_active(shost)) + msleep(20); + } } static void __rport_fail_io_fast(struct srp_rport *rport)