From mboxrd@z Thu Jan 1 00:00:00 1970 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 12E79C433EF for ; Wed, 16 Mar 2022 10:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355210AbiCPKsQ (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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