Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3713456rwb; Tue, 20 Sep 2022 03:45:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7CcmeQekq9DsTnCTh5mRcFoODSLL5pwbx7A9Fa34N1I/jhzAn/2eyHK+4EE3t2eTXwpk7i X-Received: by 2002:a17:906:4785:b0:780:df48:6a72 with SMTP id cw5-20020a170906478500b00780df486a72mr11447328ejc.747.1663670747746; Tue, 20 Sep 2022 03:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663670747; cv=none; d=google.com; s=arc-20160816; b=w5VG8Uhuxeraes54jC6Su3orDIUXMfsDWn61QuUQxbA4qN6PH4+jg4YlDBoh9atJ5c QnOBW450oJZKOmdxI01W1gPHb/cltUCmN9wtkOHgnMzFH2Sp+5duWC3zKhZzgx37UWz4 t7Xo5poQeiV1XZNucA1tkp7rleBP342UolORY/geENHaAkHuo+Neb1H+g4QPb+ZHPPsZ wYy9hgRyzcz0dZAUsaOYRIA73OuLlgNUdtaa88Y8z9ampb1AhnnaVAKtDDvTk7+l3ady CTUWobIMLNz1vzoiEaUcVbV2y6V716XphFunfA7XAUL/5WrtQ2Kaekcw4cr3mu5lkwGm YX9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=1Jk8I8aNrt4TtpHAnI1Ef0wpp4KxFLLayPTvrhp4pwk=; b=jLD7FMqowwyW8ydhdeyomstWypFp3LOUP4ybMiPN8BCOl+Wv5sbMNk5KbdvyENk1Bw jWGOnQMXkYXTLOnC4BWLUIOAVmU+9VOszipYesRBts81lvN6Qm6qV/XeWkRGQuU8wxTw WmbeDKXQeVM8r7aJrXUK9VWwIe0X9fN0yu5k+wJ5YhgqlHoLZZBOoDocKUCMtGhGaAEg JEIEbaKuysgw5dMPYLsM4BNcjbqRDukpFX/egUQqyYXmw1MZyR1/R0bwpo43nNRw5/CT ZYKQTZxh5lWWdEt62G27QqeQdEtEbV9SPebxapoTGzjxPxzj8A4ETgkyuvjvkP5eDz3m a/5w== 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 i10-20020a05640242ca00b00451624f2f0asi1620412edc.17.2022.09.20.03.45.23; Tue, 20 Sep 2022 03:45:47 -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 S231142AbiITKgQ (ORCPT + 99 others); Tue, 20 Sep 2022 06:36:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbiITKfy (ORCPT ); Tue, 20 Sep 2022 06:35:54 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AB3172FE3; Tue, 20 Sep 2022 03:34:03 -0700 (PDT) Received: from fraeml740-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MWyXT02jrz67ww1; Tue, 20 Sep 2022 18:32:09 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml740-chm.china.huawei.com (10.206.15.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 12:33:49 +0200 Received: from localhost.localdomain (10.69.192.58) 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; Tue, 20 Sep 2022 11:33:47 +0100 From: John Garry To: , , , , CC: , , , , John Garry Subject: [PATCH RFC 0/6] libata/scsi/libsas: Allocate SCSI device earlier for ata port probe Date: Tue, 20 Sep 2022 18:27:04 +0800 Message-ID: <1663669630-21333-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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,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 Currently for libata the SCSI device (sdev) associated with an ata_device is allocated when the port probe has completed. It's useful to have the SCSI device and its associated request queue available earlier for the port probe. Specifically if we have the request queue available, then we can: - Easily put ATA qc in SCSI cmnd priv data - Send ATA internal commands on SCSI device request queue for [0]. The current solution there is to use the shost sdev request queue, which isn't great. This series changes the ata port probe to alloc the sdev in the ata_device revalidation, and then just do a SCSI starget scan afterwards. Why an RFC? 1. IPR driver needs to be fixed up - it does not use ATA EH port probe Mail [1] needs following up 2. SATA PMP support needs verification, but I don't have a setup 3. This series needs to be merged into or go after [0] Patch 1/6 could be merged now. [0] https://lore.kernel.org/linux-ide/1654770559-101375-1-git-send-email-john.garry@huawei.com/ [1] https://lore.kernel.org/linux-ide/369448ed-f89a-c2db-1850-91450d8b5998@opensource.wdc.com/ Any comments welcome - please have a look. Based on v6.0-rc4 and tested for QEMU AHCI and libsas. John Garry (6): scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device() scsi: scsi_transport_sas: Allocate end device target id in the rphy alloc scsi: core: Add scsi_get_dev() ata: libata-scsi: Add ata_scsi_setup_sdev() scsi: libsas: Add sas_ata_setup_device() ata: libata-scsi: Allocate sdev early in port probe drivers/ata/libata-eh.c | 4 +++ drivers/ata/libata-scsi.c | 45 +++++++++++++++++++++---------- drivers/ata/libata.h | 1 + drivers/scsi/libsas/sas_ata.c | 20 ++++++++++++++ drivers/scsi/scsi_scan.c | 28 ++++++++++++++++++- drivers/scsi/scsi_transport_sas.c | 25 +++++++++++------ include/linux/libata.h | 2 ++ include/scsi/scsi_host.h | 3 +++ 8 files changed, 105 insertions(+), 23 deletions(-) -- 2.35.3