Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4966516rwj; Tue, 20 Dec 2022 18:11:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsJ3xdrWKsipk2tx5N6KseP/4+bZrA45n0R8Vb0vKlz7Pxvz+2uacIxdWnIvU2XEkHS7gD3 X-Received: by 2002:a17:906:d0d0:b0:7c1:23f2:5b51 with SMTP id bq16-20020a170906d0d000b007c123f25b51mr3631364ejb.60.1671588670970; Tue, 20 Dec 2022 18:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671588670; cv=none; d=google.com; s=arc-20160816; b=PgSLvsdskkP/jW1IFb0tNpOZFBkX/B+VZyM4F/SSZ2jVVquAJc2B/yZ2HaXII5eME3 iXgC2hKJbJ5WSHoHDul1YQ0WH2ODnweuN2eBz9KQ9rDJncHK48x3/PwQUaNjlUAUOect Swaje2CA7Cn1u+qLxyySHRk2zLxPfb2Vf4vt6qNsWMc7Db7thcgTw/eBYah5QwOe96IV IXUx8SEBlq4EEIX+Jd84050venCtq3LlLShnYnhqcnz3apjtWbEbyoWPF8i553svJIcp YDX8UYXYxfOe4lrGAIw9F+T5qpkekQOveo3hcsFpLNk/nSBQT1S7kzSkVyWXgFGGqZiL ARiw== 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=fsb6kgRB0c8Vv2Cq3Y9xfYDuswOceGc8Xy2Q2cpGr08=; b=whZcNe0jjxrQ/Zzdosh9VaFpJr2LNR7MKpT2tWnYGFE9fkC+YhO9HNRYMMHoz0g+QX ns+EG/6Ym802zFFuKgxphHpuK+QI5U7jbqKU+4Ha5hew1zx08gow0K6yHumms3MRNDW4 vORi1ZAGJmpU63PA1Y+vmWkPZTvfD1oNcYkUf/BBQVsqSp8wW0KwxebUtWzKx5r2l2zA jMFIgwjfvDO/YhM4dFOObUCoM7Bqe80xW8JW7L6cqm86+eeDyAqshd1EhYty+xXzE93U N1YBjezGNfd6Me5GxwExJ2Lkt7F/A05+/56hhtroIDZ5RQt/OXFaaApBIeq0+sMRcg3t 3b9g== 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 hv13-20020a17090760cd00b007c171bf2316si294513ejc.634.2022.12.20.18.10.54; Tue, 20 Dec 2022 18:11:10 -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 S230142AbiLUBr3 (ORCPT + 69 others); Tue, 20 Dec 2022 20:47:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbiLUBr0 (ORCPT ); Tue, 20 Dec 2022 20:47:26 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F101A38B; Tue, 20 Dec 2022 17:47:25 -0800 (PST) Received: from dggpemm500012.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NcGWM3ZFhzJqbJ; Wed, 21 Dec 2022 09:46:23 +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; Wed, 21 Dec 2022 09:47:23 +0800 Message-ID: <6e2f1142-c14b-0277-0c5e-fda26235794c@huawei.com> Date: Wed, 21 Dec 2022 09:47:23 +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: Grab the host lock in sas_ata_device_link_abort() Content-Language: en-CA To: John Garry , , , , CC: , , , , References: <20221220125349.45091-1-yangxingui@huawei.com> <4ec9dbed-1758-d6b4-dc1d-ac42e8c22731@oracle.com> From: yangxingui In-Reply-To: <4ec9dbed-1758-d6b4-dc1d-ac42e8c22731@oracle.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.101.126] X-ClientProxiedBy: dggpemm500011.china.huawei.com (7.185.36.110) To dggpemm500012.china.huawei.com (7.185.36.89) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-5.4 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/20 22:59, John Garry wrote: > On 20/12/2022 12:53, Xingui Yang wrote: >> Grab the host lock in sas_ata_device_link_abort() before calling > > This is should be the ata port lock, right? I know that the ata comments > say differently. ok, I will update the commit message and use ata port lock instead. > >> ata_link_abort(), as the comment in ata_link_abort() mentions. >> > > Can you please add a fixes tag? ok, I will update and add a fix tag. Thanks, Xingui > >> Signed-off-by: Xingui Yang > > Reviewed-by: John Garry > >> --- >>   drivers/scsi/libsas/sas_ata.c | 3 +++ >>   1 file changed, 3 insertions(+) >> >> diff --git a/drivers/scsi/libsas/sas_ata.c >> b/drivers/scsi/libsas/sas_ata.c >> index f7439bf9cdc6..4f2017b21e6d 100644 >> --- a/drivers/scsi/libsas/sas_ata.c >> +++ b/drivers/scsi/libsas/sas_ata.c >> @@ -889,7 +889,9 @@ void sas_ata_device_link_abort(struct >> domain_device *device, bool force_reset) >>   { >>       struct ata_port *ap = device->sata_dev.ap; >>       struct ata_link *link = &ap->link; >> +    unsigned long flags; >> +    spin_lock_irqsave(ap->lock, flags); >>       device->sata_dev.fis[2] = ATA_ERR | ATA_DRDY; /* tf status */ >>       device->sata_dev.fis[3] = ATA_ABORTED; /* tf error */ >> @@ -897,6 +899,7 @@ void sas_ata_device_link_abort(struct >> domain_device *device, bool force_reset) >>       if (force_reset) >>           link->eh_info.action |= ATA_EH_RESET; >>       ata_link_abort(link); >> +    spin_unlock_irqrestore(ap->lock, flags); >>   } >>   EXPORT_SYMBOL_GPL(sas_ata_device_link_abort); > > .