Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2159491rwb; Thu, 15 Dec 2022 20:56:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXtvORFBsoNcVdj64UqxitRTFQ751Hgy5jFOv43bIJKxeE1Pv011eqgfT7fQlajwKFU7Jq7P X-Received: by 2002:a17:90b:124c:b0:223:4533:ebe7 with SMTP id gx12-20020a17090b124c00b002234533ebe7mr9963971pjb.20.1671166584985; Thu, 15 Dec 2022 20:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671166584; cv=none; d=google.com; s=arc-20160816; b=su1CXuhoKW5ZsAdWt5ALLwL2vAuU8RKrlOAMhlAZ+6RVHd+6OQtGM3ny0alMFxUAD8 Bxpip/eooPlbV4cuTNRKbC+W9lBGQcYE0VmdchgNYINkWHy1YpjCJq6r/yNDNAcDNOg+ SPffDzLHIf1dz1f5XlgNQaQJ/+W/B+qLH/qMziRKLsluq7dwmiJLJRMbz+WYB5I/+8FN 3FU0moT1PVCWm7cs+At+SZqkuY2x9pRC2J5nf563d6OBuRgf8Ya2JqdAWTvc4clF+cZx iofc6hAItomKFJ4tUbP0uj9BIByN6fYhsJasrsEbPtHeFeCyTKonpPq0SRJGLPUh/l4+ ripw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=PdJUABWhoohXopsqRNWBjBzbw7JCfDRik9zbXrfiyKs=; b=d2rLdMmieO1PcJQNrvwAHZ40OZGVVpfWwJcONb1eNzKMRXfCfc7PvwXEzaPzy1bqn8 9So91LysBUMTjtio6oHHkOs6Zdrle8XG+lMMs2zCujqwxyvJztpVff4hPZbSmxmAFgXU 0TJPy6qv5s4ZFYPv7jsxppi7HGHH8vuyt2qVoq/gB+wtdYyZmtdba7G1leD9xunsAcEk 7ppOdzWrBEZO5l6n0SmpZxzikgYX9CQSjPlg0PhIbd+VceOQ94N8vr0UhGvls9shrRKy zPSiLidz67+5JqZR1132op5PpgCekUVyME9wzNAuUWu9HufV1Q9R/O6Oi+/KJOvQhQs8 KFcw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il10-20020a17090b164a00b00213255221e3si8126279pjb.1.2022.12.15.20.56.13; Thu, 15 Dec 2022 20:56:24 -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 S230094AbiLPDyA (ORCPT + 68 others); Thu, 15 Dec 2022 22:54:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbiLPDx5 (ORCPT ); Thu, 15 Dec 2022 22:53:57 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845B2554D3; Thu, 15 Dec 2022 19:53:55 -0800 (PST) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NYFYd1BgYz16LdJ; Fri, 16 Dec 2022 11:52:53 +0800 (CST) Received: from [10.174.179.14] (10.174.179.14) by canpemm500004.china.huawei.com (7.192.104.92) 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:53:53 +0800 Subject: Re: [PATCH] scsi: libsas: Directly kick-off EH when ATA device fell off To: Xingui Yang , , , CC: , , , , References: <20221216032936.17841-1-yangxingui@huawei.com> From: Jason Yan Message-ID: <5dd4740a-0301-d195-a368-462010da7927@huawei.com> Date: Fri, 16 Dec 2022 11:53:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20221216032936.17841-1-yangxingui@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.14] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500004.china.huawei.com (7.192.104.92) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 */ >