Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2360262rwb; Fri, 16 Dec 2022 00:34:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5KE7TwyQupsYhY1VJ022kyI/S8rVi1Wmy2n1MDJW5U0u+iMq7HuXCHBzE4P2fM6W3mfrHb X-Received: by 2002:a17:907:c315:b0:7c0:c10e:1395 with SMTP id tl21-20020a170907c31500b007c0c10e1395mr28654080ejc.1.1671179676561; Fri, 16 Dec 2022 00:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671179676; cv=none; d=google.com; s=arc-20160816; b=xUOwQj/0b8h7FDSgeO1bOG/+IOn9PPbAAF80bjYLQThDwRUUMXxD8qLqEuCGVV1tKe KODNfysV6v2+eKarnd7gUcrUPTTk2yc6p4Dg/s4MBO+MuwTHhlv1Hayw4HGDVPy5Lh2z brwclFhXj/JjBz8mmmVS2h51ryiKG95p0CI93Tlwc+6+RGyTNa/WVZ5ODAOnmJlLgmty ML+MJCoLZ2hIFeuzMMMQm5gXrRySMU5dmlyhuOwhuRJgSK3uWy1pracNJcWfwMDJOeWu I7q+s+V/UyOIaVkTgkvzwPM95uvlrqWGJgcNKpHMf5eqoqW7MYPSj8CTNQYcc3ddoMhD L/fQ== 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=6vksGIYfyhfG4rRW3lmfmw9seqFjEDq7hdOFgjSUTpM=; b=juQ240xpurO8J3/CthdgNopg4TbJMYq6JTrJJfXFjPNG0AwHnSKfYctlvC7rne3Pyi EqPhqGa66x5T++hsqxZW8BvD1Whd/jWNMJI2Ew1FkLlbuduD18w7ui/A0U0tCc/UM4Sk jn9XO2XWoiKzqDR2FAsc3QR3brQ9UMIRHW63v/lV7LwSTDRdvsTTPLxatgf5cJFyDmhI WUAwjnHsbFZJiX4JrpYv7N/yj2okTgcQ7u5wlNxabJQD7Nz1rC0T7UUf6AqS0PWtE4GR Gi6UCEjL7XbdZwk+Dg3L68gvbf7VEGUUI7TQ9TraLDaNPhwCPYRQm529NbfdQuNHdN0U ELWQ== 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 hd8-20020a170907968800b007c0bd0edd72si2146870ejc.163.2022.12.16.00.34.20; Fri, 16 Dec 2022 00:34:36 -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 S229905AbiLPHzf (ORCPT + 69 others); Fri, 16 Dec 2022 02:55:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbiLPHzb (ORCPT ); Fri, 16 Dec 2022 02:55:31 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A5F220E8; Thu, 15 Dec 2022 23:55:30 -0800 (PST) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NYLwS1fhdzJqYT; Fri, 16 Dec 2022 15:54:32 +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 15:55:28 +0800 Message-ID: <0f87f968-eb63-6b32-cfe7-b5d399a7d541@huawei.com> Date: Fri, 16 Dec 2022 15:55:27 +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> <5dd4740a-0301-d195-a368-462010da7927@huawei.com> From: yangxingui In-Reply-To: <5dd4740a-0301-d195-a368-462010da7927@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.101.126] X-ClientProxiedBy: dggpemm500023.china.huawei.com (7.185.36.83) 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 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 >> --- >>   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 */ >> > .