Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1999950rwi; Fri, 28 Oct 2022 01:31:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4eF9sqWi8+uc20x3lu8MfbhjofhxoXnRJ5E3P37LNDtGeDWJTGKmnQ9SRP0FbrCTo40PY2 X-Received: by 2002:a17:902:db01:b0:186:9329:723f with SMTP id m1-20020a170902db0100b001869329723fmr30848213plx.172.1666945891782; Fri, 28 Oct 2022 01:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666945891; cv=none; d=google.com; s=arc-20160816; b=QiFQqg1XH5+DofsWiHCqspy/WWj/9uQQtEh52ETwIlRllETrKfWBXbkwVPAm6uGMSV +6o8b+vEvLjwrTqVmQ7d3YU0ZVI7G+zTHx1L6I1PR9ELOiLqL02p6GYhr+ugDpRKG/2j 7+77neIYWIusB1+YOEp1QUL6oj3hgz8aEySP9nN/bjMOrKVbbHcwpUwWRIqbIfF5VI+Y Rg8BUUw8J3mIl9UcFYt6QkJ3cQGLFeDRVuTzAh/D6oVXoBwE7TUqRL+IUWdcsC35UuL+ gHnzWCQCBYgfJMpztKVGeauHj1LHj+SAjmLwI3Ejmp5W8cU2c6dpDzCaV8FmxHRS6bA4 sEMg== 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=yIXQe8RceGjr+riyQBkMnIfBiGB1sP3P+eCyLfHKNAc=; b=hGYo8dQaP9PP7Z+fw+rt4maR9MjAJ8ZYod2i+8aMxmeEj6OhiJN5iiwzS4C7knKoLp 7DZ1jYh38ffrP/NuZHwrojlMLIv9WN0RRftiOXpd8yJ9TjQ5IyhCu2Q4HXsTJd3XF+IJ VYqrcHn0iBvrfG6hnGifRL76UEOvyvMwKNFGXFyU5tWa0MEf80XZByO3P+VU9pEeBobH hhUksIhMjFM3RSAh8Vq4uhxd/hbDpw1H5OFU7hjj8pS6+vt1ZNx7h+sBEj9gcFvCIx4u HEm9a9Qtz3NS4N1D2EFG7vflVlqwXAQt45nFgNTIGEb3zYDghOfDMEPJUBBukvD18SgA IpjA== 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 mh4-20020a17090b4ac400b0020b042ed0e1si4086496pjb.154.2022.10.28.01.31.19; Fri, 28 Oct 2022 01:31:31 -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 S229997AbiJ1IOy (ORCPT + 99 others); Fri, 28 Oct 2022 04:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230144AbiJ1IOb (ORCPT ); Fri, 28 Oct 2022 04:14:31 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B68F3E; Fri, 28 Oct 2022 01:14:27 -0700 (PDT) Received: from fraeml708-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MzFdl4Xzlz685K1; Fri, 28 Oct 2022 16:12:27 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml708-chm.china.huawei.com (10.206.15.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 28 Oct 2022 10:14:24 +0200 Received: from [10.48.144.136] (10.48.144.136) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 28 Oct 2022 09:14:23 +0100 Message-ID: Date: Fri, 28 Oct 2022 09:14:24 +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 v3 2/7] ata: libata-scsi: Add ata_internal_queuecommand() To: Damien Le Moal , Hannes Reinecke , , , , , , CC: , , , , , , , References: <1666693976-181094-1-git-send-email-john.garry@huawei.com> <1666693976-181094-3-git-send-email-john.garry@huawei.com> <08fdb698-0df3-7bc8-e6af-7d13cc96acfa@opensource.wdc.com> <83d9dc82-ea37-4a3c-7e67-1c097f777767@huawei.com> <3ef0347f-f3e2-cf08-2b27-f65a7afe82a2@suse.de> <07028dac-d6cc-d707-db08-b92c365a6220@opensource.wdc.com> From: John Garry In-Reply-To: <07028dac-d6cc-d707-db08-b92c365a6220@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.144.136] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,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 27/10/2022 23:35, Damien Le Moal wrote: >> At what stage do you want to send these commands? The tags for the shost >> are not setup until scsi_add_host() -> scsi_mq_setup_tags() is called, >> so can't expect blk-mq to manage reserved tags before then. >> >> If you are required to send commands prior to scsi_add_host(), then I >> suppose the low-level driver still needs to manage tags until the shost >> is ready. I guess that some very simple scheme can be used, like always >> use tag 0, since most probe is done serially per-host. But that's not a >> case which I have had to deal with yet. > In libata case, ata_dev_configure() will cause a lot of > ata_exec_internal_sg() calls for IDENTIFY and various READ LOG commands. > That is all done with non-ncq commands, which means that we do not require > a hw tag. But given that you are changing ata_exec_internal_sg() to call > alloc_request + blk_execute_rq_nowait(), how would these work without a > tag, at least a soft one ? Or we would need to keep the current code to > use ata_qc_issue() directly for probe time ? That will look very ugly... > I am not sure if there is really a problem. So libata/libsas allocs the shost quite early, and that is before we try using ata_exec_internal_sg(). Also note that I added patch "ata: libata-scsi: Allocate sdev early in port probe" so that we have ata_device.sdev ready before issuing ata_exec_internal_sg() (sorry if I'm stating the obvious). I think Hannes' issue is that some SCSI HBA driver needs to send "internal" commands to probe the HW for info, and this would be before shost is ready. He can tell us more. Thanks, John