From patchwork Thu Jun 1 23:27:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9761359 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 BA7F0602BC for ; Thu, 1 Jun 2017 23:27:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB62328524 for ; Thu, 1 Jun 2017 23:27:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A01DB28544; Thu, 1 Jun 2017 23:27:56 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 C92D328524 for ; Thu, 1 Jun 2017 23:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751198AbdFAX1z (ORCPT ); Thu, 1 Jun 2017 19:27:55 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:10832 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbdFAX1x (ORCPT ); Thu, 1 Jun 2017 19:27:53 -0400 X-IronPort-AV: E=Sophos;i="5.39,281,1493654400"; d="scan'208";a="124764502" Received: from mail-bn3nam01lp0182.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.182]) by ob1.hgst.iphmx.com with ESMTP; 02 Jun 2017 07:27:52 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JcjOX/4Nbh57wLerFb9jnPYToSD8Q2aRI+TkX5niAnA=; b=Gzi4kwRtV83fJ2HfgBAlXEyjVY136vA7CBvpi3lfetmGjzLy5A4FclRzayv03f9IwYCDjK6IBcFTbA8SD3led5Bz45HKmpv6amz9/pHxyphhJYso7Hu15qHOocXZ7HSwtO+aTi4rjeLVtDcIk0koUhUvGTVX1AgJWrC3vrUmt5M= Received: from CO2PR04CA0127.namprd04.prod.outlook.com (2603:10b6:104:7::29) by DM2PR0401MB0928.namprd04.prod.outlook.com (2a01:111:e400:3c0c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Thu, 1 Jun 2017 23:27:17 +0000 Received: from BN3NAM04FT057.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::202) by CO2PR04CA0127.outlook.office365.com (2603:10b6:104:7::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Thu, 1 Jun 2017 23:27:17 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; 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 BN3NAM04FT057.mail.protection.outlook.com (10.152.93.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1101.12 via Frontend Transport; Thu, 1 Jun 2017 23:27:16 +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 42.A8.51736.3D2A0395; Thu, 1 Jun 2017 16:27:15 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Thu, 1 Jun 2017 16:27:14 -0700 X-AuditID: 0ac94369-6dc8f9800000ca18-93-5930a2d317a4 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 1D.83.11415.2D2A0395; Thu, 1 Jun 2017 16:27:14 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Christoph Hellwig , "Bart Van Assche" , Sreekanth Reddy Subject: [PATCH v2 02/12] Split scsi_internal_device_block() Date: Thu, 1 Jun 2017 16:27:01 -0700 Message-ID: <20170601232711.29062-3-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170601232711.29062-1-bart.vanassche@sandisk.com> References: <20170601232711.29062-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRmVeSWpSXmKPExsXCddJ5ke7lRQaRBhvnSVisXH2UyWJjP4dF 9/UdbBbLj/9jspj59Sm7A6vHrPtn2TymTTrF5rH7ZgObx8ent1g8Pm+SC2CN4rJJSc3JLEst 0rdL4MpY8uweW0GXUUXj6rXsDYw7NLsYOTkkBEwkFr0/z9LFyMUhJLCUSWL9jeusEM5WRonp Uw8zwlTt+TSNESKxkVHi6eejLCAJNgEjiW/vZ4LZIgKFEpe2dYAVMQssYpQ4uWMpE0hCWMBG Yt2qk2CTWARUJN617AeL8wrYS2z7voEJYoO8xNktO5lBbE4BB4l9LWfA4kJANU2HZ7OBDJUQ mMYq0fOxjQ2iWVDi5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Message: 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:(10019020)(979002)(6009001)(39850400002)(39410400002)(39400400002)(39450400003)(39840400002)(2980300002)(438002)(199003)(189002)(9170700003)(50986999)(8936002)(77096006)(189998001)(6666003)(2906002)(72206003)(53936002)(478600001)(50226002)(2950100002)(54906002)(76176999)(8676002)(5003940100001)(38730400002)(305945005)(48376002)(86362001)(356003)(1076002)(50466002)(106466001)(4326008)(36756003)(33646002)(5660300001)(47776003)(81166006)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0401MB0928; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT057; 1:084Zh1hQHDaT0CqzPOeaHjZANdvsHEP9pXmaWBf47jetPMpluPsOEXerw9FlYIV2Va7WIP0XIGE2q/LBTZseX1epBzoXWRcXAxd/t+tFxyMsPL0G7wXDaLM+buN4UpbEp+UpGVwXaoke3SN/aUh7QVwQeKSFgT2qHKaEiHtn/xe4UQNUCnibYaKMRgmqhn6ChBqen0CatYJtLP+tZzGHEb/3VbCGlCfkNgtaOaqe1aLc/K5j1b3NT0Fi0JBbFfTjI2LM5cyZh5ORugZygav+0MuwEJEcuy1f8N/V8tZxJpSaz2oj+2dxgaWE9E6fXTKvPR2pKAfhdTWLQ3yVE4Zlxv0JQIxKKc7kLt11prYiiUk0kFbLvjvVtesK35s85P7iea1Tg0sDXcR0IWQzZfhLlCliDgUX2mxDViaOsJ4vwD3Vbm0c763t7IBD7NNRRuvP2tKmHLGd627kMSrKPywBbkTkZG1A6dV+wvdUy/Qn0QYWNSjSKcTO/87fovU35W2e X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0401MB0928: X-MS-Office365-Filtering-Correlation-Id: 45247b9c-e6f8-41f2-6ea3-08d4a945bdcf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR0401MB0928; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB0928; 3:RJ3LuoxkX5VzXhBMzFLZWNrhtAaKYYxgdbn8oJz75lg96KJsGHK8saJ0F3CI44lOs9w1LMUrDrBmyX9s7W6ywf2oA+W5GP+7NCOKjE2QZp5P128dk4t3UDtMoDEw0+ZAREY+ymbfoukJCi5XbchdngtNlclzHttYdh3ANeq74xAVuz2wKwx3SfQa8SU7KDJqpeNeQgBdXaD+PGVUqKWZ6w4nYzipZeunzSTvAHIg4aIBbr4pSgexNvEf/H4wRShTL7X8bOIBeJFapOgp7qDdh7kGEZ2TzHh3D6K7W4tlT0zWB/RqN/JRKkEIcSCBnEJUbPcI3ckmjSRhM4fudxg0o/kAIoQ2Q+0uexN+a1s0h0PDboAaimM4DJwSPy2mWjwaQFeHii8ahB/X5TaHTy8dYmNXid1yHqxe+JFpjwk4lOBk0ELyl8zkUjYdCl1KDXK7LtGD4hTKMltNE4a2iiwkgn+Ow5AUYGm3UkVISUtYp9kIFIFmKv1/gRlKgUFEAzf9 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB0928; 25:AQqz9Xz+CA0PKdLt7BclxrJ54psBA3Wth6X0PRA6i/FNRGGwNkdCB8jPCrcAnweYmpPNYSnVP4HOMNwZDBsOAJW/IqwA7Ro+a/lFPwArazJbwqik40ae4DDzl6rVm7vFREeWlcgbwc2Ir91/+CANnVpnJegFtKlo7jdcNJebuCkxp9oUHdaEt5+JB4VnLeR6ifOFPgMt5PE8IVYMlAhJjIU7bkQCI7N6G/Vq7vpExqQF1xlTpCK/wCaSDfeYxaNIszWnF3WbsixTrPhyZ9aHYopWAuA15iYkgEd5WbMN3taWVYztTGYfAWixgEgdn+TreURY4Wgmd5KYyAGDuHKu1rXcuomUh6KdVsaam5SsRYz99MbZaeAk5ieBLWCxfUvuBk7G3SPw84gLIWY4svPIO+2lZ1yGwaeuDG4D9YqitzRJCIEtrXGQYcYOu/j7+8s6b1pCOrO68hCP5dMLx1P7dvKP3gekeGJLShoQ6unKbyg=; 31:BE/Gw3J5gVM69w967yHCxP9C6UHBxTugpHgYVTeBk5XeY3INaksPb8svKdXgHSRaWsWvyfn+LA5pUnlpvut6t/jmr4aNZ5hAHJI+j1QOu8/qh42EV2qC/0HbwRObcpojz8zOt16p1GdCuDZWWpiA5zhjYH+MyHzC559Wg7Rk9TYKDkQ5NujKOxunkIyt953uDAkn6G/XVO01Uy1cztktTIiZX86kR2iqp4LV5g2FF10sNoA0fZar9Vvn5lOBUB4e WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB0928; 20:NVVxfYp2oqfvggs8G/en/9bhH+DkEIPsKj6fXo41sdCBRfL/QV4USyCueYBBg/dGBdBnmPFNxeyNrtNcrSRecHpYT9myhVs7V0abPklzSDpPVHsvGobXU4Pfp1WCXqXsDtNlNAcrbphkGr6rlEMc+4mmVvmkq8H/7Cqe9dS4MfwASBbKnluOP/EjvLLpEoGAnhOVNazk8nGn4y2Rz97uwQDyeT9BrxEOg8XJVTWKPcC914vPSWFA6Zoock74cWoVW/RgtNLLcl1nnQQeC2F/K/c1ixZLZfdLtpdI/byVbZfUAjax36zRO+Hbwi/+ZvQkuHzUjqbQj0aPcw+4i1gB4LDZiRmFjYxhO3V7hAC+bXJd+SxLUMXNA4Y+Qc2/DBacyEXYjO/ogJOzj9Y5jKzoBLDyfaZeplXUdVh4A+Mym3aqn5Tiauu6loPe3G+bEE4y6IFGfKfJVfwRr3sr7ad/Blz5XOfUdhdf7yEVXE1u0IPIntsthLnyQ/khIx9aENPV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR0401MB0928; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR0401MB0928; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0401MB0928; 4:Gur8P1E1JXkopv2wV/VsEoEBDaLGRv+JjXqwqJGE?= =?us-ascii?Q?5s211n5N5WAHIZRSEdt4xlG1LJnjzWye+uSA3kG8ndf7skDnvZUOKhBERsGO?= =?us-ascii?Q?VHF5pyOCIwqUQ/irQCFCEf4AjQhmrQA20u7poVIw+D4ETloHDnW4zi+RT7ZA?= =?us-ascii?Q?05uprfs0k/1Um97bJj39tpEW7s3jOJ7CPBJWW+fKum1h1IWUiTXhKaUKxaOX?= =?us-ascii?Q?F+xIGnbGcFUfiBx6yWtSHJfDtAxvJszPJZ8eiVYWTtjgRDM3XdDh7MRCafY6?= =?us-ascii?Q?6issOkIyhN2aSDvrTYPANl7x43Wfv0xCm8DywBuXowJCft8chVKtnxpLTrBB?= =?us-ascii?Q?4z7S/BHCjO/VM29y4kxOuctMog1z2xYGvhPqS8xnW1fkdzz2c6RqA2ngFMmm?= =?us-ascii?Q?R4cXpEmofVSRkKgSoo+phhN6e7eWbV3SeIpqUVA4sBoZv0oCr7WljwcB+B/G?= =?us-ascii?Q?1y4DhyjfcyITM5JtaWSbN/p9qDU7q/L3rU3W/y4eLhohFb/lkDjWFKOKAZ/8?= =?us-ascii?Q?b6wqPX0R0KsPFA2SmYP+mWWASVVAunSpmPWvou3/Ow7U96aoaIOp78b9Z+Lh?= =?us-ascii?Q?2K5CUAwYGPtGlf+g4cU5iII5yTaSsa3chXoiL3shkPhd1yGkGfOz6+ZYWTZx?= =?us-ascii?Q?W2DzyB/68RkMlqxccFcGkWxZi1JTS3TCm/r45mz+rOlTNZoTFHI3e9cWYCfP?= =?us-ascii?Q?T27lt/qWJzisugDZFHPz3usKPeVwSFW29DcOjfmP73AaaBckyVfT0KsX6Coi?= =?us-ascii?Q?pscvA729mKiuJ4B44lb34+HxcPhb8sUcPqKWq+daZ2UWUP/d7MVstSoZbl7h?= =?us-ascii?Q?/nR0O98j6H4i+DQIrMfbl+g3GFsBCXvIrf62648X4zVUEjLbmMNmQeqQUwTU?= =?us-ascii?Q?Ca3N8PdweGImjb8qsqgvOMDmdpq3hJiFR5l/BrQcABYMJKo//0lp6KYtzsNz?= =?us-ascii?Q?9Oowl2QQtVocwYj32nrfE0IGRXHP+bN/sWR9eglAfsgaObRW+ro2LigRmsAv?= =?us-ascii?Q?NOAVe2LhvVz7Hu6xM51Jt4Inb3p90G3a37uTo2mpwl/rQnCK0u4TBi0oZLKg?= =?us-ascii?Q?bJMx2t4ZIPG+iFd2occkcMmsstOMNMgq0fmwSNhB7cwIMa8DDhh+x1jl1zRk?= =?us-ascii?Q?scBk7HhcAOCsXla31wZw9armofxyiSDWhRbFnWx3D3huZzFM8dzIeS6YqC91?= =?us-ascii?Q?yLOco7FQU5z2NA4d5sujsUnnZQwZm06BK115wD1Mml8PQzT21TtnTVzMkMM+?= =?us-ascii?Q?5RnbamYHEqYqUzNiPP0=3D?= X-Forefront-PRVS: 0325F6C77B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0401MB0928; 23:lztaLGVas68kMnJPKxoZjZYD05ZtgNL0nCkZDsh?= =?us-ascii?Q?uCQh7e+L+4lt4WZNcYJYfIZuIe2zVlT3at/rXdBkbX1IhYQirT2T6Uj/J3Eo?= =?us-ascii?Q?EbjY1ExmrumZhiVvupPptiRgLmk/0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Y/ImenV/NmV2REbw4NozY6MdMEtZNp9X+C410p0miiiBaYobjgtcTYteot/W+yccz+oFGuXL7gN7UqPUcEZHzbi57bQcgL66x+hGMH2N4bwStBSTFeuTUWCITA/kdLrXDJ34GmSpPlIgWObWHhnbwrknbtL66a/KQKRPUrh2m6q6qoJtS5xCXle3PT3ADkcOl6d+pJzNFU77jD5X85g4uK7L6Nx605beLVJ2V1vQUTpPO2; 24:DEHC0HIp9aaAqxGuOqfTxOdfUhAIdNA8RaqCayZmpuUExi7eTQ9sL73B9nAkjqa9wKG2VfgJqH4o9nB3rGIq/xjTI/5sOUVs7Jzup6tlNUw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB0928; 7:WrGDkTfmOHVrN8mu1G1SV3H1SuOv+ThcfcaL/YslQ28kCRxf8dmKRRe1lQqv2mBIMWrQTNKcMT4M7q0PGjn+O8Sn0GMG066u0HQiBXmJPpJy7ce6xQp51c3QoNerpnHWY8LW7KYtG0AfQfJq4t+ZGjX6brsij/GkF/ndYyAg0PUtpQyeQSrYkcbKB/NTbxRPUvFHhhlPk5XE8e6HF/f7zAWRUkA8gG3LDWwdZvOza38E0ErR0Np602PpmR0AyGdbQVFIJQCle4Q/qEK91xDWFEmyH+J4u/Y7rSKfPFGuKazbSR0/YpnyQEMSUHVb5PuHMfa6Eo8hNdMMeQ39U1yKEA==; 20:CtvhMpVDy9KGOpOvXUuqKs1bVunUL0ZFHRqb4mIxjnv33uChudXTQmQuhNFbl1CmEzbQGdSrivo460J8awxUNxME9RIy9/nbqVjMBdVRy9w3dAIO4fhClyqQYclGmcT55avWlO0VKRAppfIM3HtHEdeIlhxHHHHHncgvBiRxcCw= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2017 23:27:16.3408 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0401MB0928 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of passing a "wait" argument to scsi_internal_device_block(), split this function into a function that waits and a function that doesn't wait. This will make it easier to serialize SCSI device state changes through a mutex. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Cc: Christoph Hellwig Cc: Sreekanth Reddy Reviewed-by: Christoph Hellwig --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +- drivers/scsi/scsi_lib.c | 73 +++++++++++++++++++++++------------- include/scsi/scsi_device.h | 2 +- 3 files changed, 50 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index a5d872664257..c63bc5ccce37 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2859,7 +2859,7 @@ _scsih_internal_device_block(struct scsi_device *sdev, sas_device_priv_data->sas_target->handle); sas_device_priv_data->block = 1; - r = scsi_internal_device_block(sdev, false); + r = scsi_internal_device_block_nowait(sdev); if (r == -EINVAL) sdev_printk(KERN_WARNING, sdev, "device_block failed with return(%d) for handle(0x%04x)\n", @@ -2895,7 +2895,7 @@ _scsih_internal_device_unblock(struct scsi_device *sdev, "performing a block followed by an unblock\n", r, sas_device_priv_data->sas_target->handle); sas_device_priv_data->block = 1; - r = scsi_internal_device_block(sdev, false); + r = scsi_internal_device_block_nowait(sdev); if (r) sdev_printk(KERN_WARNING, sdev, "retried device_block " "failed with return(%d) for handle(0x%04x)\n", diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index cc9f792cd12b..c9ce36d16df0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2943,28 +2943,20 @@ scsi_target_resume(struct scsi_target *starget) EXPORT_SYMBOL(scsi_target_resume); /** - * scsi_internal_device_block - internal function to put a device temporarily into the SDEV_BLOCK state - * @sdev: device to block - * @wait: Whether or not to wait until ongoing .queuecommand() / - * .queue_rq() calls have finished. + * scsi_internal_device_block_nowait - try to transition to the SDEV_BLOCK state + * @sdev: device to block * - * Block request made by scsi lld's to temporarily stop all - * scsi commands on the specified device. May sleep. + * Pause SCSI command processing on the specified device. Does not sleep. * - * Returns zero if successful or error if not + * Returns zero if successful or a negative error code upon failure. * - * Notes: - * This routine transitions the device to the SDEV_BLOCK state - * (which must be a legal transition). When the device is in this - * state, all commands are deferred until the scsi lld reenables - * the device with scsi_device_unblock or device_block_tmo fires. - * - * To do: avoid that scsi_send_eh_cmnd() calls queuecommand() after - * scsi_internal_device_block() has blocked a SCSI device and also - * remove the rport mutex lock and unlock calls from srp_queuecommand(). + * Notes: + * This routine transitions the device to the SDEV_BLOCK state (which must be + * a legal transition). When the device is in this state, command processing + * is paused until the device leaves the SDEV_BLOCK state. See also + * scsi_internal_device_unblock_nowait(). */ -int -scsi_internal_device_block(struct scsi_device *sdev, bool wait) +int scsi_internal_device_block_nowait(struct scsi_device *sdev) { struct request_queue *q = sdev->request_queue; unsigned long flags; @@ -2984,21 +2976,50 @@ scsi_internal_device_block(struct scsi_device *sdev, bool wait) * request queue. */ if (q->mq_ops) { - if (wait) - blk_mq_quiesce_queue(q); - else - blk_mq_stop_hw_queues(q); + blk_mq_stop_hw_queues(q); } else { spin_lock_irqsave(q->queue_lock, flags); blk_stop_queue(q); spin_unlock_irqrestore(q->queue_lock, flags); - if (wait) - scsi_wait_for_queuecommand(sdev); } return 0; } -EXPORT_SYMBOL_GPL(scsi_internal_device_block); +EXPORT_SYMBOL_GPL(scsi_internal_device_block_nowait); + +/** + * scsi_internal_device_block - try to transition to the SDEV_BLOCK state + * @sdev: device to block + * + * Pause SCSI command processing on the specified device and wait until all + * ongoing scsi_request_fn() / scsi_queue_rq() calls have finished. May sleep. + * + * Returns zero if successful or a negative error code upon failure. + * + * Note: + * This routine transitions the device to the SDEV_BLOCK state (which must be + * a legal transition). When the device is in this state, command processing + * is paused until the device leaves the SDEV_BLOCK state. See also + * scsi_internal_device_unblock(). + * + * To do: avoid that scsi_send_eh_cmnd() calls queuecommand() after + * scsi_internal_device_block() has blocked a SCSI device and also + * remove the rport mutex lock and unlock calls from srp_queuecommand(). + */ +static int scsi_internal_device_block(struct scsi_device *sdev) +{ + struct request_queue *q = sdev->request_queue; + int err; + + err = scsi_internal_device_block_nowait(sdev); + if (err == 0) { + if (q->mq_ops) + blk_mq_quiesce_queue(q); + else + scsi_wait_for_queuecommand(sdev); + } + return err; +} /** * scsi_internal_device_unblock - resume a device after a block request @@ -3055,7 +3076,7 @@ EXPORT_SYMBOL_GPL(scsi_internal_device_unblock); static void device_block(struct scsi_device *sdev, void *data) { - scsi_internal_device_block(sdev, true); + scsi_internal_device_block(sdev); } static int diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 05641aebd181..6ce6888f3c69 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -472,7 +472,7 @@ static inline int scsi_device_created(struct scsi_device *sdev) sdev->sdev_state == SDEV_CREATED_BLOCK; } -int scsi_internal_device_block(struct scsi_device *sdev, bool wait); +int scsi_internal_device_block_nowait(struct scsi_device *sdev); int scsi_internal_device_unblock(struct scsi_device *sdev, enum scsi_device_state new_state);