Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp301627iog; Mon, 13 Jun 2022 03:04:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGMQ9hBA7dhm8thzMTGNk81tH+pMw/Cf3C3GpI4cGlFmbEl6YSe5fq6Pz5AalmO0fG/0D+ X-Received: by 2002:a17:906:74c7:b0:711:fa45:4f88 with SMTP id z7-20020a17090674c700b00711fa454f88mr22934781ejl.347.1655114676772; Mon, 13 Jun 2022 03:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655114676; cv=none; d=google.com; s=arc-20160816; b=FCrALCRQcuXPL/XmpOKOMmNSxTkr9CSfpApeuySAtfNSh73OSfraJqwfkqF1/vPXXi JsxhNeZ1W7cNfuy6Y6yowAW7kq//2CK6Gxpvi+GaAZYLlEKUcjyXvx+psrXDI0DpAfs/ C+x7D/srJzeT3FvftsPY0lI9bQUCI2u59c1DyV4r2sL1EIHEF25WGsRqLqX0NUmPFztk zjYduqWLUxIQtSY8u6wuEBto622kohfPiPprspadtBrvHV1I4fKVf/G7MJh7iLd/bGsD /E/iPXmUIQruM+TptWlEOAbBZR6otLivPWdN7wpKiuS28fK+SY0tZJe2UtoXhy9mKC2S NMgw== 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=/DzbsNmlCBDFVidKbQeGkEU/C0J2ldYgfjh5sRnmJkM=; b=aJqz5hKydCrU2dBYaqpTxhzZRH/whC0FUyvwct02tabBY+jllVdmJrz8p1781eDeK8 XPygP9BNfomVjDc9+ceoa6yP5JNZ8/KQZcecc7skn9lt1Te35bjYUQ1ZFueWnzc31Cn3 KbIDXcVN5GZ2128mBSuP1qSVwgF7jkUF4DQna3EZqHNCOsuqFf5kmaMTqe4ZadJrxGJj v1RGsuH+L9wpSwcKx9Mvbv6vRtlBnnHXF/p1Pa8SdTKaqLSH33RVYIn15gkkSMwVHo6t drkim8jQB6z8GGVj13J8Hfl8RMS0xyV7WgN2c8JMRqaqZ6xbonqWpW0h2R7Fthx2wIsn aC/w== 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 z22-20020a05640235d600b0042b345a1834si8044467edc.259.2022.06.13.03.04.12; Mon, 13 Jun 2022 03:04:36 -0700 (PDT) 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 S240915AbiFMJla (ORCPT + 99 others); Mon, 13 Jun 2022 05:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234627AbiFMJlZ (ORCPT ); Mon, 13 Jun 2022 05:41:25 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAAE11658F; Mon, 13 Jun 2022 02:41:23 -0700 (PDT) Received: from fraeml745-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LM5zp5M84z68BVP; Mon, 13 Jun 2022 17:36:22 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml745-chm.china.huawei.com (10.206.15.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 11:41:21 +0200 Received: from [10.195.33.253] (10.195.33.253) 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.2375.24; Mon, 13 Jun 2022 10:41:21 +0100 Message-ID: <7dbd2f49-89b9-16f2-dbd5-e6c8978ebf22@huawei.com> Date: Mon, 13 Jun 2022 10:44:29 +0100 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 v2 07/18] libata-scsi: Add ata_internal_queuecommand() To: Damien Le Moal , , , , , , CC: , , , , References: <1654770559-101375-1-git-send-email-john.garry@huawei.com> <1654770559-101375-8-git-send-email-john.garry@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.195.33.253] X-ClientProxiedBy: lhreml746-chm.china.huawei.com (10.201.108.196) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 13/06/2022 08:16, Damien Le Moal wrote: >> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c >> index baac35dd17ca..b2702ab0183b 100644 >> --- a/drivers/ata/libata-scsi.c >> +++ b/drivers/ata/libata-scsi.c >> @@ -1114,6 +1114,20 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev) >> return 0; >> } >> >> +int ata_internal_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmd) > ata_scsi_internal_queuecommand() ok > > But given that this is used for the .reserved_queuecommand() method, I > would call it ata_scsi_reserved_queuecommand(). I did mention somewhere that I continued to use the term "internal" as that is what libata already uses, but I can change it. > >> +{ >> + struct ata_port *ap; >> + int res; >> + >> + ap = ata_shost_to_port(shost); > You can move this to ap declaration. > > struct ata_port *ap = ata_shost_to_port(shost); ok > >> + spin_lock_irq(ap->lock); > spin_lock_irqsave() ? Right > >> + res = ata_sas_queuecmd(scmd, ap); >> + spin_unlock_irq(ap->lock); >> + >> + return res; Thanks, John