Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5385636rwj; Wed, 21 Dec 2022 01:46:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXuliDPW48uEMJMog8FnPZkSVvacL8kdDdWl6L6vbVLFX9QUVlbFEdwF+uGD3ngJ3v0ATiUu X-Received: by 2002:a17:902:cf42:b0:191:115a:bc42 with SMTP id e2-20020a170902cf4200b00191115abc42mr18089951plg.45.1671616012695; Wed, 21 Dec 2022 01:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671616012; cv=none; d=google.com; s=arc-20160816; b=PubjtEqVDejrePDsie42r/BbG4bQwm+MA+iUClcDC6rn96FoaIPtkmmXzT3bWKVYAg rvgT/C1ZdQ2SyRbz4UZcn+xlN01XxAh3eCaxr1KbfBCv9JQOsjm0KKC/tTVdBrvNNtdO lqZjZvn8ROEXkP/KWaB3pFktNk3dwuurW3v6CwM2VF7IEWvEawA3yVxPA1731nyT3n7L cZQiRK7FmWn5pbUcrU/WEsK+r9sPR5aWS+1+x4IvCTG+qA9zWrAbNNcDWYohWj9Yo4bE E0cBrjHkcOiwAOO56f5Zk/I8rI8YrqoIZp5K58CI4jgrp8adcYyt/7S91PyZZTee8XeL 0Sng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=fuLqpwVPzRWNFlVi2F3dBv8mv8fUqsHEYX5YRJtgCuc=; b=OzNpA6wXjk2y5ACyY23HoS1+lUeA8k1Qxw6BxYnyMlRb2pTDkajfHv7QuDeI7qTGyj ovh/qmbTA47CpF6LRGXEs6NBjbjlFYsN8YNEQTFGSBaJhE2oiAjBB1HHNNeVh3PXju/g 2IVZLkPDtCfw4YxXy+9QVw2PeVmKZivOiirxsbv4b93n2ypIUzmwN5ACy7GpuzeSsNCJ 5jUTkNo6+gwMcXbMwPZdosqRJ0eYsk0UG7vob52yl8wfTMd9SR2ssnU7sw/JTbH8K2aZ NW+udhOOLLiMKpi94wBolKpeYGFziwuc06QaKmh6MjC1vxGwASRdXdmUuq54t7/Vc5OE G5og== 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 h9-20020a170902f2c900b0018273316ce0si15313624plc.511.2022.12.21.01.46.43; Wed, 21 Dec 2022 01:46:52 -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 S234580AbiLUJcS (ORCPT + 70 others); Wed, 21 Dec 2022 04:32:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234352AbiLUJby (ORCPT ); Wed, 21 Dec 2022 04:31:54 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CAAB205D8; Wed, 21 Dec 2022 01:31:49 -0800 (PST) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NcSlH0Bw9zqT7Z; Wed, 21 Dec 2022 17:27:23 +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; Wed, 21 Dec 2022 17:31:47 +0800 From: Xingui Yang To: , , CC: , , , , , Subject: [PATCH v3 2/3] scsi: libsas: Directly kick-off EH when device removed with active IO Date: Wed, 21 Dec 2022 09:25:13 +0000 Message-ID: <20221221092514.4091-3-yangxingui@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221221092514.4091-1-yangxingui@huawei.com> References: <20221221092514.4091-1-yangxingui@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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: X-Mailing-List: linux-kernel@vger.kernel.org If the device is gone, call sas_device_task_abort() directly and abort active IO to kick-off EH Immediately. This avoids having to wait for block layer timeouts. Signed-off-by: Xingui Yang --- drivers/scsi/libsas/sas_discover.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index d5bc1314c341..ea5609f9967b 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -362,6 +362,9 @@ 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)) + sas_device_task_abort(dev); + if (!test_bit(SAS_DEV_DESTROY, &dev->state) && !list_empty(&dev->disco_list_node)) { /* this rphy never saw sas_rphy_add */ -- 2.17.1