From patchwork Wed May 24 00:33:50 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: 9744735 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 207F4602A7 for ; Wed, 24 May 2017 00:35:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1311428867 for ; Wed, 24 May 2017 00:35:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07E422886A; Wed, 24 May 2017 00:35:37 +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 34D5E28867 for ; Wed, 24 May 2017 00:35:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765698AbdEXAfe (ORCPT ); Tue, 23 May 2017 20:35:34 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:23841 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763392AbdEXAed (ORCPT ); Tue, 23 May 2017 20:34:33 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="19885336" Received: from mail-co1nam03lp0021.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.21]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 08:34:32 +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=icrCeCSAYRLf/HCRh737AqAd/XFvSG5+Y0L2cJfWc54=; b=RbeBLNT76rh1cxip3OHIDbMuoxQU6gbayDiOYXGnMVyN3yPpcSjEBt9mfbXnSiF5B15aq5Ar0KXpwkjVwYSeLU4P2tIDcZ0fysbJwTH5Z/sE8SO92IjHO0YoKtcvN3l3ZXYGM3TXvqtFgjVp9pokWXinkbNFZQVgsqMI5TzYm+M= Received: from MWHPR04CA0103.namprd04.prod.outlook.com (10.174.173.44) by CY4PR04MB0360.namprd04.prod.outlook.com (10.173.188.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Wed, 24 May 2017 00:34:29 +0000 Received: from BN3NAM04FT015.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::201) by MWHPR04CA0103.outlook.office365.com (2603:10b6:301:3a::44) 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; Wed, 24 May 2017 00:34:28 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; HansenPartnership.com; dkim=none (message not signed) header.d=none; HansenPartnership.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN3NAM04FT015.mail.protection.outlook.com (10.152.92.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Wed, 24 May 2017 00:34:27 +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 55.55.19026.015D4295; Tue, 23 May 2017 17:34:26 -0700 (PDT) Received: from milsmgip12.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; Tue, 23 May 2017 17:34:22 -0700 X-AuditID: 0ac94371-093ff70000004a52-27-5924d5109b8f Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 9C.93.18148.E05D4295; Tue, 23 May 2017 17:34:22 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , , "Bart Van Assche" , Christoph Hellwig , "Hannes Reinecke" , Johannes Thumshirn , "Sreekanth Reddy" Subject: [PATCH 01/31] Split scsi_internal_device_block() Date: Tue, 23 May 2017 17:33:50 -0700 Message-ID: <20170524003420.5381-2-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170524003420.5381-1-bart.vanassche@sandisk.com> References: <20170524003420.5381-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsXCddJ5ka7QVZVIg+5GDYsFb/ayWaxcfZTJ YmM/h8XjrhmsFntvaVt0X9/BZrH8+D8mi5lfn7I7cHjMun+WzWPapFNsHrtvNrB5fHx6i8Vj /ZarLB6bT1d7fN4kF8AexWWTkpqTWZZapG+XwJXx70onS8EPw4oDp1czNTAu0+xi5OSQEDCR WPV3CksXIxeHkMBSJokfi9YwQzjbGCWOzm5gh6m69bMZKrGRUeLmmz3MIAk2ASOJb+9nsoDY IgKFEpe2dTCCFDEL9DJJnL3SAFYkLGAp8WvVC1YQm0VAVWLarbdgNq+AncSSd4tZITbIS5zd shOsnlPAXqLr1QSgzRxA2+wkFm2vAJkpIbC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OLbDI2QEA AA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39840400002)(39850400002)(39400400002)(39860400002)(39410400002)(2980300002)(438002)(199003)(189002)(9170700003)(189998001)(2906002)(478600001)(36756003)(5660300001)(72206003)(356003)(50226002)(6666003)(305945005)(4326008)(2950100002)(81166006)(8676002)(48376002)(8936002)(106466001)(1076002)(77096006)(54906002)(33646002)(50466002)(38730400002)(76176999)(50986999)(5003940100001)(47776003)(575784001)(86362001)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR04MB0360; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT015; 1:gFg5PGOvLlk+J6RpKJX8RTCeVQOoYqssOHWpifQmgeCAugZEg/Z/5YkCIBCDqOwtiiPcqbdGwZ1k/z8TS11mHDdPVf4Oj4oBKgO8+deBs4q7/eXLMIgCi0xoALEljXYK0kbM5UN2C+WR64QQGCeu/CZFFeC2NUKIeTKsN6Ws1HCQ5Fk/M+Eq3i/m/gaVEGGvw6J2sROln8XC+0Xe1e2Lfzrw06Wvk+aSq3RTF+EiRAvOn8KmGGErtqd2D3Jrvo+rwhmy+PIHlrhpyvDGyVIupdLoHoRB+675kobIZdPq1LwzcrKB0pEFzItHQ+lamcp8z60+KIpRkNcB5Ot0c2Jyk/YLE3JlBjbZuMmEgPxv/UAdufKntItpRkEm1l/Zdf6Ec5Pcxqs21D5cki/rgBcS9bHTS1Hpu3S5PGjGqE7mWVQo/Amp0SRljwUcf4kmBiw5c+1JhSvDJs1GaNxJdZqLaSW4i6MAZRicXx+21PR4byGgCEMQYouTMFkXCMoM6HS8+ywqINpf7PyxWHYtwd6igqktetg0jAAQbU78B6o3x2c= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR04MB0360: X-MS-Office365-Filtering-Correlation-Id: 0fe93adb-2413-4546-a22d-08d4a23ca318 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:CY4PR04MB0360; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0360; 3:+6GF4Svraux/i2w7/Gc1MIT6lh5BKBxbnqQSU003u2AzDzATj9oSBuKvsWxzcFHhyMaoVKJiSqU9FOVzkUvKUJiPhaIozknjXdci19U9NJkziDDQEfdyExk3KC1J3YJBQBdwRs/5HQGuiw2Vnk1lVcXBiyA9vHT2LETFUekpL9rbhDQpi1l5cddZ8MGhXTUXtLSkIKMylku2yjvslBw4Ykyt3gjhZH8zjZXg6Gf7hWRpQ3EXOmglh+XsvU9BhlGwkDbKHPXvtOaiRCdLRpZgFi1cOvG87iTqPAVGx90rkpbcU/n97TlvF/K/1YmA3t2nOFyIWTCbHNH+CNESLlJjjNrINfkXIvDB0+/jPsUCgPu5MroJI60Qjh1czg/rql6qKyTdBCceQvXa7rF6eLVb0CTZ4gvdZMHGXSx5zdJ/E6lAYF81gvCMhdSxim7abzmdLvZq02JcgsYdbEKEXQsSPFtWrXfQrc3yOwVTfgvbXzK+Whq14e8NoS52ynCH/+Cj X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0360; 25:PfSfYsgyXh8/1+buebNlcG1reoXdqCvzPP5UiXyFmfcwdMq0xY/4ac1oDbxYNRa3ddAkAA3Qbpe6PV8qAgsP/qsCPl1LoGgJVdiqrZDeSDKMEHeyCjAub5cj5SuEEfeGDVI12yQZIpCdsAQKz2aBkrugr0593Emmol7NRgNxf+obNX3YXJE/1p/UVivZq0IMs3cXPSlMtFahpC1KaiLOPZ/pfntpccC9kib99HnBM4d08+RJjt+s5Kj8L/huh3/pmNmibYPiDnp+Dkyyh4Fk9uiFaNsUpuHm/7mslDvbDbL4gy/DVb9E/SV7b4RGg0AUARL/J9O7UrdGH1AI4ykzg7LX/igVvu9r5mMT846JbqnngVcaGH/WqL+ReF+frJFQDuzPJpSE23QvFuRIMWt46bXU7237DP3NTbtNirzEoJKRLorFIjuCigXNRNArvobswUCOJWFUqH/+A4Bs+RrsPMs2z+5+fDEu87XKvUe+mPY=; 31:S43qEriJYO2LQfFT9gwjXcoReacUaSW1QA7/OpfbRKI8qARpdKWqzNiiH+VHp9MvtBkSC11RpIgOfIKE7JAvMbhCZv2ur10PrMAm1iSp+I7i1uq/pZkiN7Bvt6Pef9OWBIJkuhl8geFJYVbrfl75SGIJoeosYBu/EmQlPutHgBxA4d11RbXcOlogqO0UKE6ISwCM0IdNQvlXd/18SX6eywiyDpwhI9rx1m9PAH+hvgdNObnUR/a0LcPlNkDeKR6X WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0360; 20:M9sWhTmHQb1F19iZXhOUXVFai6uoyXFm7eeC0mTuvGfaWIJ0ckvOCTKMXYZ7wt6Te3laH+W2eC9J1qVcZ9w0rlMUFubGFjZqEvQp2vvfWj/AmHuxpuOrtOjK0yaNY9w19Jrhhd0ayQtnhcOWIJJfRkglBUtwWr3/9cgoSoE+jkOCpjJOAN52DIC8cm5UgLrgSPcrDfaJxPgCukhee3ZArYEvMBFlACJ45wjPAOtz4NADSneULguLOiplKx/o/Exs77lpKJf5RCuvNu3Ci1MeLRXEl7AuqP44DVrW71YHvebK6Re0oB2O08YID6KlCuUwTXI4olpD3De4ED57id78dLBUWJFvW3AhXptpB9vEyt53fJTWAZz1LZG327XyIQZMMck1/nmNbO31xVhjiBVZHWcW6gYg3fyqMMUur7izoIwdeU2MWNbS/BcTcrWCHJIirVySiQeCsLHqG4qUTiqISgGfvH8hhsPoW1pyUFiYI4bmKAvJ4TvCjuZ5vtExTc8F X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(6072148); SRVR:CY4PR04MB0360; BCL:0; PCL:0; RULEID:; SRVR:CY4PR04MB0360; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0360; 4:6VC62HNcqAifCiiZa5efYTHn2f7XhrC6VjPrwCo+3+W+wuPQwli3DS8GG0Z2Ql+FySXi5qb4vfbbg3iIAEYcJQ6uskYsZr7pC+g5EsPPaWM+h5gmBetXyVFIO7ucFM/kRaTaNJImec9CEKPcUt9kLhlPbB8cNHKjX9IlBNxju91Xeot2sA59L1/m2XFX5wI1USB4SCRAzDbF8AbB0atUs8AGGL9McLUoeWxft2zd4whcGXUR0o4fK8BViIBWfB8w55BgOdHK332R8Zujk1/aZLTb4juAbvPbV4kHfERyV7HSjoiJ1IR/y9yRLc4hvoODCZHXlUc/u+nNjUgUFhktwn5eW6plvzDHv/d+vBzl0cZcLRG0ssDq7Ry2UuSTC0Co5hHFyk3czUP1VgD3d1vdmJyl9EEDa4JJugb+I/2YzgLeV+51SbRLm+CyElSVcmXIKlJ1zJN9mf62tW4snpyeAmQCRT3dv/DYIhJOuW6sJRZaLZLlYv7nlRDYV/Tu8fihP4V2kscH49wJ9Z90wbRimpF3JcLXBgw72fnD6/iKIws5NqQv+juVX56LomH/NnyNu/Tx98sOGrFPb/eYUKFfLKQdbTW50IqO9iefDxNjkJ7LMwG1eZsnsMERa4yttuvC2aDYQg7AxvVducU1Rd34N/bA7z4Sd12rv0DcZIFIshNcTOvQhtP4mMCmWHLtuP2uvmLux9YsMAQqJDhqo1m1ENxofFCiFUJRDB0V+SUXjAvr0mB4KtZeMwGzGlXZPpO4D62qes70k7LhiuGWvfv7gRZQ2fIbLuyENKJiNGWaFDaYAKiWm+U9PxGsnimDdlKwJmzXTrxHxZngf1WfFk8VZ6gkRq13fSXctQ6hSIRtlMuTrdkwDfboyGx0hfN+Blyy X-Forefront-PRVS: 031763BCAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR04MB0360; 23:k+qpEQFqfJfpUWC7HfRtuNHv4SfnCDtIXXkvbMNrX?= =?us-ascii?Q?iNMtOutCTGnPeNTHhazdNILffeWut3VdYzkUteIp4VaWvy5kTUl1igU+hHKF?= =?us-ascii?Q?I3XmqzVyEeeCsE5CAFTlZNPai+VuP38E/CEmBzXMLAtb3JYtZf6IVMYB88iy?= =?us-ascii?Q?7aXdZKio7LDht8BJgZYVziC1F0H/vwpmJVHwdYUoNdNDgTyquTjAQ1JHtlAc?= =?us-ascii?Q?tYloSAF8CCf8GkiuvGjXTj8WFKF7Bws4xG3anloD0B2Uj5EkGY6dyWBJ4/+J?= =?us-ascii?Q?hrABoAapNwgZ8AIi1RhG4ilpOxiy3b0nQgjdpgdMaK+eCly3nSiwsu7IA2UB?= =?us-ascii?Q?QHjw+eeeMs5hXDck2cZa3MzrRoQbcDfqMgsmD0SQ1w20mh96KA51lM5qwkCt?= =?us-ascii?Q?BsZYHvUfDGXAHeXSZsC+2wma9KvhMGAjR9kCiafK0Q553Q/a3kVRbScoUoAv?= =?us-ascii?Q?zk8U0Pt9zhN9cWRq7rmBnxfEBRJ0MCufmLcKcrZpOJvrCUmRPyXgmfP/L3L+?= =?us-ascii?Q?xrkNUZfQfsq9YylQD4Bd+op/tldb0aXLTmLw01Z23J+roRyvjV81ZEnCF3W4?= =?us-ascii?Q?ke3I9GQhlLZBmWblbvkaoN0SDjhe66Pp3pfYHP2FpkLRGmo5gjpsyyc7n1KI?= =?us-ascii?Q?rrGtojpr8Mu5oaO3MTxCSALXIRKxQzRzs4ZDygle215hhwZbZ92hxpHzXzN2?= =?us-ascii?Q?RB877QFyyVoP7aAPNoOs0jIe5FAqrZckmHq0dyV0hI+rUwKtH7qUP38lWtt/?= =?us-ascii?Q?my89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qahPqig/4O8a6hDUqm5gl4qKeBAM8tROY5n0A8af7+yyolk/1awSNiSKeGHSzKVumxWQ==; 24:nO5SEwuHwy3eTDxnjxfzjJ1Fn1sda9YkwpH5T78ei7qUbgwMr+QvT6RbsQmeF/7Z0l5mFHInikk3F5V3p2O9DVWnDaXOd7H0byVVHJHeRVo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0360; 7:ai4+bi1rAmy89A7wOK6Y5njJxJt5ifA76EQ18rWBO0S/P8CDbeFgBLad/Bf5yXSco+xTuoV32L1TXHl/xftNnjIljuoBEbrQb0WxLfO6cQ2AyONKRB3HjCScGFKWwYMqJIcqCxPusqH5SnrGrQH1TYzK/KaBn+nUrke8U2vukl3Y4dy02EV81cTb3YEK1yjQk2uGL8Kq9vSAe0glMR04YkvRf2u+Pq8kl0nJseoEzqgjMADiZ0J/hsMFtPz4XCSeJlIYWDG+Cn+sE8ZqTapmeCHXmINU3Mi59Vy20AhsAE3uoZBbkABEZ88Jic2ATDykaKw9fi2hV7VsOOqj4C002w==; 20:D6M023hbIcEqAfYk/vu8Fe+TGmcRGzJGM54zrPVKvf3I9wJ+aW7BywaOsq9xSiCtOFkLALI60mmuPEJyHcV1qBztjrjDDa4gEYz3FdNAmV1tyXASjrQq6GPYi2oTGKdea11KIC1wE8rLx+tHKrBiqiMthydSHn2aMapPYoGQLHs= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2017 00:34:27.6932 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR04MB0360 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 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 Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Sreekanth Reddy Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- 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 e3f89b0e7027..74618f47a28e 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2932,28 +2932,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; @@ -2973,21 +2965,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 @@ -3044,7 +3065,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);