Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp977609pxp; Wed, 16 Mar 2022 23:15:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWk1wTwkKblBRD4YEO1nqSq43puw6iBhIEGyIbHE+zdbNFJV2b6W2exIGMhdEPoDLrXgMb X-Received: by 2002:a05:6a00:1907:b0:4f7:945:14cf with SMTP id y7-20020a056a00190700b004f7094514cfmr3248820pfi.47.1647497701986; Wed, 16 Mar 2022 23:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497701; cv=none; d=google.com; s=arc-20160816; b=TVn6drDJ/bXi5+Gpu3Gz0W+iTrH2e7N8BL9AohqXHI4YCGqKERy8uHSwctBaYsKIRB jStwnUxNp1SR1D2aXliSNmZdmRkoYz+RoMGTCIZZZ9zKL47BfldASzTXUjU81Ybjoevq VSgCYMbVztVLuKkUiV4ToQoxbU+X1T2efjHRz0Brl2pWQxwp+KYvZAIwtWwhmVs2ZcN9 l5phAqCSoVv7xWTnahv//WLDAgq3s6WpYWRSMhShX3A66GY3aq4TUZ+kpiLEIblSYE0z 02Q6l1ZatoqUROfZNEXytCYqK6b0xjrXZBpPDnNsCQ01bz8ocA2szh8gHwSQtdzxqGCj Xlgg== 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=HyoLAX4f9+mah+kDibIEXdlvKd2qEP5LqJ/9lnzNJcM=; b=FfKVtiJBt9eNvFybEOhrPvgldePlCZ1CnRqAkHY/+mfd1rkXwryY0rWgX+fteCqyYw ajSfHLs45xftmjO1Wla+D+x/QysYv5nEPcuxugfTx83Thc3uP6L8eew+VZ7WKxZzN6ZN 6ENjv/GNphpgTKWSlc0OUF9ewDB5FO0LaFMShBXr93ZKIq+W52JfJqdgctGmK2EBZ8xS RTNcf20hBe/LALYCqJCX+KHF9PcgCVdibnnyK7i5h7cmxS2csVikCLd1MX/1J2CqAroF m5mNvIQQQ17dHQ3XQAWFmmA4aXzNVNLsdrw+GJAaPhhZgyh4T3t3bbZrmnWz6jne209T tuUQ== 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 c187-20020a6335c4000000b003816043ef41si1207386pga.310.2022.03.16.23.15.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:15:01 -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 9AD59B82CB; Wed, 16 Mar 2022 21:57:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349442AbiCPKsQ (ORCPT + 99 others); Wed, 16 Mar 2022 06:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355206AbiCPKsP (ORCPT ); Wed, 16 Mar 2022 06:48:15 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D2CE6353A; Wed, 16 Mar 2022 03:47:01 -0700 (PDT) Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KJRkZ1Wptz68649; Wed, 16 Mar 2022 18:45:26 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.24; Wed, 16 Mar 2022 11:46:58 +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 10:46:58 +0000 Message-ID: <4dfcddff-7736-e01e-7fcf-804de77ac623@huawei.com> Date: Wed, 16 Mar 2022 10:46:57 +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: Christoph Hellwig CC: Damien Le Moal , , , , , , , , , 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> <650c667f-ca55-821d-4e0f-29fce69a68fc@huawei.com> <20220316083439.GA6701@lst.de> From: John Garry In-Reply-To: <20220316083439.GA6701@lst.de> 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 On 16/03/2022 08:34, Christoph Hellwig wrote: > In addition to the comments from Damien: I think we should kill > ata_qc_new_init as well. It is a bit pointless and having it in > libata-core.c when it pokes into scsi internals also doesn't make sense. > > So maybe something like: Seems reasonable to me at least. But I'd send these as 2x separate patches. > * sata_async_notification - SATA async notification handler > * @ap: ATA port where async notification is received > diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c > index ed8be585a98f7c..5e0bc7b05a107e 100644 > --- a/drivers/ata/libata-scsi.c > +++ b/drivers/ata/libata-scsi.c > @@ -638,24 +638,44 @@ EXPORT_SYMBOL_GPL(ata_scsi_ioctl); > static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, > struct scsi_cmnd *cmd) > { ... > > - if (scsi_cmd_to_rq(cmd)->rq_flags & RQF_QUIET) > - qc->flags |= ATA_QCFLAG_QUIET; > + if (ap->flags & ATA_FLAG_SAS_HOST) { > + /* XXX: add a comment here why SAS is different */ I think this is simply because SAS hosts have shost.can_queue > 32 > + if (WARN_ON_ONCE(cmd->budget_token >= ATA_MAX_QUEUE)) > + goto fail; > + tag = cmd->budget_token; thanks, John