From patchwork Sat Mar 25 01:17:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ye Bin X-Patchwork-Id: 667351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 277EAC761AF for ; Sat, 25 Mar 2023 01:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231945AbjCYBSl (ORCPT ); Fri, 24 Mar 2023 21:18:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbjCYBSj (ORCPT ); Fri, 24 Mar 2023 21:18:39 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A643017CE6; Fri, 24 Mar 2023 18:18:38 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Pk1Rs4kxFz4f3mL8; Sat, 25 Mar 2023 09:18:33 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP3 (Coremail) with SMTP id _Ch0CgCnUiDpSx5kmy0NFg--.49234S4; Sat, 25 Mar 2023 09:18:35 +0800 (CST) From: Ye Bin To: jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ye Bin Subject: [PATCH 0/5] limit set the host state by sysfs Date: Sat, 25 Mar 2023 09:17:29 +0800 Message-Id: <20230325011734.507453-1-yebin@huaweicloud.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgCnUiDpSx5kmy0NFg--.49234S4 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ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Ye Bin Now, we can set the host state by sysfs with any value. Actually, it doesn't make sense. May cause some functional issues. This patchset introduce 'blocked' state to blocking IO, we can use this state for testing. Perhaps we can use this to do some fault recovery or firmware upgrades, as long as the driver support is good, it may be insensitive to the upper layer. Ye Bin (5): scsi: fix switch host state race between by sysfs and others scsi: introduce SHOST_BLOCKED state to support blocking IO scsi: limit to set the host state scsi: blocking IO when host is blocked scsi: run queue after set host state from blocked to running drivers/scsi/hosts.c | 11 +++++++++++ drivers/scsi/scsi_lib.c | 4 ++++ drivers/scsi/scsi_sysfs.c | 18 +++++++++++++++++- include/scsi/scsi_host.h | 6 ++++++ 4 files changed, 38 insertions(+), 1 deletion(-)