From: John Garry <john.garry@huawei.com>
To: <damien.lemoal@opensource.wdc.com>, <jejb@linux.ibm.com>,
<martin.petersen@oracle.com>, <hare@suse.de>,
<bvanassche@acm.org>, <hch@lst.de>, <ming.lei@redhat.com>,
<niklas.cassel@wdc.com>
Cc: <axboe@kernel.dk>, <jinpu.wang@cloud.ionos.com>,
<linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-ide@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
<linuxarm@huawei.com>, John Garry <john.garry@huawei.com>
Subject: [PATCH RFC v3 3/7] ata: libata: Make space for ATA queue command in scmd payload
Date: Tue, 25 Oct 2022 18:32:52 +0800 [thread overview]
Message-ID: <1666693976-181094-4-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1666693976-181094-1-git-send-email-john.garry@huawei.com>
Prepare to put the ATA queue command in a scmd payload by using priv
space per driver which uses libata.
The end goal is to remove ata_port.qcmd[].
Suggested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: John Garry <john.garry@huawei.com>
---
drivers/ata/libata-scsi.c | 6 ++++++
drivers/scsi/aic94xx/aic94xx_init.c | 2 ++
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 2 ++
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 2 ++
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 ++
drivers/scsi/isci/init.c | 2 ++
drivers/scsi/mvsas/mv_init.c | 2 ++
drivers/scsi/pm8001/pm8001_init.c | 2 ++
include/linux/libata.h | 5 ++++-
9 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 0d6f37d80137..18c60addf943 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1118,6 +1118,12 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)
return 0;
}
+int ata_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
+{
+ return 0;
+}
+EXPORT_SYMBOL_GPL(ata_init_cmd_priv);
+
int ata_internal_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
{
struct ata_port *ap;
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 70b735cedeb3..e2c99c74f73e 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -63,6 +63,8 @@ static struct scsi_host_template aic94xx_sht = {
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
.nr_reserved_cmds = 2,
+ .init_cmd_priv = ata_init_cmd_priv,
+ .cmd_size = sizeof(struct ata_queued_cmd),
};
static int asd_map_memio(struct asd_ha_struct *asd_ha)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
index 438e8a963782..aec13a46de6e 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1763,6 +1763,8 @@ static struct scsi_host_template sht_v1_hw = {
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
.nr_reserved_cmds = 2,
+ .init_cmd_priv = ata_init_cmd_priv,
+ .cmd_size = sizeof(struct ata_queued_cmd),
};
static const struct hisi_sas_hw hisi_sas_v1_hw = {
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index b733eb18864c..cb057b3a84ac 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -3581,6 +3581,8 @@ static struct scsi_host_template sht_v2_hw = {
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
.nr_reserved_cmds = 2,
+ .init_cmd_priv = ata_init_cmd_priv,
+ .cmd_size = sizeof(struct ata_queued_cmd),
};
static const struct hisi_sas_hw hisi_sas_v2_hw = {
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index d703af7985b0..4caf07306b24 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -3248,6 +3248,8 @@ static struct scsi_host_template sht_v3_hw = {
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
.nr_reserved_cmds = 2,
+ .init_cmd_priv = ata_init_cmd_priv,
+ .cmd_size = sizeof(struct ata_queued_cmd),
};
static const struct hisi_sas_hw hisi_sas_v3_hw = {
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index c07d89451bb6..0d0b8ef71c65 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -180,6 +180,8 @@ static struct scsi_host_template isci_sht = {
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
.nr_reserved_cmds = 2,
+ .init_cmd_priv = ata_init_cmd_priv,
+ .cmd_size = sizeof(struct ata_queued_cmd),
};
static struct sas_domain_function_template isci_transport_ops = {
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index 07e6c5d6c46d..e1b6cc196cef 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -57,6 +57,8 @@ static struct scsi_host_template mvs_sht = {
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
.nr_reserved_cmds = 2,
+ .init_cmd_priv = ata_init_cmd_priv,
+ .cmd_size = sizeof(struct ata_queued_cmd),
};
static struct sas_domain_function_template mvs_transport_ops = {
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index e37e8898afaa..fe55cc9765ae 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -126,6 +126,8 @@ static struct scsi_host_template pm8001_sht = {
.reserved_queuecommand = sas_queuecommand_internal,
.reserved_timedout = sas_internal_timeout,
.nr_reserved_cmds = 2,
+ .init_cmd_priv = ata_init_cmd_priv,
+ .cmd_size = sizeof(struct ata_queued_cmd),
};
/*
diff --git a/include/linux/libata.h b/include/linux/libata.h
index f09c5dca16ce..1a03c7fbb4e6 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1143,6 +1143,7 @@ extern void ata_scsi_unlock_native_capacity(struct scsi_device *sdev);
extern int ata_scsi_slave_config(struct scsi_device *sdev);
extern int ata_internal_queuecommand(struct Scsi_Host *shost,
struct scsi_cmnd *scmd);
+extern int ata_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd);
extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
int queue_depth);
@@ -1394,7 +1395,9 @@ extern const struct attribute_group *ata_common_sdev_groups[];
.bios_param = ata_std_bios_param, \
.unlock_native_capacity = ata_scsi_unlock_native_capacity,\
.max_sectors = ATA_MAX_SECTORS_LBA48,\
- .reserved_queuecommand = ata_internal_queuecommand
+ .reserved_queuecommand = ata_internal_queuecommand,\
+ .cmd_size = sizeof(struct ata_queued_cmd),\
+ .init_cmd_priv = ata_init_cmd_priv
#define ATA_SUBBASE_SHT(drv_name) \
__ATA_BASE_SHT(drv_name), \
--
2.35.3
next prev parent reply other threads:[~2022-10-25 10:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 10:32 [PATCH RFC v3 0/7] blk-mq/libata/scsi: SCSI driver tagging improvements Part II John Garry
2022-10-25 10:32 ` [PATCH RFC v3 1/7] ata: libata-scsi: Add ata_scsi_queue_internal() John Garry
2022-10-27 1:42 ` Damien Le Moal
2022-10-27 10:45 ` John Garry
2022-10-27 22:24 ` Damien Le Moal
2022-10-25 10:32 ` [PATCH RFC v3 2/7] ata: libata-scsi: Add ata_internal_queuecommand() John Garry
2022-10-27 1:45 ` Damien Le Moal
2022-10-27 9:56 ` John Garry
2022-10-27 13:02 ` Hannes Reinecke
2022-10-27 17:23 ` John Garry
2022-10-27 22:35 ` Damien Le Moal
2022-10-28 8:14 ` John Garry
2022-10-28 8:26 ` Damien Le Moal
2022-10-27 22:25 ` Damien Le Moal
2022-10-28 8:01 ` John Garry
2022-10-28 8:07 ` Damien Le Moal
2022-10-28 8:33 ` John Garry
2022-10-31 5:59 ` Damien Le Moal
2022-11-02 9:52 ` John Garry
2022-11-02 10:07 ` Damien Le Moal
2022-11-02 11:12 ` Hannes Reinecke
2022-11-02 11:25 ` Damien Le Moal
2022-11-07 10:12 ` Hannes Reinecke
2022-11-07 13:29 ` Damien Le Moal
2022-11-07 14:34 ` Hannes Reinecke
2022-10-25 10:32 ` John Garry [this message]
2022-10-25 10:32 ` [PATCH RFC v3 4/7] ata: libata: Add ata_internal_timeout() John Garry
2022-10-25 10:32 ` [PATCH RFC v3 5/7] ata: libata: Queue ATA internal commands as requests John Garry
2022-10-25 10:32 ` [PATCH RFC v3 6/7] scsi: mvsas: Remove internal tag handling John Garry
2022-10-25 10:32 ` [PATCH RFC v3 7/7] scsi: hisi_sas: Remove internal tag handling for reserved commands John Garry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1666693976-181094-4-git-send-email-john.garry@huawei.com \
--to=john.garry@huawei.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jejb@linux.ibm.com \
--cc=jinpu.wang@cloud.ionos.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=niklas.cassel@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox