From patchwork Tue May 2 18:00:40 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: 9708435 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 3024B60349 for ; Tue, 2 May 2017 18:01:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25C9A2848E for ; Tue, 2 May 2017 18:01:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AAB6284DA; Tue, 2 May 2017 18:01:06 +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 5023D2848E for ; Tue, 2 May 2017 18:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751269AbdEBSBC (ORCPT ); Tue, 2 May 2017 14:01:02 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:22856 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbdEBSA6 (ORCPT ); Tue, 2 May 2017 14:00:58 -0400 X-IronPort-AV: E=Sophos;i="5.38,280,1491235200"; d="scan'208";a="15596099" Received: from mail-bn3nam01lp0175.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.175]) by ob1.hgst.iphmx.com with ESMTP; 03 May 2017 02:00:54 +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=PCkhE59B92cxrcgmIjdJf2OjRemQIm0AflDfaVgLKxs=; b=e+VDi/02hj5S/9Ve1XCDr1J/l1IvUIjIgfBMuUrz2hNYfCP/uPj2af4akb5+FXnWuEC+metKm5l/P0K5K55/d+DbflIefEFYK/TY/B8J3Q4j/WMVxy7FpZtjHn9x/87yZwvf2brqsef1bl1skVwb2MwoeHgsTpcfaAevid8DX4s= Received: from BN3PR04CA0035.namprd04.prod.outlook.com (10.166.70.173) by BN3PR0401MB1543.namprd04.prod.outlook.com (10.163.38.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Tue, 2 May 2017 18:00:50 +0000 Received: from CO1NAM04FT061.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::202) by BN3PR04CA0035.outlook.office365.com (2a01:111:e400:7a4f::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11 via Frontend Transport; Tue, 2 May 2017 18:00:50 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; 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 CO1NAM04FT061.mail.protection.outlook.com (10.152.91.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Tue, 2 May 2017 18:00:49 +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 CF.CF.29323.159C8095; Tue, 2 May 2017 11:00:49 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 2 May 2017 11:00:46 -0700 X-AuditID: 0ac94369-548749800000728b-9d-5908c951c528 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 24.F9.18148.E49C8095; Tue, 2 May 2017 11:00:46 -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 v6 2/5] Create two versions of scsi_internal_device_unblock() Date: Tue, 2 May 2017 11:00:40 -0700 Message-ID: <20170502180043.14734-3-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170502180043.14734-1-bart.vanassche@sandisk.com> References: <20170502180043.14734-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsXCddJ5kW7gSY5Ig1XTlCwWvNnLZrFy9VEm i439HBaPu2awWnRf38Fmsfz4PyaLmV+fsjuwe8y6f5bNY9qkU2weu282sHl8fHqLxWP9lqss HptPV3t83iQXwB7FZZOSmpNZllqkb5fAlbF/2i/2grkaFRM3HWRvYFyt2MXIySEhYCLx7Vkr excjF4eQwFImia5HS1khnO2MEu+nnmeBqdrZ/IUJIrGRUWLHtJNgCTYBI4lv72eC2SIChRKX tnUwgtjMAu8YJfZ3gq0QFvCVmN+8nh3EZhFQkTiwdA8biM0rYC8x9VYDO8QCeYmzW3YydzFy cHAKOEi8+usEEhYCKtn59y8zyF4JgXWsEovn7ITqFZQ4OfMJC8Qu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Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39860400002)(39400400002)(39850400002)(39410400002)(39450400003)(2980300002)(438002)(189002)(199003)(9170700003)(50466002)(48376002)(6666003)(2906002)(305945005)(38730400002)(77096006)(5660300001)(76176999)(50986999)(478600001)(54906002)(4326008)(33646002)(8936002)(2950100002)(1076002)(5003940100001)(50226002)(189998001)(36756003)(356003)(53936002)(86362001)(8676002)(47776003)(81166006); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0401MB1543; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT061; 1:Cxk4Hj/QqceVCzkJVchnJikk75ukaChIUCVAXB8X2pvHW9SFRCaXRWhh8WsxB7BRXMeJuiKw8Fimk10/GbGY1wTWJbMWmVCD3yj5cb6/FQCVRTBE82KNB5jfc7zhJADA60H+m9zz0Fuh6sJ3Uj11KljoDEQ97HXhBn1kp4+R59KqOTreWBAnlUpkejCimSp2lXE/K6+5WfcvRvFV2YZlcvkT7qyKWJuernZYv9KvlmC6zlyZTAWyTmM6kLpnB9VsuGyZ+L4ArvstN9805eM/AxLi4cm3CxZ46YXYQldC6OrPmp1TxJuSZGetZDTW1IX1eNR5Nc5w9kHkdrpc2IFDXzwyA1a8VN4zuEkQEW2DG0GNMUJG0DhmjrBOWAmb2A5NMELUpXPgX3MqA3RMR2DyEAtGgV9ildfsKbvbrmbwVWe69CXmOyEC19OTxXMKxk7Z0BKRey+iISuzbxHXIT0NTRFVkWSjf2PUZtTHG2dIhhfdLywCLBnQQBVQrhachndTki+wr9VwXGWSpnhc9VHXBozCMIwGRx99+4aUteA84/w= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1d3ff76-32bf-4bf6-6119-08d491852b0d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN3PR0401MB1543; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1543; 3:/s0KNv0JyAiyP3ngce8N4e7eGwz9X3ECDnLyxSzQY9q13xTiGWYbmzUL+HQijuYhpyXF1DK62ML+xuejaxL4cAbXpWLZVOt2ayy1XCcPt32Msj7dlK+zgL0pSquDHvlyQ15fLdhOy0maQXLuHyPk5UoNBDlD1znRBtXQX2elmUeU3rZzg2weDYKi9hxCVtaK4ndE+XF2Q9JXiFJ6wklzqVGX0FUA7OUnvsmgA4GNw9RJScHaEawRn9NNmWD2ZjPfqTWrEw2gAKgZdbq8kd5ILmuRvGP2XuXOKmcYjJ1wRxIBb0mLIfayKa/DFclOmb/d6a+RZIveRmh7oH//hc0znDk+vwR46zkVzx8wLDCZMEbOJL3JJ04chtASb4llveHKW0g24cAnD6hLzye0oaZsZMTSh7fZywckjIWZCdpAPmiupQn5qxU6o2fI8OYlaXuUCzJyFbATgvyoKchzfXe+a4xZNN1rhQZJQgnoi/kehnPYeSDVmIC5zGGKZy7TeI6D X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1543; 25:eWhGJIvyB/0yTEFzqiG4Rkt00i6rn34wN+0NFcQdq5HcBOkcfMB3K/NbbKkPZoo4ifihzFcITXtwLmvGeQ1ctWUgW3Ro4sN3H29XbyYYMXC8Ogrm9ZoCQedpZnRnH6VXQtaoh2LN8+eiSZosDM+3r96RCi4dh51AP0n3FPhG2D7n5C6pGnShoAvGsGJeNej5hEF01+1gGWdLSxFXwxDcAj3fWmdRf9JTCeO4hem2KJe1xCFsT9np/hHjCIfPHckUpRI+05b4KZri4SEBPM+GZ5Sy4tGzn4kLeF9cD7V+EcRLFkQLldNbx2srIJNHIDdvLWuVkgLc8GQWL7pxARWZb7rJpWjM3f0AtHtbuOJlpxLhfUqgLp4pygs0rgRf0kWenbKB/TMsj3e2qf4LqYmjVxYl7ocBD/doEVrzP7Ef3Rdn07BKvS4WI9NzexZOB58X2+wMAENupkvesy+An/FrrA==; 31:c9Duzk6yP7ZxtXXPxtirC4ehOt7IPVyuhcU2D8ru8SjRNw4ui2UGGxaGnhaEHroP7GP8OQ1y6MgTAhnFGB0oPzyyAKfMnCRNVP8CutfRrG6HcutkoSN2cqA2+C6eFeLf1JWuL3fQtC/UQJhtH4uXj0hj225Bbf1FTJaBMY+bi/yq0hcz4E3fusgvEwwabc+GwU/OASdvPpxC1X//yvSGN5JwfzxOH26WUKqvElulPWyXmb4kOHp17WrBtGc44sSehMB1iBJqJbJiKv99dDCiIA== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1543; 20:qYlACU8FWZJHEB5CYgJi58xsiu+5FUTW+hFG72wCGCnoW+b4CTKCVfH9OLhKWhfX/UmpBqp2oR7a4eim6rgN5fmeelmGNzUISaX9XNU3syIOKacUcSZT1sQkSwI3tZ5B4Y7klllL4p08Fm3oigt5ZtFbQWZQf8Kqyd1etVCs8jgWgXksx2RECBiqpy0Veh9axvcb9b2u1T3RrPKPd9H+uFZLMZrhVW549wM9/eesIagRFba78tAPW4zfDP7ToqgedZq94//MrocLjET3xJ+jRc/rjom75Fx563QhNAOmMVEcguYRK3dim02FGFNMulXv+86+HhwaFOVTuZ6gnxDXk019gSjItH0kmgInTbJAZCZ0zVVZ1tGeV39OlSirvJ9i2693k+4dLqz+mXLNr1Z6MwkbQZTJa84Nvc+TNTK0Eyj5kvVSax2nL0RbbV2tupUF9WEt7/gpTAj71Pr8RNNgCufthM1j26jbZy0AY1ENYs9URunJzl87PEvzfWgXVpOY 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)(13016025)(5005006)(8121501046)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:BN3PR0401MB1543; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0401MB1543; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1543; 4:vsaorV1HpLSuz44SY8oyGS6/Fo8vSiDMPFkL0zIjetlj3JdwIxHhOk5/evCrOwQ8BDtzg+WrK9E0oJ8yB5Grldm8uvSdV0zAsVVGDjUsJN01+M/3ALa6z9b67v4BF/jjo9BDMIbc06s9HiWp3tM6UK8ow6mdcfilrizaUs9v5X8m0FAuHtoswrSDBT4rswraPQU8ScSYpulRrlDiec+DqldD5Q/0LjkoSLB75sjMmVlLBY/3D6MG0YRfTKGpWfEc40ZhAJa3YOsEWVVg3++nncU9Fhs3hfWCzqhDfWM4EbG7ZRm7UgokePmDNiIFyFN5UFejunfbHIWOmqD5bt38YizIt/LsX1HumyiakmnK8XVcD/IBDSrCO7u3aLMi0CcXy30kIEaMLfhIv3agxO4sTFbt6nPVk2qep5+CU6PNqOeFJ/SCrCcL9z339y5Co7QqNFkILG7FHhY7Huy39L0C4rz5lYW5FMdVS1KGCjpnDNmWSo3M3Zb0UBM0LA9ysiZYFc6PbF4NfkzYGzxPg4SrfhvBxXbCGtJOg7/KU2Hw7GmikYrCUv+NrpYbbCfa4AQTYj+ayHpPLc3C8nGDUdDIOoK96sWpzFBjrJmuEgdyjlI720U+nPoQPUXnvXP9rS0Odz/VVjq/7lnKZzM/DcNTluDA27IlUf16lidS+gbuO6mR3tIwIAbS3n5zhl6mAteOhmPgj3FZPgil/8yvAKLs10BMy3c/1VzppOanTb/yqrM5j3ogKFyrcn+4GKr9xpOP4PtSMlcsJ9HpO5HZ43vWNQ8xt1aCXbD2in4op3xdZXB6MjbKGd9AWvFHw2PnwvBjIbjbStZVywxMODkX73yr2vVuZZMh0mx12lkhFJQ0jrXHJwHgAXLYeKyy2OGUXPWo X-Forefront-PRVS: 02951C14DC X-Microsoft-Ex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L/KJ0VM9inU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1543; 7:s0NHOEKMOMjmuirxA67rF+yrHk19Nb8bUKxgewGT2lSFSvQ+4NpyN59v1fbAm50+kLGi9xUBZx48yfw1j9JR/g6iR4eG4flJ+oynPzvi62q6d+16fpeyzutCkFppc7JwbXAeE32/oLnK3Cj8RcCtYkhF4zPcN+lnPxYhY6DOEYgqLj5lclflUtrmHA9OjiGNI3pQbQsuahlMpkFEaI4yeSsEyvT8Fdmp4j2Fg441+gNV6lW7NnGM8hGBKinEfvhs5Qx/2yofjjf6AVR/tBBN4hMq55xx7NcBqdiYisGDYYfkMxryt/IxguHupQ1fzrXaTUTIqZFzmciNQrLnUOZwpQ==; 20:aVpHn3HAXTIt7kg0bva4yJISN8sfKoxtdykMNUe21JrieDPzAn80ZAB2V1b3fO6U8JdblrDmdMMt2Xxt3rCyy9PFkolH7az8EW/Ingx5eoR6to43t6MyAJ6qB5akGdk14pnfofyGVUN3uwXMEmU7E+V3JRO3KxW9oJ9yjHB7jQs= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2017 18:00:49.8182 (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: BN3PR0401MB1543 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 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 --- 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 25e89cfe4417..d671f6e6062c 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 ca20d3702b45..79bb05fa09d5 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -3016,24 +3016,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; @@ -3065,7 +3063,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 e2f43ae3e264..bb784045ba71 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)