Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp943672pxp; Wed, 16 Mar 2022 22:08:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/XrYZsluKQG8WiDAsAZpsaQbw8wAYiQw6qmyDs0zm3HVv7IunMxXzSe/iDoKZ1Fa0kl6d X-Received: by 2002:aa7:92cf:0:b0:4fa:3b47:7408 with SMTP id k15-20020aa792cf000000b004fa3b477408mr1643346pfa.72.1647493735328; Wed, 16 Mar 2022 22:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647493735; cv=none; d=google.com; s=arc-20160816; b=py9i55tVHywGSl8ahgz9lI3/9Gzu7NVcZbdtFOTDwJEJvvQy1NMjOtI6NOlGVJZWbW pIqkdx72RgxkfXclokB7L2QfitpDhOBQyq8AwNVf/EvkQz6DtxrufrYpKqcdnij2SBXo lJ/7Yla8USTgVq1XZXKLSa08f1APyyDKz5SOVa5TdowvVSru7P8SbbrgERO8Kv7oV1Xo Klml+3QBIExcbFoMwxSqzyT/hu0kuUPe+br6wjim/YbHh0/LZTwhf9qCS4AbjQgJnDeC +BFGpeKGuCctdsH3hA69IGprveiYS35fjUgZJXmWzW/lCdOOiUKEC3wmD7dhSPIejhJb YxPg== 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:subject:user-agent:mime-version:date:message-id; bh=rs9jhGzWy76jU6O+rU2fPyxtvMpC6VSSNNLn4ROlIOk=; b=FZzXv/czFjCcyoweVzeqbMpTzFwn6ViRUa6TNXYskxiQ/0bZEQYs84gsM1iHJX0eCG qnqkluNiKPckU9CsKZ/V2+St86RhAjcJX2NR7qAjK1h1Cp0gr4kVvJewA2kKutEwhnni fQXAXg3G0vPv9vizyisGfMSEGScJHUcPpeQxRpr63yOnUhUFIl9AXGRKwTDDWKgk2K/K qoTPg+fMWp/WPCjGzuJYeJ2Yv4hlw7woVGWXFxkNKGWbXO89otDiO4H4nURk0yaTE1Vd Adv7uGtH8LBl/ywsXCezWdyZeTHHmpKj6jfm5ouz9Ji3xihTm8MCAE9Nvv/Wj0FopbYX Q48w== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c1-20020aa78e01000000b004fa2a2afd29si2395446pfr.184.2022.03.16.22.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:08:55 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0991E1C0260; Wed, 16 Mar 2022 21:19:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354504AbiCPIYz (ORCPT + 99 others); Wed, 16 Mar 2022 04:24:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238004AbiCPIYy (ORCPT ); Wed, 16 Mar 2022 04:24:54 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A22DF49; Wed, 16 Mar 2022 01:23:40 -0700 (PDT) Received: from fraeml743-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KJNYB2MP5z67MkT; Wed, 16 Mar 2022 16:22:06 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml743-chm.china.huawei.com (10.206.15.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 16 Mar 2022 09:23:38 +0100 Received: from [10.47.84.96] (10.47.84.96) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 16 Mar 2022 08:23:37 +0000 Message-ID: <650c667f-ca55-821d-4e0f-29fce69a68fc@huawei.com> Date: Wed, 16 Mar 2022 08:23:34 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH RFC 2/2] libata: Use scsi cmnd budget token for qc tag for SAS host To: Damien Le Moal , , , , , , CC: , , , References: <1647340746-17600-1-git-send-email-john.garry@huawei.com> <1647340746-17600-3-git-send-email-john.garry@huawei.com> <99541f2d-2aea-6bd7-e3b6-21dbc355875d@opensource.wdc.com> From: John Garry In-Reply-To: <99541f2d-2aea-6bd7-e3b6-21dbc355875d@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.84.96] X-ClientProxiedBy: lhreml735-chm.china.huawei.com (10.201.108.86) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Damien, >> - } >> - return -1; >> + return scmd->budget_token; >> } > Since this is now not actually allocating a tag, I would rename this > something like ata_sas_get_tag(). Or even better, simply open code this > in ata_qc_new_init() since that is the only caller. ok, I think it might be better to open code in ata_qc_new_init(), as suggested. That should avoid the need for the return -1 call. > >> >> void ata_sas_free_tag(unsigned int tag, struct ata_port *ap) >> { >> - clear_bit(tag, &ap->sas_tag_allocated); >> } > This is called only in ata_qc_free(). With this change, the function is > empty, so let's completely remove it. > ok >> >> /** >> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c >> index ed8be585a98f..45d63a2ba3ee 100644 >> --- a/drivers/ata/libata-scsi.c >> +++ b/drivers/ata/libata-scsi.c >> @@ -640,7 +640,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, >> { Thanks, John