From patchwork Thu Aug 9 19:41:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10561863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 058FA13B4 for ; Thu, 9 Aug 2018 19:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E960A2B979 for ; Thu, 9 Aug 2018 19:42:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD3742B980; Thu, 9 Aug 2018 19:42:16 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 01EBE2B979 for ; Thu, 9 Aug 2018 19:42:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727068AbeHIWId (ORCPT ); Thu, 9 Aug 2018 18:08:33 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:1352 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbeHIWId (ORCPT ); Thu, 9 Aug 2018 18:08:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1533843735; x=1565379735; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=EgPiQzzz6Fpmtd7fVuvWHby5pKn7rmPLzxwYObnw5Vk=; b=cP5EOFzKLe6MC04dcpX330qTvneJ7V9MOzhLGCKQrQPw6a9nrNddsMUj zam/TEZYy2kv6T8il8k6U5P7UcCDPd0D35EK8NjqnGmu8XMcawkD6fkLw jKz8J2k0NFnYWLV9KnplClZObZrbxStW9Ur++8kXkNUl8zqGOuwa8gHY+ x1WSy3Wo1TBdz4TJvfGDianq247yM7EPRuYIHskSQ4SQgqr6+nee1hUoX VMUSZqOEjxZQkOnErgP9IKV9LzvDQl+H/FXnxJjAf2uw3jzMbEm/tWy1q 34nbZtUkuoe1/+VOjIbLW0JqMAE9+hZqL5VVtD1zMK/M7SzxJGnqPtzsX w==; X-IronPort-AV: E=Sophos;i="5.53,215,1531756800"; d="scan'208";a="191119599" Received: from mail-sn1nam01lp0115.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([207.46.163.115]) by ob1.hgst.iphmx.com with ESMTP; 10 Aug 2018 03:42:13 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=81Su0FNYEY6XUIk/2psOkQFY3q1rbV4XU7ZmwTaeW18=; b=U4KkXh/yguAY3xxpZ3YKsTls3CUtV/X4IeZRvxjbwlIpONohacvbPv983c1XqxG1hMEOc5rPHrrUBEMVrbp/mcTjRQhSb5pJelPofEe/rIW7nkoSdEkAAKdbGkfp3TdITWKE5QlCzk6ggcYDjteREGg2TiIrSrwjCx+W+hmI6BA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; Received: from asus.hsd1.ca.comcast.net (174.62.111.89) by MWHPR04MB1198.namprd04.prod.outlook.com (2603:10b6:300:71::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.23; Thu, 9 Aug 2018 19:42:08 +0000 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , "Martin K . Petersen" , Woody Suwalski , Ming Lei , Jianchao Wang , Hannes Reinecke , Johannes Thumshirn , Alan Stern Subject: [PATCH v6 06/12] scsi: Reallow SPI domain validation during system suspend Date: Thu, 9 Aug 2018 12:41:43 -0700 Message-Id: <20180809194149.15285-7-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180809194149.15285-1-bart.vanassche@wdc.com> References: <20180809194149.15285-1-bart.vanassche@wdc.com> MIME-Version: 1.0 X-Originating-IP: [174.62.111.89] X-ClientProxiedBy: MWHPR2201CA0066.namprd22.prod.outlook.com (2603:10b6:301:5e::19) To MWHPR04MB1198.namprd04.prod.outlook.com (2603:10b6:300:71::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76ed03ea-518f-4133-49a0-08d5fe3031b2 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:MWHPR04MB1198; X-Microsoft-Exchange-Diagnostics: 1;MWHPR04MB1198;3:2fIOAM0Ws19dHKfMlk15OqAcLj23MLVxlGiZgLz+pMY5iVtrIH8p+LX1LzBFSK5za/edJDWOI4hpORnZBODRsm68PWN1+lB3RmW7JHxwR/fJB88+MH1fMyfDVn6R4r/0VKQ+x2Ns2Hx5ySISBoDibrayJCvE4CXHbHASZACYZpa0AsM4DtXkFGhywHZn4U9F067DrfJSA/C4Vicww5Phv+fC6r2GlvOl0P3X64wBUJ4WQ3YGxRTA8L6//VtTzRb3;25:8/f9SH7FsmCzIaKrNAW0kKszDfr3eevJ56KwUOmgW97hUHLniASt7D2Ztnz4zuEKhWnGfv+LGHWhCITX0rDldMpcTje/YplPDNROLWkczPvCL7LDGfuSe7VR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fE50kgTQgcma1yzV2f427y5NG5J/zjti3wzYjL7KCT4JKvAxTL9vZyZ7zzBteYWU/bJjQDxQshQxdvC5IG/caW+NahXCOqia3THVlz35rmMXXT7R5ds8hOAi4pJvtpWTy1yAZVgT4TcTmekjj0abS2ttfoKcw/kmdCNjjLU3vO5un1WXlElyPssMyXKKwGgPnUz6c/1DGxbCK/glc6dqCMFcMqtApxZ41u/CpVFvinwBkvpPNYSJ9Q2sPULAdKmd7X2zLvEW9fYGxR9Cx26JvCuwFKuD8rinlkvdBhk4CPWweFQK/PRn0q4uJ0embQFxH8UhvG/CYtOiaZlkOEuPTOX4TXXBVqvpHqseDrL7/38uevfplGFWZn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(35762410373642)(146099531331640); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:MWHPR04MB1198;BCL:0;PCL:0;RULEID:;SRVR:MWHPR04MB1198; X-Forefront-PRVS: 0759F7A50A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(136003)(366004)(346002)(376002)(199004)(189003)(39060400002)(76176011)(50466002)(476003)(51416003)(4326008)(478600001)(52116002)(15650500001)(6486002)(105586002)(72206003)(48376002)(5660300001)(47776003)(305945005)(2616005)(956004)(7736002)(6916009)(6666003)(486006)(8936002)(2906002)(68736007)(36756003)(66066001)(186003)(7416002)(446003)(81166006)(50226002)(8676002)(81156014)(316002)(6506007)(386003)(106356001)(97736004)(25786009)(11346002)(16586007)(54906003)(14444005)(6116002)(1076002)(3846002)(86362001)(26005)(16526019)(53936002)(6512007);DIR:OU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W5I19dkZGbyyDeUxnMXr0sDQYXeB47HWJWZSgho7sTvFwFYFxjZIC7nv4/NwTi6eYGuVS6x+A4l0hH0iiF9MxDLn7p6+hNZTj067TmNkMb5KaOOZgsYKlFUlHeGBkTXp1mnBalHDzsASNr3F3/e2M27ry/5gASqCa/IcFL66BYDC4EeynZe58893Nw==;5:FQp3BTHwENee9mQ5/W4cEOHMog9xA/OkC6UQ+GjwF2qLJJ16goKqY3/SIjrOTkM2nV/QxTru+IMVne6nmJml9EAJ09BOtaDOBbspKT8QkYWTNrvYaJZsf7y/zs2Bxr5ymkZWZPQXGChKRu3eM99QqCHkZmhUdonAtJK9BhotUj8=;7:ZbjcnvZT0HHXwbmzZqzj5EK2hrNCkAcfQhqnJt4u+S6R/BgUp5GQwGY5ZSAn6hTPBzOqJsMd8oP05U8ow4VF5fjFT2KoRSuh0F6Ew2yke/GfLlnlpAsi5bwgLz/TyE0l4q3AXpRaLPnvq7ndNWtrmiSAXvGFz3o3CVHfphnD+DAQgRctVYbRllDTQKGM36Ueg83iqaW7bbiWAolfiemuqN19S0zJ0rHpN113zGJN9FkzL058l0M6wD16pHkBaNvE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR04MB1198;20:GimqQn85xWDDk14FQRyE96KukRyp3E/CEcawdLu4dLKiYzpXSXruB64+nnXYzoDWbAt3c/AG2d0IyIXF4ZU4Y6uNzxFcguEjTLSJ89QLtk9lXaYhZRE+V/3DaGRz1K+wvma6N2zpLpjG2t4PDdz3vH/dxgx16GJGKNeqKxFrCY8= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2018 19:42:08.4162 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76ed03ea-518f-4133-49a0-08d5fe3031b2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR04MB1198 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 Now that SCSI power management and SPI domain validation use different mechanisms for blocking SCSI command execution, remove the mechanism again that prevents system suspend during SPI domain validation. This patch reverts 203f8c250e21 ("block, scsi: Fix race between SPI domain validation and system suspend"). Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Woody Suwalski Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- drivers/scsi/scsi_lib.c | 37 +++++++++++++++++++++++++++++-- drivers/scsi/scsi_sysfs.c | 1 + drivers/scsi/scsi_transport_spi.c | 15 ++----------- include/scsi/scsi_device.h | 1 + 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index d466f846043f..89f790e73ed6 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1366,6 +1366,7 @@ scsi_prep_state_check(struct scsi_device *sdev, struct request *req) ret = BLKPREP_DEFER; break; case SDEV_SUSPENDED: + case SDEV_QUIESCED_SUSPENDED: /* Process RQF_PM requests only. */ if (!(req->rq_flags & RQF_PM)) ret = BLKPREP_DEFER; @@ -2683,6 +2684,17 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) break; case SDEV_QUIESCE: + switch (oldstate) { + case SDEV_RUNNING: + case SDEV_QUIESCED_SUSPENDED: + case SDEV_OFFLINE: + case SDEV_TRANSPORT_OFFLINE: + break; + default: + goto illegal; + } + break; + case SDEV_SUSPENDED: switch (oldstate) { case SDEV_RUNNING: @@ -2694,6 +2706,15 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) } break; + case SDEV_QUIESCED_SUSPENDED: + switch (oldstate) { + case SDEV_QUIESCE: + break; + default: + goto illegal; + } + break; + case SDEV_OFFLINE: case SDEV_TRANSPORT_OFFLINE: switch (oldstate) { @@ -2994,8 +3015,13 @@ scsi_device_suspend(struct scsi_device *sdev) struct request_queue *q = sdev->request_queue; int err; - if (sdev->sdev_state == SDEV_SUSPENDED) + switch (sdev->sdev_state) { + case SDEV_SUSPENDED: + case SDEV_QUIESCED_SUSPENDED: return 0; + default: + break; + } blk_set_pm_only(q); @@ -3011,6 +3037,8 @@ scsi_device_suspend(struct scsi_device *sdev) mutex_lock(&sdev->state_mutex); err = scsi_device_set_state(sdev, SDEV_SUSPENDED); + if (err) + err = scsi_device_set_state(sdev, SDEV_QUIESCED_SUSPENDED); if (err) blk_clear_pm_only(q); mutex_unlock(&sdev->state_mutex); @@ -3031,8 +3059,13 @@ void scsi_device_unsuspend(struct scsi_device *sdev) { mutex_lock(&sdev->state_mutex); blk_clear_pm_only(sdev->request_queue); - if (sdev->sdev_state == SDEV_SUSPENDED) + switch (sdev->sdev_state) { + case SDEV_SUSPENDED: + case SDEV_QUIESCED_SUSPENDED: scsi_device_set_state(sdev, SDEV_RUNNING); + default: + break; + } mutex_unlock(&sdev->state_mutex); } EXPORT_SYMBOL(scsi_device_unsuspend); diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 496c5eff4859..8c152e35ff77 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -37,6 +37,7 @@ static const struct { { SDEV_DEL, "deleted" }, { SDEV_QUIESCE, "quiesce" }, { SDEV_SUSPENDED, "suspended" }, + { SDEV_QUIESCED_SUSPENDED, "quiesced-suspended" }, { SDEV_OFFLINE, "offline" }, { SDEV_TRANSPORT_OFFLINE, "transport-offline" }, { SDEV_BLOCK, "blocked" }, diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 16bec4884249..582b18efc3fb 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "scsi_priv.h" #include @@ -1008,19 +1007,11 @@ spi_dv_device(struct scsi_device *sdev) u8 *buffer; const int len = SPI_MAX_ECHO_BUFFER_SIZE*2; - /* - * Because this function and the power management code both call - * scsi_device_quiesce(), it is not safe to perform domain validation - * while suspend or resume is in progress. Hence the - * lock/unlock_system_sleep() calls. - */ - lock_system_sleep(); - if (unlikely(starget->spi_dv_context)) - goto unlock; + return; if (unlikely(scsi_device_get(sdev))) - goto unlock; + return; buffer = kzalloc(len, GFP_KERNEL); @@ -1056,8 +1047,6 @@ spi_dv_device(struct scsi_device *sdev) kfree(buffer); out_put: scsi_device_put(sdev); -unlock: - unlock_system_sleep(); } EXPORT_SYMBOL(spi_dv_device); diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index a2e3edf8be12..a67dc459b70d 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -44,6 +44,7 @@ enum scsi_device_state { * no commands allowed */ SDEV_QUIESCE, /* Only RQF_DV requests are accepted. */ SDEV_SUSPENDED, /* Only RQF_PM requests are accepted. */ + SDEV_QUIESCED_SUSPENDED,/* Only RQF_PM requests are accepted. */ SDEV_OFFLINE, /* Device offlined (by error handling or * user request */ SDEV_TRANSPORT_OFFLINE, /* Offlined by transport class error handler */