Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2460550rwb; Fri, 16 Dec 2022 02:18:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf5nQem3FUKkiaKv7+MKcXxGDGLf7tEaV43XEvm784JAuR/lMy296I+gf+tkLXoq9LQNfhv9 X-Received: by 2002:a17:906:4b0e:b0:7c0:d94d:42fe with SMTP id y14-20020a1709064b0e00b007c0d94d42femr27248279eju.3.1671185892885; Fri, 16 Dec 2022 02:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671185892; cv=none; d=google.com; s=arc-20160816; b=Int7e7+od1lmKoIRKykfU7r6vCeROzcvZPOP5NUkUqXQYx0GxHEOLYCpLSZLCtwvjl bqi1DQzhw+e7IchOKdGDhsbbP1/aTvH577hB3JLvnwxBUiBCVLemCOpXAssELw9suEmn pTcAs2BmBzljefha/g17d2pSLmy58qG2/qKvZAqoK0lPgbzeR7zFs2bqDYTnfW5wXIv3 fOjfVGP0O6egUInM1Am8lWcWmjcXYAgYu7M9ErDQb3SPjvpWHJ4kmEA8LEwhYQGhddpY oz17PY3Q79O6qdiPJlIP3M7Jb2Z+qRUZ2nMtjjNGpsdZLjh5ZfSvGb2csoy7ZjLWAxFc G0gg== 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=buHaS4Jp9JnSZqkEnD2ktgPz/aa6FpI7Rh5QxHvkPdY=; b=P5NUXNMo8/4Ku0fe5nfnfXPoZ7hfzI/x2t/0/UcCvwzw2DgR9WqaGyE3VgTEEIT+KP 2mUQ8wWIR5D6Zqxf9dgkjwP7Uf2A9ujbXpOau3tF5z+0jPtvo4n2V9rfIKguR6kuiHl9 Ts1Xq+MToGcZAWJbBUXO/uPdCq/1fbF0oISI+ihvxNC8RfYq2eMMIdUwSQC7C/9nGjtY MubOFG7yDofEIeBZuh59IH4W4LuTdwTsTe3wy04OGGmCfduxyk8zYhozJ2Ccw/K4Vg2P vY3bxUjV0rwbLd6DfnxVMwtfxuyDPErTHjAJ6fC2QF497D8cnGCOvGnrRmbhR+U+aEvk MSqA== 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 dd18-20020a1709069b9200b00715867834e3si2161353ejc.506.2022.12.16.02.17.57; Fri, 16 Dec 2022 02:18:12 -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 S230096AbiLPJ3U (ORCPT + 68 others); Fri, 16 Dec 2022 04:29:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiLPJ3T (ORCPT ); Fri, 16 Dec 2022 04:29:19 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D586D3F06B; Fri, 16 Dec 2022 01:29:17 -0800 (PST) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NYP0g6955zJqRX; Fri, 16 Dec 2022 17:28:19 +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 17:29:15 +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: Date: Fri, 16 Dec 2022 17:29:14 +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: dggems705-chm.china.huawei.com (10.3.19.182) 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 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. 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 */ >