Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2464767rwb; Fri, 16 Dec 2022 02:22:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf58iGMzGl0hzZMf4krtI/YWN9qLlaZgkF5yA1mXQ73b1WiKdL9hilXBoUlxAl3+F+VkSt5Z X-Received: by 2002:a17:903:2791:b0:189:6191:a1b4 with SMTP id jw17-20020a170903279100b001896191a1b4mr32453116plb.55.1671186139292; Fri, 16 Dec 2022 02:22:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671186139; cv=none; d=google.com; s=arc-20160816; b=r3Ex4jXwZz+4Jfv3o+IvRKYpSsDfGnKnPtOiuRzbFyUAQ8TpE6zEJKKnaF1WgrvhTQ f/sWh0HH46WxdL4evAzYyCDfcATKdhV7AXWpBUxRiOKqKVPL256N8ndQCfvb86k2AEAW j0ecItLlqnQfhEHNmnehWrrropdQzgh+PX8BtWuhRULYhs1XRXKPPtMU9uU+0BNhOShq vg8okz1QoBHm4K3iXbDoJdBJPflo4qoUrJMHNUmyXmPkAvf/Tpdef6QyZ4ZT7k3E2ySk ysJFeYu1Tapzv5JutdT9PdzHh3+OU0GkpIgDG42g1a6jS+C6npKU2sUIxh94WtXsgttY YAtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=QrcWrKOK/DPJYcDPexF5XKKeCtc43GNvOGn4sw31lyU=; b=0dG7k+DoMiXR29KAs0FdBr5a7H4pDO9AGIRfqst7+Ou25XaJ00Hika6hz1wOIo88So 5LK9DWk6KiU3MgyPZyQx9u/pPcd07UU+R0YEI/k0hma1lJnq0Cb9UPMLfstK8/ocP0XP lQS+Fr+tT0XV7/pA8CdPZCkOsJKaFCHcNLD5wJb89ceNybighkkRhr0sDy70TxT41IPH XMvzjFgPhzjE4Tpc3UThi8o4RofS0TehnnIrhcD9YC+S6CbNqUCVPL0yW7uOP25o4JAG l6mITt66VzYDkH3hc0jJQcsZlj3YfqcrJazHeRZCJOeI+l1g923mYW/dDaRe2M36pAAZ GbYA== 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 n12-20020a170903110c00b0018996404dd9si2215624plh.267.2022.12.16.02.22.09; Fri, 16 Dec 2022 02:22:19 -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 S230328AbiLPJxb (ORCPT + 68 others); Fri, 16 Dec 2022 04:53:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230319AbiLPJxW (ORCPT ); Fri, 16 Dec 2022 04:53:22 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EA2B4A59C; Fri, 16 Dec 2022 01:53:21 -0800 (PST) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NYPTG4BSXzJpMx; Fri, 16 Dec 2022 17:49:38 +0800 (CST) Received: from [10.67.101.126] (10.67.101.126) 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 17:53:18 +0800 Message-ID: Date: Fri, 16 Dec 2022 17:53:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: [PATCH] scsi: libsas: Directly kick-off EH when ATA device fell off Content-Language: en-CA To: Jason Yan , , , CC: , , , , References: <20221216032936.17841-1-yangxingui@huawei.com> From: yangxingui In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.101.126] X-ClientProxiedBy: dggpemm500008.china.huawei.com (7.185.36.136) 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,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 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 >> --- >>   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 */ >> > .