From patchwork Wed Dec 14 07:06:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Yan X-Patchwork-Id: 634769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF972C4332F for ; Wed, 14 Dec 2022 06:45:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237418AbiLNGpr (ORCPT ); Wed, 14 Dec 2022 01:45:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237417AbiLNGpc (ORCPT ); Wed, 14 Dec 2022 01:45:32 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70EDE27DDC for ; Tue, 13 Dec 2022 22:45:28 -0800 (PST) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NX5Sc1z4fzJqXp; Wed, 14 Dec 2022 14:44:32 +0800 (CST) Received: from huawei.com (10.175.127.227) 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; Wed, 14 Dec 2022 14:45:26 +0800 From: Jason Yan To: , CC: , , , , , , , Jason Yan Subject: [PATCH v3 3/5] scsi: libsas: remove useless dev_list delete in sas_ex_discover_end_dev() Date: Wed, 14 Dec 2022 15:06:06 +0800 Message-ID: <20221214070608.4128546-4-yanaijie@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221214070608.4128546-1-yanaijie@huawei.com> References: <20221214070608.4128546-1-yanaijie@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500004.china.huawei.com (7.192.104.92) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The domain device 'child' is allocated in sas_ex_discover_end_dev() and never been added to dev_list. It used to be added to the dev_list in this function. But after the following two fixes it is added to the disco_list instead. So the list_del() and locking left is useless now. Fixes: 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery competing with ata error handling") Fixes: 92625f9bff38 ("[SCSI] libsas: restore scan order") Cc: John Garry Signed-off-by: Jason Yan Reviewed-by: John Garry --- drivers/scsi/libsas/sas_expander.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index a04cad620e93..29e1b93b0964 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -875,9 +875,6 @@ static struct domain_device *sas_ex_discover_end_dev( out_list_del: sas_rphy_free(child->rphy); list_del(&child->disco_list_node); - spin_lock_irq(&parent->port->dev_list_lock); - list_del(&child->dev_list_node); - spin_unlock_irq(&parent->port->dev_list_lock); out_free: sas_port_delete(phy->port); out_err: