From patchwork Wed May 24 00:33:54 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: 9744681 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 67E9660393 for ; Wed, 24 May 2017 00:34:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BC3828867 for ; Wed, 24 May 2017 00:34:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CC3228869; Wed, 24 May 2017 00:34:38 +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 D641E28869 for ; Wed, 24 May 2017 00:34:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760291AbdEXAeh (ORCPT ); Tue, 23 May 2017 20:34:37 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:7422 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760155AbdEXAe3 (ORCPT ); Tue, 23 May 2017 20:34:29 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="19885592" Received: from mail-bl2nam02lp0080.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.80]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 08:34:28 +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=zWNT+zqK2BNwv67iuP6fBfa3wP/J1SdNVhStjC16MzE=; b=lpAqD4UlFNqCMrTZNErvO0Gij/bFIUZpwj0sF3hmCxA9fbRw7DCVeZ3eabFh5agA6MW/wsTcu6NamSz0tSsPMl2dE5Ebzhw20dnRMpzo8Br8rCsyZ4i/t74VK/z6mVya+gLqa5Rn8CTTP02TPrCv12vYwgnpxnTfOy9jJifb1L8= Received: from DM2PR04CA034.namprd04.prod.outlook.com (10.141.154.152) by DM5PR04MB0509.namprd04.prod.outlook.com (10.173.170.14) 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 CO1NAM04FT028.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::208) by DM2PR04CA034.outlook.office365.com (2a01:111:e400:243c::24) 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:26 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.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 CO1NAM04FT028.mail.protection.outlook.com (10.152.90.87) 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 C5.43.45291.015D4295; Tue, 23 May 2017 17:34:25 -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: 0ac94369-166ac9800001b0eb-f0-5924d5104bab Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id CE.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" , Israel Rukshin , Max Gurtovoy , Hannes Reinecke , "Benjamin Block" Subject: [PATCH 05/31] Make __scsi_remove_device go straight from BLOCKED to DEL Date: Tue, 23 May 2017 17:33:54 -0700 Message-ID: <20170524003420.5381-6-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+NgFvrELMWRmVeSWpSXmKPExsXCddJ5ka7gVZVIgzfLOCy+3LzCbLFn0SQm ixuL17JYbOznsNh7S9ui+/oONovlx/8xWZx+dIDdgcNj2qRTbB4PDm1m8Xg2/TCTx8ent1g8 Np+u9vi8SS6ALYrLJiU1J7MstUjfLoErY9euPvaCx+IVm681MzUwPhXuYuTkkBAwkXh4dSlj FyMXh5DAUiaJho2v2CGcbYwSR2c3sMNUbXt5AiqxkVFi6q+zLCAJNgEjiW/vZ4LZIgKFEpe2 dYCNYhboYJI4++Y7WEJYIEBi45VNjCA2i4CqxOKfx8Cm8grYSdw90csGsUFe4uyWncwgNqeA vUTXqwlANRxA2+wkFm2vAJkpIbCOVeLF9pX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-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)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(2980300002)(438002)(199003)(189002)(9170700003)(5660300001)(356003)(8676002)(47776003)(2906002)(2950100002)(1076002)(5003940100001)(81166006)(106466001)(478600001)(77096006)(8936002)(4326008)(15650500001)(54906002)(53936002)(38730400002)(72206003)(36756003)(33646002)(76176999)(305945005)(86362001)(50986999)(50226002)(6666003)(189998001)(48376002)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR04MB0509; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT028; 1:dyO9sblHA+8aDjL08qN2/qyV+WU0xhEndayZR5YAJ0gPjdonI0Dy4rPD9fInMQYtKg4mYFwb1FkyxhcqlGnP8BaTgAo2b22vzsTx437NpWVYVb0ZB96I5KzQp+QlCeeiUw141Aa2QUtRYKX5JGH5e7jc98uR6YrZrTq9XEARJnO46HLLFdVe4OofeM0X/wjxF38hn9QNy8DevlO6P63mZc6uOWt/Q5SNDKQ4yZoMdLCxOP2dQDjfj72y+DliFfxiMUalOl0txWDiYQMQxXcHgUaLWUcS7PtRo4XZIWcaAFJOVZNjkBgVN5B1hemj3mrdumsX4izpRMYMGyFEwWSZ7ZNR4WikhNNeU59YX8gtP6IJyaee+JP0guNcNZfTh8GHivTCoj6ufPpxgwpdaZfK1ic6VlXQmzMp8me0XRXwDMVK4WaK53g0wODBFmMPiFjYcHszeDA3oNYqz0XFul8JEOADoAwkLZ/CLfy+kxFUWTTQJdMiuLu7CA16M89r0Ao2q9GLBeC0G6c0EWeS7BBnljJtyFnoZBOkKwrL/Ermp0O0O/5UNHQFXmoVCUOebIKm X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR04MB0509: X-MS-Office365-Filtering-Correlation-Id: 65d170a7-3d83-433e-a528-08d4a23ca1aa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM5PR04MB0509; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0509; 3:6tYoitH3vqT7Wpu2pVhLlbKKi+grtGvY51mx8J48yXL65vgzUjzjFKjYpYsMdT9DEnpWRm0NmbEtfOI0cUwgz35ytCjHadG8QGQHZ9kDufglIhGXSJq7J91WEOCb/iPpI+zkJDodFcyqp2rGY4oWjgz7bG7rDgwjXO7S+Els4GaLnRXtQDL45zZ4yHB/sCJbVcCH7XGvzn/mcXWVg5WaOC41bIhdKEWS0bPt+luRMlZOtAgK8X4+c/WIeRax2YIRhIG2OJawQpYyp40pTTqU8pnQLjvnKit0/+obXJKvXoossUei0xvgdhMwH0YGacJlgGyu43C3hDfn52LNWOJUOhB4QpGDkoRoHuQnyZOcOrJPdYXWk8hXrWWPi8D1NdpNtITzQqwhEyBxH2gYJLrY1HNsCGwFjEOnHF1SFgKezjMib9natcDKeGI5pN9MGb7fXAzaraLQ/9LV5iZPkodiKBTwQWQYl5WB8kNUdMYL7QvEjzUjbogpwRNE3uBwcJ46 X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0509; 25:F+vN7qkAD9i+T6o3bMtqzIP0uGAAzNxzzE9yzEqrKq7vSHErrA8IYxpXt/f+d9rxrh/zQcow8Zomfuu9XTwTdweLcft3+PcMg3aJyreJRxSFP1N+OSgi8JsqwSCSVrEMlEy8zzgDbrJT1AVpO3jyaIrwCljn8tQr9n0/898HkTYTQu3ZPEO3WfFd8h75RthbuvQxA4MFa+8Rs8hgKWbzCwsOmOH1DBvBBGMMhMqv79JtIT+qFAgOk0i+V+1jQjTz2XopqsbtjtlCYCgz7WRj9FDt4r4GWLDVA+ipPfDy03USiY51vCVlYpd6CdiAUq/4Xoz/EEvkAZNiFt16QF4x+VjqChek6nR0mjsN1+hv42M4cESspGdc7GEhrO0bo1220BldjddgwqKRJdw+2GM2h7GeUsR7nNz/A98iX7xQoviImLRf3g7KtbOCP3wfhCN+zgO/gKUr7/uvXt/HwaezaPFTGvlq6Bz9V2kFORsOzSo=; 31:kvq6k9E5OyEkabmVCwgvOEhDWqL6DWBKIfjdYTOiFPpH9DuGwg3/ilTcI4F+iuXttDNm5Byzsmn4zBMhJvGT4bgRHph8jbZF9mQC++KRXszbjJV+E9JwppJnZT0DvGyjIFPWnYXowaSfDIRUPdS34X09gGb4vYPbwfXFPan1dMF0F8x93Rv4pbPlJlEIilWnVEY9kT5sc5w8A+Scb+6ayjCfsDb0my6qpMVK9haVzBgZ4EICFH9nOLnH1WOq97M9 WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0509; 20:MWkVxkISlinh0GfqIUpcLpliyrbeVaF+gyJcitJfOQZjrVEK7rMyOc1gnnZ+0YDmHGIQMY4ZP0OHYhWUqKDH0vTMdrlLQcloOF/wiG9t/OPvhGTDyX9rcVaLBC72XPDrwntwYHwIXgKiI7aTFwAXOyZla0tnx/VY8X6UshJy54g/zx786nQIs8LvubUUov3UjP8DBLFMcjeI4FyA7zQrhdjkamWTmmjn3imoAOknt7RJTs7Te/8xcsy7l7YmybkkYQFBTpVzyGtKfD3XDJT3k3ioozH6YKQ8llvkeE5PPmH14b2Nx7wfv+V13qV9dz6yjIb6IID1XAXAfXyp1ePMTItaULvnguux3pjebezDhI7VZE6ba8zBELrJjqyB02DVSWLaQhVfmNAzGLJSvE+zL15AIx2acHlRhx9T92q8CP9CN+x6jGxnhgcob75hN+zXOGiF9Bm9wMAeOyfmkNcZaPtqwyL/NVNLf/nbV/R+ey2F/1XgHYRWf+1hpZFkLdyu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13018025)(8121501046)(13016025)(5005006)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(6072148); SRVR:DM5PR04MB0509; BCL:0; PCL:0; RULEID:; SRVR:DM5PR04MB0509; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0509; 4:mLMS7L03uoht7CoofgpeCzT/AKMceUEB4mjM54WtSj8/dCZT7GKUjPvV9HCc6DEagPXxHkAXMZ9bBE8Vv5eyXmFN7jFhElgIFo76h+Q3E0N503BYbg/cuHY1bZu3aIZ14/G6kptpi80nuR9ar6Lw6BYJzxxeMXN0CEANdvt49J6vGqHwqnE3nUCcf4DiSgQZlQ6D/5IXsOyA7EqDoEawQWhoV6plTBcOiNPnBmQxCii5R2vDHe7Wwx2t52Y/MzdficnGJdtDCBJUV2Qof1z549PKMo1GSsfSqTVmnnr6ztQSMbu4DdqlGbmTqGrVxVckW6Wj/QMpgyyTWHKuzb2lVmUAEaMrqmwZZRAgFuWwBTgF+JU8LNU2OHjDhT1QW06UQURPhH/6em9EqVjCJ3IIauXOQ6fVXuwQ13TL3tqICJ3lK/iTkyQuAmqhB/pNMfk/VnEe64jVqEEFv/te36K6ArIypalm/gXlMJzM1aFu/goMXVRwfShPFUgW7TtLPTH+95fsq65GGwaN0fuFabLbHh2Ll7trOJ5BS+VOREIL/SkHdRhbvTX3WO696+WiZuD23wBNxTh0UN8lg11NvrG9da1QlUHwgkPLxfxNf836bXYk3mzP22a9gHz1EkmnGp/prvHmQGSPD3Lywd27iZsNfdmzAS6GPqjnqqU5BaUwQ23HpubOChh3qHdavzfqB+H72cGgIsSdc26P8ayvGqSiZHo3Tze2cJijWOkE+k8goiAvibBbg6voINtttTf6cdxsP8wqbw/aJN7l0cSiWtyHQCSYNpA+YzpqRNYGjIrq588zdzHSZLWXM+SVtGrOrHGxZyDRZprk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tUOu2ChDXKQKyAcsa4S+TYTsMl0Ad5vVRLymYrcnwvWomizbmwroVUJDnanWK/VL5QNVu/+JeyjSmH+YxJe2/HwgG5uXE0dn3StObs331Q==; 24:bUR/46vCfZgolcB5kFIXjcYS9wyOEhDJK231p9/VgtJJLy5yKNgrwtm3GIdIqYwsHlZoQ0GfYZolQMKg+RceRZ0lgSvID+lBBZE0kvIJ9iw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0509; 7:z5aUdxyUB7w6qyu67rUhJk+rU11XpuBXcS1agIHyDnl+MgWLzDrnDKSSBPC8BsIuGSbwGlQD+YF92SmjmJVX6dC+N/VdQwdALrAVb//UO/5f3fU89ufZrhjXxKo1Gto//QujmWqtg10T/APJN9P4wE5UtNF9P66+GLYxBRhH5mZFn9kTI38hLuK5vyOQZ7Bw/Efd8khjIeWS+b6GrCiV4+sCtpdOQ/npJksIArPCA8xK4SIVZtXxXFnr0Xqn7AixcjjUFrbX5tWIC91vk/2S4kel9KzqaahlA0Mq6O3DfqVOhQZrd8gpGCHTpvyOBTxOBThJCtjEL7vAzS2aoyqz8w==; 20:IR4VhS6VCtHdB/8q6BTbw7LhPDksz7aQ0ud65WX7+9GYguWdbIwjR+WiDeRBfUfaw9twauHs2z+H5GlQpE3MbnfMHoplH+B+mKwLQnZJweWnWudhMYvugqlHzIzzjmvE4+kPFn+EAqYJ3V4cAYXrPzFJKm7qwzoyzgVdPGupkyY= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2017 00:34:25.5447 (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: DM5PR04MB0509 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 If a device is blocked, make __scsi_remove_device() cause it to transition to the DEL state. This means that all the commands issued in .shutdown() will error in the mid-layer, thus making the removal proceed without being stopped. This patch is a slightly modified version of a patch from James Bottomley. This patch avoids that the following lockup occurs: Call Trace: schedule+0x35/0x80 schedule_timeout+0x237/0x2d0 io_schedule_timeout+0xa6/0x110 wait_for_completion_io+0xa3/0x110 blk_execute_rq+0xdf/0x120 scsi_execute+0xce/0x150 [scsi_mod] scsi_execute_req_flags+0x8f/0xf0 [scsi_mod] sd_sync_cache+0xa9/0x190 [sd_mod] sd_shutdown+0x6a/0x100 [sd_mod] sd_remove+0x64/0xc0 [sd_mod] __device_release_driver+0x8d/0x120 device_release_driver+0x1e/0x30 bus_remove_device+0xf9/0x170 device_del+0x127/0x240 __scsi_remove_device+0xc1/0xd0 [scsi_mod] scsi_forget_host+0x57/0x60 [scsi_mod] scsi_remove_host+0x72/0x110 [scsi_mod] srp_remove_work+0x8b/0x200 [ib_srp] Reported-by: Israel Rukshin Signed-off-by: Bart Van Assche Cc: James Bottomley Cc: Israel Rukshin Cc: Max Gurtovoy Cc: Hannes Reinecke Cc: Benjamin Block Reviewed-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 2 +- drivers/scsi/scsi_sysfs.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 0ee5c2133e4c..5c6874cf4388 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2613,7 +2613,6 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) case SDEV_QUIESCE: case SDEV_OFFLINE: case SDEV_TRANSPORT_OFFLINE: - case SDEV_BLOCK: break; default: goto illegal; @@ -2627,6 +2626,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) case SDEV_OFFLINE: case SDEV_TRANSPORT_OFFLINE: case SDEV_CANCEL: + case SDEV_BLOCK: case SDEV_CREATED_BLOCK: break; default: diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index a91537a3abbf..1f243ac16010 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1290,7 +1290,20 @@ void __scsi_remove_device(struct scsi_device *sdev) * wait until it has finished before changing the device state. */ mutex_lock(&sdev->state_mutex); + /* + * If blocked, we go straight to DEL and restart the queue so + * any commands issued during driver shutdown (like sync + * cache) are errored immediately. + */ res = scsi_device_set_state(sdev, SDEV_CANCEL); + if (res != 0) { + res = scsi_device_set_state(sdev, SDEV_DEL); + if (res == 0) { + scsi_start_queue(sdev); + sdev_printk(KERN_DEBUG, sdev, + "Changed state from BLOCKED to DEL\n"); + } + } mutex_unlock(&sdev->state_mutex); if (res != 0)