From patchwork Wed May 24 00:33:51 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: 9744685 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 CD30260393 for ; Wed, 24 May 2017 00:34:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0DAF28867 for ; Wed, 24 May 2017 00:34:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5DE92886A; Wed, 24 May 2017 00:34:41 +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=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 3199028869 for ; Wed, 24 May 2017 00:34:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760650AbdEXAej (ORCPT ); Tue, 23 May 2017 20:34:39 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:6364 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760487AbdEXAe3 (ORCPT ); Tue, 23 May 2017 20:34:29 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="122517434" Received: from mail-bl2nam02lp0085.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.85]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 08:34:27 +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=wcd6zzeV6/j57BqF32ly9wF40FookaIsmsnC3wU4Pl4=; b=S9+F8vy/HS7NUoubzvYU5vfsIZhlWFUMpvZlQXE8VNtlovezVEfBPE0cdSCEQh12mHF2JvaAdXkoHbiA7K5xfiIf31HFrd2tAZ4FqO9Gw/mYDQ6dn2G+8lt7arvVPwcjpnasNrrOgS0+vV8aRJbLLErpqAOYW475zNk292O21RQ= Received: from BN6PR04CA0037.namprd04.prod.outlook.com (10.174.93.154) by CY4PR04MB0361.namprd04.prod.outlook.com (10.173.188.138) 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:26 +0000 Received: from CO1NAM04FT056.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::204) by BN6PR04CA0037.outlook.office365.com (2603:10b6:405:3b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Wed, 24 May 2017 00:34:26 +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 CO1NAM04FT056.mail.protection.outlook.com (10.152.91.198) 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:25 +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 73.43.45291.015D4295; Tue, 23 May 2017 17:34:24 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) 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: 0ac94369-166ac9800001b0eb-e9-5924d510679f Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id FC.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 02/31] Create two versions of scsi_internal_device_unblock() Date: Tue, 23 May 2017 17:33:51 -0700 Message-ID: <20170524003420.5381-3-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+NgFvrGLMWRmVeSWpSXmKPExsXCddJ5ka7AVZVIg5dz5CwWvNnLZrFy9VEm i439HBaPu2awWuy9pW3RfX0Hm8Xy4/+YLGZ+fcruwOEx6/5ZNo9pk06xeey+2cDm8fHpLRaP 9VuusnhsPl3t8XmTXAB7FJdNSmpOZllqkb5dAlfG9JX32QvmalS0TDzG2sC4WrGLkZNDQsBE YvPS6yxdjFwcQgJLmSRW7tzCBOHsYJRY0LeHGabqz+5Z7BCJjYwS9xuaWUASbAJGEt/ezwSz RQQKJS5t62AEKWIW6GWSOHulAaxbWMBH4t7XVrAiFgFVifMPDgKt4ODgFbCT+NpiA7FAXuLs lp1g5ZwC9hJdryawg5QIAZUs2l4BMlJ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kg01GIuKk4EAGq5l77ZAQAA MIME-Version: 1.0 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:(10019020)(6009001)(39410400002)(39860400002)(39840400002)(39850400002)(39400400002)(39450400003)(2980300002)(438002)(199003)(189002)(9170700003)(76176999)(38730400002)(50986999)(33646002)(4326008)(5660300001)(36756003)(53936002)(305945005)(2950100002)(356003)(6666003)(8936002)(2906002)(106466001)(50226002)(48376002)(81166006)(50466002)(47776003)(8676002)(1076002)(5003940100001)(77096006)(189998001)(86362001)(478600001)(54906002)(72206003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR04MB0361; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT056; 1:cUBrwKh6TzoT2YFarztgbmZStmHHZvVVvZj37h5fGRpRFUUWSds57jKJNf02MG1cekHDxcseEwO8zrUi58MfUZ6vPEd90ICussfhw0Ua9MSakzMgnFY3T7g47VH2tl9xfTiUxpJ8ISnFKKB++GmbYm4ma4M9cC0LtVDx+MOGCqmnHITJaCi8+3Kxr87iNf44503KtPvKF9Q9AMwkr0bFY6RKn5VEP0cG7gwBLcaPGaly7sLZ/zilNo+Tl6CmO7u+eHDaH4OaacdhJBkBoTyBzaSLM97JIHkuUXbTKijhmpLz/X1wxt1U9BtXbdsn3FAGIZF5O6XsH5vnIUZOEP1Lj+ijDJInUXxR9Gv4DeD+AZajIXIFPNM4YIsgroiRnQVfnaJYynX2a7xuUNFitHtV8+6UvinbwKncv2Zcea27uu/I44geJqvQXlWaAc0FR25mCa8JUxaxKL+mm8DQJB3EsTWG1h6vr7pDIfO6N/pHgm+job2/jd6126gzwaQzV/FE6J/3S93CT/ZmEf4X1RHFf0wf9jlDLKfzzMvD/NRGPwI= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR04MB0361: X-MS-Office365-Filtering-Correlation-Id: d90c8ba8-660d-4e40-c16a-08d4a23ca160 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:CY4PR04MB0361; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0361; 3:65gPIn8tzdKQ2ai/V3hvi1Zc0FR4SCcd1FNc/8ibFzB5jYOx3TRw9DNBwRo1a7yk791K7kMbpYZkBvgiWtVd/rteUAFNT7/oAcYyMJ/wVnaM7b0ZabEltpQVLxrfaOeeeCzafxhO+Yl4ismiHgYRcING2AwyJnl6ajZZDI4uuS3Ikl/bN+7f7WNZh/4syLo8s2gNRBJb1tjvsQQ28KeJVc7Tq+ksvQ26RwpT7hFESMnyO1cN1opF2Shcsb7OHBTV1+yIZItqAsCpQs5phI8Oc7sEairkS5m0QIj+Ial4Cz0N91Sz2W3UC1OmpRjtOqQHR97/HGYgs70R4fq/ZlvgVFk6yFLvqjOuiYoIqtkUBMKY/+cQCmdXbQ+MqMbCqQXpqCl7hRsaJ55PkpsDsDHVYxcyGkPVZJowUpYvEL5Y8n5hTHaU0ihulwKW4vm0H8KhU4OwmHYzDteQEhNXyfhx48TYdPQz2PgHsPJb372iIH0k+8kjJ9ar3dkAJ9Q8yK8+ X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0361; 25:E3V81yqIHKyZdH3ZKwZwkZTC1j3Z9hfFWyuoDupzqL+N/rT6pD918QQ1psxkIOhwsqio0cce2bjNEkesFfpnn2c+iWerFXt2DL4lHtKKUZARRGEWwAMmm9ZjV9gPThwgdos3FPR1qB+ju2lt7+oqS7PNqmY6im76GeBS5yfxKTqPinjm8QUAI0wejw/bTwn4Kc6zjcQQhLVDVa7JVq5kZS8gyZW90jKO95/kI32pnuB+FKlDp6SPbJkEfxgaJDOz7IJjB1SrRuCVIgGRhP5CPKfovlWcwdR9xKypa3YrnL300iMSozG7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ispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(13016025)(13018025)(8121501046)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(20161123562025)(6072148); SRVR:CY4PR04MB0361; BCL:0; PCL:0; RULEID:; SRVR:CY4PR04MB0361; X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0361; 4:hYcjkMoStXm2IILVFJyF8FMrm4uqfNdoUhbUbTBsku90ert9SK4WSNRCsDyGihlSyzpN/0/7pGbYXn8aMABHlrsLyf3+8VXfeLkm8vZAcosgjkvhV+OgDqhvJSaLjjwFWlPAYXr3mXgKzrNPWbBpgS3rJj7GQpZXjoyun7mw1ShrHSTdk8MVrEWwMIwkOVLT6WyBTeOHJDgzLRssDkQC8l+SyZqDuuUKbk7Ob+AswB+3nkYedYq0GQSDnOVMmFhiowDvQaV0a1E2R6lHaHb/8jHQ6HbYSpdLlLhWKjSj1ZBamgNu7dlAaNyUqfD14yn01H57VsDFbmzmUy1ckXCYDgnlEzeIxEH4z2iKgIdutuTexNWaYVJlARr+xqGdyKkF3mWGrO5QF5F5YeMw4YO8Ju6yFJ+iNk8/LJ8hhfo8s8+2lqgJzypSLiG1zZCPuzMWOfDcSHEYz1LeAqOddSdFFfVoxDpoyG6nGhOjM4SLIfiSUmLxrMivLnno3eJi2nPssyTEO0ZbGJjvubKdStIS+3Jri1Eba4jVy7T4KV6Nsbqv3VupiFk31Pm1XHwqPAKpCcMOeijMm/isVchiX9XcxJuZRQZfPaHvTiDrZCTtBkSiGlAuXwJY5aNCQUHfpFy6WV0J6GEHBeEDPprJERLIs2wyA4dTC139WkYZ5CoG83sCfBByqi1tG2mHwCx3JdKm7Xsao/N8CMXjo0kSq6tGl6l5rOPpkfU0/CdpV67n0nvqKvDA60y+e1s8Zs3PeSL1oerLNqLbYvDVSaPIEYfvDlExDidsKbiVzSN+l+hTUs8uyah2dw9VRxBzGJkaPw1oowf6oWGLFAyrAj9a76xu1vqBbxOWCpou2xFhjscGudhNRRLbVK4wTdEVw6uSpBEK X-Forefront-PRVS: 031763BCAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR04MB0361; 23:elxxbWWg4WT9P4pl2GKzOy9kGEqOlMA+OH1uVx4jq?= =?us-ascii?Q?vxdKQPCAHFdTcE2MO/orWBxC0qMFWxK/A6yLtH/z3x7KuoLWcog7PNAqXbnm?= =?us-ascii?Q?BYh38Q1az1p0JV7dhaJ2mzHwS+jaCaXpnI6x6avchLPh6q3YLWBsBvAhX6SG?= =?us-ascii?Q?sXShJE7+bOU9L9i0gIeP/l0PU8mYV0FNqBBVK5ZyvRg+HHqdhjjpyGLCdwjU?= =?us-ascii?Q?EnW0bug7yTylSKFZKeYCMTGTv3s4qP7Dea057sUe9LVVxcORzNI+H1eFT69F?= =?us-ascii?Q?L9n32crp1wCkSQbMGhqx/AgPjUayOSDGR8VsiPmE3YN7yxCY+zuiG/Xn5JP+?= =?us-ascii?Q?Z8nLqlIVP3GDZ3cI1i9yBtmDA+WPxpnbAtfaaubLRbq/T2sRcdLpbgObuPH+?= =?us-ascii?Q?hFl3R8dFd830OrcbpF1nKjE4QACLgolWds3xJG2cbxoNNsZ2NeXVQqheGFaY?= =?us-ascii?Q?wu/Y+rECBJg2w8Fj80jRDhQlC6y9kTHguaV/xt6slah7nxUohFFvhfHTLJrj?= =?us-ascii?Q?ixVPWP5qYn0xIrUSPEipfFxF+GxXIyKgop2ycvguR7MUiPDbCQFpfTfPr0RE?= =?us-ascii?Q?Umbu/Pf645iSY9iu0KXVj6em3cVTCi/30wPRet82oug1BP/A96I1KJo2pXx7?= =?us-ascii?Q?RuczD+1LmUhvsh9gStK5C83IkUH0OmQgScg3VxH68GgQq6lASj3j+Dqtq7xr?= =?us-ascii?Q?/5a62pZdIwfofdWoAxHH3yqqE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nbcbAPS1Uf/c8cwO3IBBGxspfu0pAHsRKzZqDh1EAdD2CojMrOfqJaGRXQlEWKDyAOZtDDvJlktnwSpJLjhSaPQeQ6m0vZg==; 24:nAAospNK2o2rWsjDB4VnKbHYDKNqZLbl88+s4xO46pPcYld3202tX7Nk/OddypTwHQa9dtmdVAPXDLTadaOCaHFnQFPxbJzVC5G3Qd8FluU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR04MB0361; 7:ij4XpXTsIZnNQMEKGGl3iCsRT09dk3lPP06L/0KCMETRCMo4g0IQ9pjZa6fa6Tq4QmcUSVNjWqeL6rGjGolm973hv9VV7GUSldv2Wj8+osJcZYg/LHYDFPufJl4DtNmCTkTcvoIA2aIndHV4dttRwxb6B4tYYkEQK+ydjH3BQEQNA0M6xPtsvsIajlAc+BNZ8xo14jPwEMM3YjFPPhYDhcUphWfGbn0XegigKs6N6OcgDr4jfciZiT0d6S95qhR2NH0oKJRYIzWsnraaMnO4HZ4QfR7KzFRfyrtoilgLhSIOnbQrErNi7KRFb78R2NuaTpNY8d5y52+7P0NHXXJZHw==; 20:TOZU7SCB6xpKyFGSGwCutxFP7n4ykBLdyDhiJeOoD9jP2U4kV49xly8yVR2Ly3O0qNilZ/ebO/F9vsK1TwRBH/HT98cG0eZQscyZOvsrIAzXzoEOtoxPYNRsMj7JddBwtIxqF+RkZJsn8PqsMvequ39T0PqdrBh1wXe9qwxMLHc= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2017 00:34:25.0448 (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: CY4PR04MB0361 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 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 | 46 +++++++++++++++++++++++++----------- include/scsi/scsi_device.h | 4 ++-- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index c63bc5ccce37..22998cbd538f 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2883,7 +2883,7 @@ _scsih_internal_device_unblock(struct scsi_device *sdev, sdev_printk(KERN_WARNING, sdev, "device_unblock and setting to running, " "handle(0x%04x)\n", sas_device_priv_data->sas_target->handle); sas_device_priv_data->block = 0; - r = scsi_internal_device_unblock(sdev, SDEV_RUNNING); + r = scsi_internal_device_unblock_nowait(sdev, SDEV_RUNNING); if (r == -EINVAL) { /* The device has been set to SDEV_RUNNING by SD layer during * device addition but the request queue is still stopped by @@ -2902,7 +2902,7 @@ _scsih_internal_device_unblock(struct scsi_device *sdev, r, sas_device_priv_data->sas_target->handle); sas_device_priv_data->block = 0; - r = scsi_internal_device_unblock(sdev, SDEV_RUNNING); + r = scsi_internal_device_unblock_nowait(sdev, SDEV_RUNNING); if (r) sdev_printk(KERN_WARNING, sdev, "retried device_unblock" " failed with return(%d) for handle(0x%04x)\n", diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 74618f47a28e..7ed71db8c38a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -3011,24 +3011,22 @@ static int scsi_internal_device_block(struct scsi_device *sdev) } /** - * scsi_internal_device_unblock - resume a device after a block request + * scsi_internal_device_unblock_nowait - resume a device after a block request * @sdev: device to resume - * @new_state: state to set devices to after unblocking + * @new_state: state to set the device to after unblocking * - * Called by scsi lld's or the midlayer to restart the device queue - * for the previously suspended scsi device. Called from interrupt or - * normal process context. + * Restart the device queue for a previously suspended SCSI 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_RUNNING state - * or to one of the offline states (which must be a legal transition) - * allowing the midlayer to goose the queue for this device. + * Notes: + * This routine transitions the device to the SDEV_RUNNING state or to one of + * the offline states (which must be a legal transition) allowing the midlayer + * to goose the queue for this device. */ -int -scsi_internal_device_unblock(struct scsi_device *sdev, - enum scsi_device_state new_state) +int scsi_internal_device_unblock_nowait(struct scsi_device *sdev, + enum scsi_device_state new_state) { struct request_queue *q = sdev->request_queue; unsigned long flags; @@ -3060,7 +3058,27 @@ scsi_internal_device_unblock(struct scsi_device *sdev, return 0; } -EXPORT_SYMBOL_GPL(scsi_internal_device_unblock); +EXPORT_SYMBOL_GPL(scsi_internal_device_unblock_nowait); + +/** + * scsi_internal_device_unblock - resume a device after a block request + * @sdev: device to resume + * @new_state: state to set the device to after unblocking + * + * Restart the device queue for a previously suspended SCSI device. May sleep. + * + * Returns zero if successful or a negative error code upon failure. + * + * Notes: + * This routine transitions the device to the SDEV_RUNNING state or to one of + * the offline states (which must be a legal transition) allowing the midlayer + * to goose the queue for this device. + */ +static int scsi_internal_device_unblock(struct scsi_device *sdev, + enum scsi_device_state new_state) +{ + return scsi_internal_device_unblock_nowait(sdev, new_state); +} static void device_block(struct scsi_device *sdev, void *data) diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 6ce6888f3c69..5f24dae2a8e1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -473,8 +473,8 @@ static inline int scsi_device_created(struct scsi_device *sdev) } 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); +int scsi_internal_device_unblock_nowait(struct scsi_device *sdev, + enum scsi_device_state new_state); /* accessor functions for the SCSI parameters */ static inline int scsi_device_sync(struct scsi_device *sdev)