Message ID | 20221216032936.17841-1-yangxingui@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp752687wrn; Thu, 15 Dec 2022 19:47:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5mP0cD27kyWEClX6zIbK8x2zABftcSSCa47LwIRxFiT5T2q91xS7P4opoRAczvEZRxRYb8 X-Received: by 2002:a17:906:68c8:b0:7c0:d6ba:c934 with SMTP id y8-20020a17090668c800b007c0d6bac934mr12126972ejr.13.1671162461575; Thu, 15 Dec 2022 19:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671162461; cv=none; d=google.com; s=arc-20160816; b=F1tmFjxPzAxVly0Atwhpp/SSYZVNJTiH5teE5b4w4jefnFr+4kwl9gc6L5y01e6+mA 3Wh2B39dXu+iYXLwHOXiYzqfKVDzbd/v2lIknG07FPgV/gpKMCYNImYkwy5pHA+vXPI7 LztWIUNv97WP5nxAxAEs6jr3X5FdtzIhkDEW1fiyR0vzj4lqm8yG+Iyy1o4e/CNlqk1P 0N2PakAVIv8p2LyjllCHwnGZqgfkxZyzAHuFsdbWFqZSJZm4n2dO//DXoQy0CiZWUNYO N68Uk7VoBDlGSfDK/Z7lwbuurKF4C55y38L5kjmGdsKitUwDivbRRCztjUssC3i3ith0 9r3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=d83xc0kf1KiEQFrz+j1tMOs5nvBnTXQNPTNlQJK7qkw=; b=anWOOsQmdWaE/YzW3yk6e1tpZqulh8ylk/Pf8L1QVCUNuKuEUP4I0Kay5LGeZnyXff Lpj11ADmG0I4UQAkZg5gH0aHgOu3iS1KGSElbn2Aw6R2qKI654gc/gvJpzH1ZBrX4XG3 ht67GZw5bhW5jKl6USWm59bJLM2KMW+pJRNmD0xXCxBefCAR+9xDZoqb7a+211CydCHw atCuJa2Bgphp80Df1UnEDFslIwmBMmspUtUJiPvUpx32DUCmf6GsdgsD0iQuC0erU/Ha g9/h8zH3Y21KQST8KiaRqeMoubkX+QJr2iIjqfh8wwD4mP/gLhPvcY4f5VohoITXzPVt jjaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk14-20020a1709077f8e00b007c198bb8c19si553137ejc.414.2022.12.15.19.47.18; Thu, 15 Dec 2022 19:47:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbiLPDgK (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Thu, 15 Dec 2022 22:36:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbiLPDgH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 15 Dec 2022 22:36:07 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9ADD6564; Thu, 15 Dec 2022 19:36:06 -0800 (PST) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NYF605SPLzJpPf; Fri, 16 Dec 2022 11:32:24 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggpemm500012.china.huawei.com (7.185.36.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Dec 2022 11:36:04 +0800 From: Xingui Yang <yangxingui@huawei.com> To: <jejb@linux.ibm.com>, <martin.petersen@oracle.com>, <john.g.garry@oracle.com> CC: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>, <yangxingui@huawei.com>, <prime.zeng@hisilicon.com>, <kangfenglong@huawei.com> Subject: [PATCH] scsi: libsas: Directly kick-off EH when ATA device fell off Date: Fri, 16 Dec 2022 03:29:36 +0000 Message-ID: <20221216032936.17841-1-yangxingui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500012.china.huawei.com (7.185.36.89) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752340849141172882?= X-GMAIL-MSGID: =?utf-8?q?1752340849141172882?= |
Series |
scsi: libsas: Directly kick-off EH when ATA device fell off
|
|
Commit Message
yangxingui
Dec. 16, 2022, 3:29 a.m. UTC
If the ATA device fell off, call sas_ata_device_link_abort() directly and
mark all outstanding QCs as failed and kick-off EH Immediately. This avoids
having to wait for block layer timeouts.
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
---
drivers/scsi/libsas/sas_discover.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
Hi Xingui, On 2022/12/16 11:29, Xingui Yang wrote: > If the ATA device fell off, call sas_ata_device_link_abort() directly and > mark all outstanding QCs as failed and kick-off EH Immediately. This avoids > having to wait for block layer timeouts. > Why does ATA device need this special operation? SAS device does not have to wait for block layer timeouts? Thanks, Jason > Signed-off-by: Xingui Yang <yangxingui@huawei.com> > --- > drivers/scsi/libsas/sas_discover.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c > index d5bc1314c341..bd22741daa99 100644 > --- a/drivers/scsi/libsas/sas_discover.c > +++ b/drivers/scsi/libsas/sas_discover.c > @@ -362,6 +362,11 @@ static void sas_destruct_ports(struct asd_sas_port *port) > > void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev) > { > + if (test_bit(SAS_DEV_GONE, &dev->state) && > + (dev->dev_type == SAS_SATA_DEV || > + (dev->tproto & SAS_PROTOCOL_STP))) > + sas_ata_device_link_abort(dev, false); > + > if (!test_bit(SAS_DEV_DESTROY, &dev->state) && > !list_empty(&dev->disco_list_node)) { > /* this rphy never saw sas_rphy_add */ >
On 2022/12/16 11:53, Jason Yan wrote: > Hi Xingui, > > On 2022/12/16 11:29, Xingui Yang wrote: >> If the ATA device fell off, call sas_ata_device_link_abort() directly and >> mark all outstanding QCs as failed and kick-off EH Immediately. This >> avoids >> having to wait for block layer timeouts. >> > > Why does ATA device need this special operation? SAS device does not > have to wait for block layer timeouts? Hi Jason, Applications that depend on I/O return may be blocked for 30 seconds, and this can be optimized for SATA disks. Different from SATA disks, I/Os on SAS disks can still be returned if they are quickly plugged in after the SAS disks fall off. So I'm not sure if this is appropriate for a sas disk. BTW, I wish the sas disk did the same. Thanks, Xingui > > Thanks, > Jason > >> Signed-off-by: Xingui Yang <yangxingui@huawei.com> >> --- >> drivers/scsi/libsas/sas_discover.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/scsi/libsas/sas_discover.c >> b/drivers/scsi/libsas/sas_discover.c >> index d5bc1314c341..bd22741daa99 100644 >> --- a/drivers/scsi/libsas/sas_discover.c >> +++ b/drivers/scsi/libsas/sas_discover.c >> @@ -362,6 +362,11 @@ static void sas_destruct_ports(struct >> asd_sas_port *port) >> void sas_unregister_dev(struct asd_sas_port *port, struct >> domain_device *dev) >> { >> + if (test_bit(SAS_DEV_GONE, &dev->state) && >> + (dev->dev_type == SAS_SATA_DEV || >> + (dev->tproto & SAS_PROTOCOL_STP))) >> + sas_ata_device_link_abort(dev, false); >> + >> if (!test_bit(SAS_DEV_DESTROY, &dev->state) && >> !list_empty(&dev->disco_list_node)) { >> /* this rphy never saw sas_rphy_add */ >> > .
On 2022/12/16 11:29, Xingui Yang wrote: > If the ATA device fell off, call sas_ata_device_link_abort() directly and > mark all outstanding QCs as failed and kick-off EH Immediately. This avoids > having to wait for block layer timeouts. > > Signed-off-by: Xingui Yang <yangxingui@huawei.com> > --- > drivers/scsi/libsas/sas_discover.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c > index d5bc1314c341..bd22741daa99 100644 > --- a/drivers/scsi/libsas/sas_discover.c > +++ b/drivers/scsi/libsas/sas_discover.c > @@ -362,6 +362,11 @@ static void sas_destruct_ports(struct asd_sas_port *port) > > void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev) > { > + if (test_bit(SAS_DEV_GONE, &dev->state) && > + (dev->dev_type == SAS_SATA_DEV || > + (dev->tproto & SAS_PROTOCOL_STP))) dev_is_sata() would be better here. Thanks, Jason > + sas_ata_device_link_abort(dev, false); > + > if (!test_bit(SAS_DEV_DESTROY, &dev->state) && > !list_empty(&dev->disco_list_node)) { > /* this rphy never saw sas_rphy_add */ >
On 2022/12/16 17:29, Jason Yan wrote: > On 2022/12/16 11:29, Xingui Yang wrote: >> If the ATA device fell off, call sas_ata_device_link_abort() directly and >> mark all outstanding QCs as failed and kick-off EH Immediately. This >> avoids >> having to wait for block layer timeouts. >> >> Signed-off-by: Xingui Yang <yangxingui@huawei.com> >> --- >> drivers/scsi/libsas/sas_discover.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/scsi/libsas/sas_discover.c >> b/drivers/scsi/libsas/sas_discover.c >> index d5bc1314c341..bd22741daa99 100644 >> --- a/drivers/scsi/libsas/sas_discover.c >> +++ b/drivers/scsi/libsas/sas_discover.c >> @@ -362,6 +362,11 @@ static void sas_destruct_ports(struct >> asd_sas_port *port) >> void sas_unregister_dev(struct asd_sas_port *port, struct >> domain_device *dev) >> { >> + if (test_bit(SAS_DEV_GONE, &dev->state) && >> + (dev->dev_type == SAS_SATA_DEV || >> + (dev->tproto & SAS_PROTOCOL_STP))) > > dev_is_sata() would be better here. ok, Thanks for your advice. Thanks, Xingui > > Thanks, > Jason > >> + sas_ata_device_link_abort(dev, false); >> + >> if (!test_bit(SAS_DEV_DESTROY, &dev->state) && >> !list_empty(&dev->disco_list_node)) { >> /* this rphy never saw sas_rphy_add */ >> > .
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index d5bc1314c341..bd22741daa99 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -362,6 +362,11 @@ static void sas_destruct_ports(struct asd_sas_port *port) void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev) { + if (test_bit(SAS_DEV_GONE, &dev->state) && + (dev->dev_type == SAS_SATA_DEV || + (dev->tproto & SAS_PROTOCOL_STP))) + sas_ata_device_link_abort(dev, false); + if (!test_bit(SAS_DEV_DESTROY, &dev->state) && !list_empty(&dev->disco_list_node)) { /* this rphy never saw sas_rphy_add */