From: Mike Christie <michael.christie@oracle.com>
To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
james.bottomley@hansenpartnership.com
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH v2 09/35] scsi: core: Convert to scsi_exec_req
Date: Wed, 28 Sep 2022 21:53:41 -0500 [thread overview]
Message-ID: <20220929025407.119804-10-michael.christie@oracle.com> (raw)
In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com>
scsi_execute* is going to be removed. Convert to scsi_exec_req so
we pass all args in a scsi_exec_args struct.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
drivers/scsi/scsi.c | 21 +++++++++++++++++----
drivers/scsi/scsi_ioctl.c | 9 +++++++--
drivers/scsi/scsi_lib.c | 31 +++++++++++++++++++++++++------
drivers/scsi/scsi_scan.c | 37 ++++++++++++++++++++++++++++---------
4 files changed, 77 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index c59eac7a32f2..8d8090c8fb05 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -309,8 +309,14 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer,
* I'm not convinced we need to try quite this hard to get VPD, but
* all the existing users tried this hard.
*/
- result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer,
- len, NULL, 30 * HZ, 3, NULL);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = buffer,
+ .buf_len = len,
+ .timeout = 30 * HZ,
+ .retries = 3 }));
if (result)
return -EIO;
@@ -531,8 +537,15 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,
put_unaligned_be32(request_len, &cmd[6]);
memset(buffer, 0, len);
- result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer,
- request_len, &sshdr, 30 * HZ, 3, NULL);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = buffer,
+ .buf_len = request_len,
+ .sshdr = &sshdr,
+ .timeout = 30 * HZ,
+ .retries = 3 }));
if (result < 0)
return result;
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 729e309e6034..5708af4485bb 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -73,8 +73,13 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
SCSI_LOG_IOCTL(1, sdev_printk(KERN_INFO, sdev,
"Trying ioctl with scsi command %d\n", *cmd));
- result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0,
- &sshdr, timeout, retries, NULL);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = cmd,
+ .data_dir = DMA_NONE,
+ .sshdr = &sshdr,
+ .timeout = timeout,
+ .retries = retries }));
SCSI_LOG_IOCTL(2, sdev_printk(KERN_INFO, sdev,
"Ioctl returned 0x%x\n", result));
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index e1c19fea24e0..9136a3dfcd67 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2123,8 +2123,15 @@ int scsi_mode_select(struct scsi_device *sdev, int pf, int sp,
cmd[4] = len;
}
- ret = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, real_buffer, len,
- sshdr, timeout, retries, NULL);
+ ret = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = cmd,
+ .data_dir = DMA_TO_DEVICE,
+ .buf = real_buffer,
+ .buf_len = len,
+ .sshdr = sshdr,
+ .timeout = timeout,
+ .retries = retries }));
kfree(real_buffer);
return ret;
}
@@ -2188,8 +2195,15 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
memset(buffer, 0, len);
- result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len,
- sshdr, timeout, retries, NULL);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = buffer,
+ .buf_len = len,
+ .sshdr = sshdr,
+ .timeout = timeout,
+ .retries = retries }));
if (result < 0)
return result;
@@ -2273,8 +2287,13 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries,
/* try to eat the UNIT_ATTENTION if there are enough retries */
do {
- result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr,
- timeout, 1, NULL);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = cmd,
+ .data_dir = DMA_NONE,
+ .sshdr = sshdr,
+ .timeout = timeout,
+ .retries = 1 }));
if (sdev->removable && scsi_sense_valid(sshdr) &&
sshdr->sense_key == UNIT_ATTENTION)
sdev->changed = 1;
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 5d27f5196de6..58edd5d641f8 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -210,8 +210,14 @@ static void scsi_unlock_floptical(struct scsi_device *sdev,
scsi_cmd[3] = 0;
scsi_cmd[4] = 0x2a; /* size */
scsi_cmd[5] = 0;
- scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL,
- SCSI_TIMEOUT, 3, NULL);
+ scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = scsi_cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = result,
+ .buf_len = 0x2a,
+ .timeout = SCSI_TIMEOUT,
+ .retries = 3 }));
}
static int scsi_realloc_sdev_budget_map(struct scsi_device *sdev,
@@ -674,10 +680,17 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
memset(inq_result, 0, try_inquiry_len);
- result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE,
- inq_result, try_inquiry_len, &sshdr,
- HZ / 2 + HZ * scsi_inq_timeout, 3,
- &resid);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = scsi_cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = inq_result,
+ .buf_len = try_inquiry_len,
+ .sshdr = &sshdr,
+ .timeout = HZ / 2 +
+ HZ * scsi_inq_timeout,
+ .retries = 3,
+ .resid = &resid }));
SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
"scsi scan: INQUIRY %s with code 0x%x\n",
@@ -1477,9 +1490,15 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag
"scsi scan: Sending REPORT LUNS to (try %d)\n",
retries));
- result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE,
- lun_data, length, &sshdr,
- SCSI_REPORT_LUNS_TIMEOUT, 3, NULL);
+ result = scsi_exec_req(((struct scsi_exec_args) {
+ .sdev = sdev,
+ .cmd = scsi_cmd,
+ .data_dir = DMA_FROM_DEVICE,
+ .buf = lun_data,
+ .buf_len = length,
+ .sshdr = &sshdr,
+ .timeout = SCSI_REPORT_LUNS_TIMEOUT,
+ .retries = 3 }));
SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev,
"scsi scan: REPORT LUNS"
--
2.25.1
next prev parent reply other threads:[~2022-09-29 2:56 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 2:53 [PATCH v2 00/35] Allow scsi_execute users to control retries Mike Christie
2022-09-29 2:53 ` [PATCH v2 01/35] scsi: Add helper to prep sense during error handling Mike Christie
2022-09-29 7:39 ` Christoph Hellwig
2022-09-30 0:05 ` Bart Van Assche
2022-09-29 2:53 ` [PATCH v2 02/35] scsi: Allow passthrough to override what errors to retry Mike Christie
2022-09-29 11:00 ` Martin Wilck
2022-09-29 16:39 ` michael.christie
2022-09-29 2:53 ` [PATCH v2 03/35] scsi: Add struct for args to execution functions Mike Christie
2022-09-29 17:02 ` Bart Van Assche
2022-09-29 20:24 ` Mike Christie
2022-09-29 20:29 ` Bart Van Assche
2022-09-30 0:12 ` Bart Van Assche
2022-09-30 2:43 ` Mike Christie
2022-09-30 17:29 ` Bart Van Assche
2022-09-29 2:53 ` [PATCH v2 04/35] scsi: Add scsi_failure field to scsi_exec_args Mike Christie
2022-09-29 2:53 ` [PATCH v2 05/35] scsi: libata: Convert to scsi_exec_req Mike Christie
2022-09-29 2:53 ` [PATCH v2 06/35] hwmon: drivetemp: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 07/35] scsi: ch: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 08/35] scsi: scsi_dh: " Mike Christie
2022-09-29 2:53 ` Mike Christie [this message]
2022-09-29 2:53 ` [PATCH v2 10/35] scsi: spi: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 11/35] scsi: sd: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 12/35] scsi: zbc: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 13/35] scsi: ses: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 14/35] scsi: sr: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 15/35] scsi: virtio_scsi: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 16/35] scsi: target_core_pscsi: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 17/35] scsi: ufshcd: " Mike Christie
2022-09-30 18:03 ` Bart Van Assche
2022-09-29 2:53 ` [PATCH v2 18/35] scsi: cxlflash: " Mike Christie
2022-09-29 2:53 ` [PATCH v2 19/35] scsi: Remove scsi_execute functions Mike Christie
2022-09-29 2:53 ` [PATCH v2 20/35] scsi: Have scsi-ml retry scsi_probe_lun errors Mike Christie
2022-09-29 2:53 ` [PATCH v2 21/35] scsi: retry INQUIRY after timeout Mike Christie
2022-09-29 13:49 ` Martin Wilck
2022-09-29 2:53 ` [PATCH v2 22/35] scsi: Have scsi-ml retry read_capacity_16 errors Mike Christie
2022-09-29 14:12 ` Martin Wilck
2022-09-29 2:53 ` [PATCH v2 23/35] scsi: Have scsi-ml retry sd_spinup_disk errors Mike Christie
2022-09-29 14:13 ` Martin Wilck
2022-09-29 16:47 ` michael.christie
2022-09-29 2:53 ` [PATCH v2 24/35] scsi: hp_sw: Have scsi-ml retry scsi_exec_req errors Mike Christie
2022-09-29 14:16 ` Martin Wilck
2022-09-29 2:53 ` [PATCH v2 25/35] scsi: rdac: Have scsi-ml retry send_mode_select errors Mike Christie
2022-09-29 2:53 ` [PATCH v2 26/35] scsi: spi: Have scsi-ml retry spi_execute errors Mike Christie
2022-09-29 2:53 ` [PATCH v2 27/35] scsi: sd: Have scsi-ml retry sd_sync_cache errors Mike Christie
2022-09-29 2:54 ` [PATCH v2 28/35] scsi: ch: Have scsi-ml retry ch_do_scsi errors Mike Christie
2022-09-29 2:54 ` [PATCH v2 29/35] scsi: Have scsi-ml retry scsi_mode_sense errors Mike Christie
2022-09-29 2:54 ` [PATCH v2 30/35] scsi: Have scsi-ml retry scsi_report_lun_scan errors Mike Christie
2022-09-29 2:54 ` [PATCH v2 31/35] scsi: sd: Have sd_pr_command retry UAs Mike Christie
2022-09-29 2:54 ` [PATCH v2 32/35] scsi: sd: Have scsi-ml retry read_capacity_10 errors Mike Christie
2022-09-29 2:54 ` [PATCH v2 33/35] scsi: ses: Have scsi-ml retry scsi_exec_req errors Mike Christie
2022-09-29 2:54 ` [PATCH v2 34/35] scsi: sr: Have scsi-ml retry get_sectorsize errors Mike Christie
2022-09-29 2:54 ` [PATCH v2 35/35] scsi: cxlflash: Have scsi-ml retry read_cap16 errors Mike Christie
2022-09-29 14:36 ` [PATCH v2 00/35] Allow scsi_execute users to control retries Martin Wilck
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=20220929025407.119804-10-michael.christie@oracle.com \
--to=michael.christie@oracle.com \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mwilck@suse.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