scsi: Add struct for args to execution functions
Subsystems (5)
v3 cover scsi: Add struct for args to execution functions
The following patches were made over Martin's scsi staging/next branch. They add a struct that contains optinal arguments to the scsi_execute* functions. This will be needed for the patches that allow the scsi passthrough users to control retries because I'm adding a new optional argument. I separated the 2 sets to make it easier to review and post.
v3:
- Init scsi_exec_args user's sshdr as "sshdr = sshdr ? : local".
- Use just one sense_len check and remove the scsi_execute_args wrapper.
- Just use one scsi_execute_cmd function and have it check if the args is NULL else use a local one.
- Pass exec_args by pointer.
v2:
- Fix RQF_QUIET use.
- Use the more standard way of passing in a struct for passing in the scsi_exec_args struct.
- Pass a struct scsi_exec_args instead of pointer and add another macro for the case the caller doesn't want to pass in a scsi_exec_args struct. Then remove the NULL args check in __scsi_execute.
PATCH v3 1/15 scsi: Add struct for args to execution functions
This begins to move the SCSI execution functions to use a struct for passing in optional args. This patch adds the new struct, temporarily converts scsi_execute and scsi_execute_req ands a new helper, scsi_execute_cmd, which takes the scsi_exec_args struct.
There should be no change in behavior. We no longer alilow users to pass in any request->rq_flags valu, but they were only passing in RQF_QUIET which we do support by allowing users to pass in the BLK_MQ_REQ flags used by blk_mq_alloc_request.
The next patches will convert scsi_execute and scsi_execute_req users to the new helpers then remove scsi_execute and scsi_execute_req.
--- drivers/scsi/scsi_lib.c | 52 ++++++++++++++++++-------------------- include/scsi/scsi_device.h | 51 +++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 41 deletions(-)
drivers/scsi/scsi_lib.c +25 -27
@@ -185,39 +185,37 @@ void scsi_queue_insert(struct scsi_cmnd *cmd, int reason)__scsi_queue_insert (cmd, reason, true); } -/** -* __scsi_execute - insert request and wait for the result -* @sdev: scsi device +* scsi_execute_cmd - insert request and wait for the result +* @sdev: scsi_device * @cmd: scsi command -* @data_direction: data direction +* @opf: block layer request cmd_flags * @buffer: data buffer * @bufflen: len of buffer -* @sense: optional sense buffer -* @sshdr: optional decoded sense header * @timeout: request timeout in HZ * @retries: number of times to retry request -* @flags: flags for ->cmd_flags -* @rq_flags: flags for ->rq_flags -* @resid: optional residual length +* @args: Optional args. See struct definition for field descriptions * * Returns the scsi_cmnd result field if a command was executed, or a negative * Linux error code if we didn't get that far. */ -int __scsi_execute (struct scsi_device *sdev,const unsigned char *cmd, -int data_direction,void *buffer,unsigned bufflen, -unsigned char *sense,struct scsi_sense_hdr *sshdr, -int timeout,int retries,blk_opf_t flags, -req_flags_t rq_flags,int *resid) +int scsi_execute_cmd (struct scsi_device *sdev,const unsigned char *cmd, +blk_opf_t opf,void *buffer,unsigned int bufflen, +int timeout,int retries, +const struct scsi_exec_args *args) { +static const struct scsi_exec_args default_args;struct request *req;struct scsi_cmnd *scmd;int ret; - req =scsi_alloc_request (sdev->request_queue, - data_direction ==DMA_TO_DEVICE ? -REQ_OP_DRV_OUT :REQ_OP_DRV_IN , - rq_flags &RQF_PM ?BLK_MQ_REQ_PM :0 ); +if (!args) + args = &default_args; +else if (WARN_ON_ONCE (args->sense && + args->sense_len !=SCSI_SENSE_BUFFERSIZE )) +return -EINVAL ; + + req =scsi_alloc_request (sdev->request_queue, opf, args->req_flags);if (IS_ERR (req))return PTR_ERR (req);
@@ -232,8 +230,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,memcpy (scmd->cmnd, cmd, scmd->cmd_len); scmd->allowed = retries; req->timeout = timeout; - req->cmd_flags |= flags; - req->rq_flags |= rq_flags |RQF_QUIET ; + req->rq_flags |=RQF_QUIET ;/* * head injection *required* here otherwise quiesce won't work
@@ -249,20 +246,21 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,if (unlikely (scmd->resid_len >0 && scmd->resid_len <= bufflen))memset (buffer + bufflen - scmd->resid_len,0 , scmd->resid_len); -if (resid) - *resid = scmd->resid_len; -if (sense && scmd->sense_len) -memcpy (sense, scmd->sense_buffer,SCSI_SENSE_BUFFERSIZE ); -if (sshdr) +if (args->resid) + *args->resid = scmd->resid_len; +if (args->sense) +memcpy (args->sense, scmd->sense_buffer,SCSI_SENSE_BUFFERSIZE ); +if (args->sshdr)scsi_normalize_sense (scmd->sense_buffer, scmd->sense_len, - sshdr); + args->sshdr); + ret = scmd->result; out:blk_mq_free_request (req);return ret; } -EXPORT_SYMBOL (__scsi_execute); +EXPORT_SYMBOL (scsi_execute_cmd);/* * Wake up the error handler if necessary. Avoid as follows that the error
include/scsi/scsi_device.h +37 -14
65 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 6 lines · Mike Christie
This begins to move the SCSI execution functions to use a struct for passing in optional args. This patch adds the new struct, temporarily converts
scsi_executeandscsi_execute_reqands a new helper,scsi_execute_cmd, which takes thescsi_exec_argsstruct.There should be no change in behavior. We no longer alilow users to pass
^^^^^^
allow?Quoted 1 line
in any
request->rq_flagsvalu, but they were only passing inRQF_QUIET
^^^^ ^^^^^^^^^
value? RQF_PM?Quoted 5 lines
which we do support by allowing users to pass in the
BLK_MQ_REQflags used byblk_mq_alloc_request.The next patches will convert
scsi_executeandscsi_execute_requsers to the new helpers then removescsi_executeandscsi_execute_req.
After the patch description has been updated, please add:
Looks good:
Quoted 10 lines · Mike Christie
This begins to move the SCSI execution functions to use a struct for passing in optional args. This patch adds the new struct, temporarily converts
scsi_executeandscsi_execute_reqands a new helper,scsi_execute_cmd, which takes thescsi_exec_argsstruct.There should be no change in behavior. We no longer alilow users to pass in any
request->rq_flagsvalu, but they were only passing inRQF_QUIETwhich we do support by allowing users to pass in theBLK_MQ_REQflags used byblk_mq_alloc_request.
Quoted 4 lines
The next patches will convert
scsi_executeandscsi_execute_requsers to the new helpers then removescsi_executeandscsi_execute_req.Signed-off-by Mike Christie<[email protected]>
Quoted 4 lines
--- drivers/scsi/scsi_lib.c | 52 ++++++++++++++++++-------------------- include/scsi/scsi_device.h | 51 +++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 41 deletions(-)
...
drivers/scsi/scsi_lib.c void scsi_queue_insert(struct scsi_cmnd *cmd, int reason) · line 215
Quoted 9 lines
drivers/scsi/scsi_lib.c +4
-4- req =scsi_alloc_request (sdev->request_queue, - data_direction ==DMA_TO_DEVICE ? -REQ_OP_DRV_OUT :REQ_OP_DRV_IN , - rq_flags &RQF_PM ?BLK_MQ_REQ_PM :0 ); +if (!args) + args = &default_args; +else if (WARN_ON_ONCE (args->sense && + args->sense_len !=SCSI_SENSE_BUFFERSIZE ))
As mentioned elsewhere, this size check is not fool proof as it does rely on the caller to set sense_len to what really is the size of the memory pointed to by args->sense. Better than nothing, I suppose.
Quoted 2 lines
drivers/scsi/scsi_lib.c +2
-0+return -EINVAL ; +
PATCH v3 2/15 ata: libata-scsi: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Convert libata to scsi_execute_cmd.
--- drivers/ata/libata-scsi.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/ata/libata-scsi.c +14 -9
@@ -367,8 +367,12 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)u8 scsi_cmd[MAX_COMMAND_SIZE ];u8 args[4 ], *argbuf =NULL ;int argsize =0 ; -enum dma_data_direction data_dir;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .sense = sensebuf, + .sense_len =sizeof (sensebuf), + };int cmd_result;if (arg ==NULL )
@@ -391,11 +395,9 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) scsi_cmd[1 ] = (4 <<1 );/* PIO Data-in */ scsi_cmd[2 ] =0x0e ;/* no off.line or cc, read from dev, block count in sector count field */ - data_dir =DMA_FROM_DEVICE ; }else { scsi_cmd[1 ] = (3 <<1 );/* Non-data */ scsi_cmd[2 ] =0x20 ;/* cc but no off.line or data xfer */ - data_dir =DMA_NONE ; } scsi_cmd[0 ] =ATA_16 ;
@@ -413,9 +415,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)/* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result =scsi_execute (scsidev, scsi_cmd, data_dir, argbuf, argsize, - sensebuf, &sshdr, (10 *HZ ),5 ,0 ,0 ,NULL ); - + cmd_result =scsi_execute_cmd (scsidev, scsi_cmd,REQ_OP_DRV_IN , argbuf, + argsize,10 *HZ ,5 , &exec_args);if (cmd_result <0 ) { rc = cmd_result; goto error;
@@ -475,6 +476,11 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)u8 args[7 ];struct scsi_sense_hdr sshdr;int cmd_result; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .sense = sensebuf, + .sense_len =sizeof (sensebuf), + };if (arg ==NULL )return -EINVAL ;
@@ -497,9 +503,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg)/* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result =scsi_execute (scsidev, scsi_cmd,DMA_NONE ,NULL ,0 , - sensebuf, &sshdr, (10 *HZ ),5 ,0 ,0 ,NULL ); - + cmd_result =scsi_execute_cmd (scsidev, scsi_cmd,REQ_OP_DRV_IN ,NULL , +0 ,10 *HZ ,5 , &exec_args);if (cmd_result <0 ) { rc = cmd_result; goto error;
Signature · 1 line
2.25.1
PATCH v3 3/15 hwmon: drivetemp: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Convert drivetemp to scsi_execute_cmd.
--- drivers/hwmon/drivetemp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/hwmon/drivetemp.c +5 -6
@@ -164,7 +164,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, u8 lba_low, u8 lba_mid, u8 lba_high) { u8 scsi_cmd[MAX_COMMAND_SIZE]; -int data_dir; +enum req_op op;memset (scsi_cmd,0 ,sizeof (scsi_cmd)); scsi_cmd[0 ] =ATA_16 ;
@@ -175,7 +175,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st,* field. */ scsi_cmd[2 ] =0x06 ; - data_dir =DMA_TO_DEVICE ; + op =REQ_OP_DRV_OUT ; }else { scsi_cmd[1 ] = (4 <<1 );/* PIO Data-in */ /*
@@ -183,7 +183,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st,* field. */ scsi_cmd[2 ] =0x0e ; - data_dir =DMA_FROM_DEVICE ; + op =REQ_OP_DRV_IN ; } scsi_cmd[4 ] = feature; scsi_cmd[6 ] =1 ;/* 1 sector */
@@ -192,9 +192,8 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, scsi_cmd[12 ] = lba_high; scsi_cmd[14 ] = ata_command; -return scsi_execute_req (st->sdev, scsi_cmd, data_dir, - st->smartdata,ATA_SECT_SIZE ,NULL ,HZ ,5 , -NULL ); +return scsi_execute_cmd (st->sdev, scsi_cmd, op, st->smartdata, +ATA_SECT_SIZE ,HZ ,5 ,NULL ); } static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature,
Signature · 1 line
2.25.1
PATCH v3 4/15 scsi: ch: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Convert ch to scsi_execute_cmd.
--- drivers/scsi/ch.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/scsi/ch.c +15 -15
@@ -184,20 +184,21 @@ static int ch_find_errno(struct scsi_sense_hdr *sshdr)static int ch_do_scsi (scsi_changer *ch,unsigned char *cmd,int cmd_len, -void *buffer,unsigned buflength, -enum dma_data_direction direction) +void *buffer,unsigned int buflength,enum req_op op) {int errno, retries =0 , timeout, result;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; timeout = (cmd[0 ] ==INITIALIZE_ELEMENT_STATUS ) ? timeout_init : timeout_move; retry: errno =0 ; - result =scsi_execute_req (ch->device, cmd, direction, buffer, - buflength, &sshdr, timeout *HZ , -MAX_RETRIES ,NULL ); + result =scsi_execute_cmd (ch->device, cmd, op, buffer, buflength, + timeout *HZ ,MAX_RETRIES , &exec_args);if (result <0 )return result;if (scsi_sense_valid (&sshdr)) {
@@ -254,7 +255,7 @@ ch_read_element_status(scsi_changer *ch, u_int elem, char *data) cmd[5 ] =1 ; cmd[9 ] =255 ;if (0 == (result =ch_do_scsi (ch, cmd,12 , - buffer,256 ,DMA_FROM_DEVICE ))) { + buffer,256 ,REQ_OP_DRV_IN ))) {if (((buffer[16 ] <<8 ) | buffer[17 ]) != elem) {DPRINTK ("asked for element 0x%02x, got 0x%02x\n" , elem,(buffer[16 ] <<8 ) | buffer[17 ]);
@@ -284,7 +285,7 @@ ch_init_elem(scsi_changer *ch)memset (cmd,0 ,sizeof (cmd)); cmd[0 ] =INITIALIZE_ELEMENT_STATUS ; cmd[1 ] = (ch->device->lun &0x7 ) <<5 ; - err =ch_do_scsi (ch, cmd,6 ,NULL ,0 ,DMA_NONE ); + err =ch_do_scsi (ch, cmd,6 ,NULL ,0 ,REQ_OP_DRV_IN );VPRINTK (KERN_INFO ,"... finished\n" );return err; }
@@ -306,10 +307,10 @@ ch_readconfig(scsi_changer *ch) cmd[1 ] = (ch->device->lun &0x7 ) <<5 ; cmd[2 ] =0x1d ; cmd[4 ] =255 ; - result =ch_do_scsi (ch, cmd,10 , buffer,255 ,DMA_FROM_DEVICE ); + result =ch_do_scsi (ch, cmd,10 , buffer,255 ,REQ_OP_DRV_IN );if (0 != result) { cmd[1 ] |= (1 <<3 ); - result =ch_do_scsi (ch, cmd,10 , buffer,255 ,DMA_FROM_DEVICE ); + result =ch_do_scsi (ch, cmd,10 , buffer,255 ,REQ_OP_DRV_IN ); }if (0 == result) { ch->firsts[CHET_MT] =
@@ -434,7 +435,7 @@ ch_position(scsi_changer *ch, u_int trans, u_int elem, int rotate) cmd[4 ] = (elem >>8 ) &0xff ; cmd[5 ] = elem &0xff ; cmd[8 ] = rotate ?1 :0 ; -return ch_do_scsi (ch, cmd,10 ,NULL ,0 ,DMA_NONE ); +return ch_do_scsi (ch, cmd,10 ,NULL ,0 ,REQ_OP_DRV_IN ); } static int
@@ -455,7 +456,7 @@ ch_move(scsi_changer *ch, u_int trans, u_int src, u_int dest, int rotate) cmd[6 ] = (dest >>8 ) &0xff ; cmd[7 ] = dest &0xff ; cmd[10 ] = rotate ?1 :0 ; -return ch_do_scsi (ch, cmd,12 ,NULL ,0 ,DMA_NONE ); +return ch_do_scsi (ch, cmd,12 ,NULL ,0 ,REQ_OP_DRV_IN ); } static int
@@ -481,7 +482,7 @@ ch_exchange(scsi_changer *ch, u_int trans, u_int src, cmd[9 ] = dest2 &0xff ; cmd[10 ] = (rotate1 ?1 :0 ) | (rotate2 ?2 :0 ); -return ch_do_scsi (ch, cmd,12 ,NULL ,0 ,DMA_NONE ); +return ch_do_scsi (ch, cmd,12 ,NULL ,0 ,REQ_OP_DRV_IN ); } static void
@@ -531,7 +532,7 @@ ch_set_voltag(scsi_changer *ch, u_int elem,memcpy (buffer,tag,32 );ch_check_voltag (buffer); - result =ch_do_scsi (ch, cmd,12 , buffer,256 ,DMA_TO_DEVICE ); + result =ch_do_scsi (ch, cmd,12 , buffer,256 ,REQ_OP_DRV_OUT );kfree (buffer);return result; }
@@ -799,8 +800,7 @@ static long ch_ioctl(struct file *file, ch_cmd[5 ] =1 ; ch_cmd[9 ] =255 ; - result =ch_do_scsi (ch, ch_cmd,12 , - buffer,256 ,DMA_FROM_DEVICE ); + result =ch_do_scsi (ch, ch_cmd,12 , buffer,256 ,REQ_OP_DRV_IN );if (!result) { cge.cge_status = buffer[18 ]; cge.cge_flags =0 ;
Signature · 1 line
2.25.1
PATCH v3 5/15 scsi: scsi_dh: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute is going to be removed. Convert the scsi_dh users to scsi_execute_cmd.
--- drivers/scsi/device_handler/scsi_dh_alua.c | 26 +++++++++++++-------- drivers/scsi/device_handler/scsi_dh_emc.c | 13 +++++++---- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 22 ++++++++++------- drivers/scsi/device_handler/scsi_dh_rdac.c | 12 ++++++---- 4 files changed, 45 insertions(+), 28 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +16 -10
@@ -127,8 +127,11 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff, int bufflen, struct scsi_sense_hdr *sshdr, int flags) { u8 cdb[MAX_COMMAND_SIZE]; -blk_opf_t req_flags =REQ_FAILFAST_DEV |REQ_FAILFAST_TRANSPORT | -REQ_FAILFAST_DRIVER ; +blk_opf_t opf =REQ_OP_DRV_IN |REQ_FAILFAST_DEV | +REQ_FAILFAST_TRANSPORT |REQ_FAILFAST_DRIVER ; +const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + };/* Prepare the command. */ memset (cdb,0x0 ,MAX_COMMAND_SIZE );
@@ -139,9 +142,9 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff, cdb[1 ] =MI_REPORT_TARGET_PGS ;put_unaligned_be32 (bufflen, &cdb[6 ]); -return scsi_execute (sdev, cdb,DMA_FROM_DEVICE , buff, bufflen,NULL , - sshdr,ALUA_FAILOVER_TIMEOUT *HZ , -ALUA_FAILOVER_RETRIES , req_flags,0 ,NULL ); +return scsi_execute_cmd (sdev, cdb, opf, buff, bufflen, +ALUA_FAILOVER_TIMEOUT *HZ , +ALUA_FAILOVER_RETRIES , &exec_args); }/*
@@ -157,8 +160,11 @@ static int submit_stpg(struct scsi_device *sdev, int group_id,u8 cdb[MAX_COMMAND_SIZE ];unsigned char stpg_data[8 ];int stpg_len =8 ; -blk_opf_t req_flags =REQ_FAILFAST_DEV |REQ_FAILFAST_TRANSPORT | -REQ_FAILFAST_DRIVER ; +blk_opf_t opf =REQ_OP_DRV_OUT |REQ_FAILFAST_DEV | +REQ_FAILFAST_TRANSPORT |REQ_FAILFAST_DRIVER ; +const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + };/* Prepare the data buffer */ memset (stpg_data,0 , stpg_len);
@@ -171,9 +177,9 @@ static int submit_stpg(struct scsi_device *sdev, int group_id, cdb[1 ] =MO_SET_TARGET_PGS ;put_unaligned_be32 (stpg_len, &cdb[6 ]); -return scsi_execute (sdev, cdb,DMA_TO_DEVICE , stpg_data, stpg_len,NULL , - sshdr,ALUA_FAILOVER_TIMEOUT *HZ , -ALUA_FAILOVER_RETRIES , req_flags,0 ,NULL ); +return scsi_execute_cmd (sdev, cdb, opf, stpg_data, + stpg_len,ALUA_FAILOVER_TIMEOUT *HZ , +ALUA_FAILOVER_RETRIES , &exec_args); } static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size,
drivers/scsi/device_handler/scsi_dh_emc.c +8 -5
@@ -239,8 +239,11 @@ static int send_trespass_cmd(struct scsi_device *sdev,unsigned char cdb[MAX_COMMAND_SIZE ];int err, res =SCSI_DH_OK , len;struct scsi_sense_hdr sshdr; -blk_opf_t req_flags =REQ_FAILFAST_DEV |REQ_FAILFAST_TRANSPORT | -REQ_FAILFAST_DRIVER ; +blk_opf_t opf =REQ_OP_DRV_OUT |REQ_FAILFAST_DEV | +REQ_FAILFAST_TRANSPORT |REQ_FAILFAST_DRIVER ; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };if (csdev->flags &CLARIION_SHORT_TRESPASS ) { page22 = short_trespass;
@@ -263,9 +266,9 @@ static int send_trespass_cmd(struct scsi_device *sdev,BUG_ON ((len >CLARIION_BUFFER_SIZE ));memcpy (csdev->buffer, page22, len); - err =scsi_execute (sdev, cdb,DMA_TO_DEVICE , csdev->buffer, len,NULL , - &sshdr,CLARIION_TIMEOUT *HZ ,CLARIION_RETRIES , - req_flags,0 ,NULL ); + err =scsi_execute_cmd (sdev, cdb, opf, csdev->buffer, len, +CLARIION_TIMEOUT *HZ ,CLARIION_RETRIES , + &exec_args);if (err) {if (scsi_sense_valid (&sshdr)) res =trespass_endio (sdev, &sshdr);
drivers/scsi/device_handler/scsi_dh_hp_sw.c +14 -8
@@ -83,12 +83,15 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)unsigned char cmd[6 ] = {TEST_UNIT_READY };struct scsi_sense_hdr sshdr;int ret =SCSI_DH_OK , res; -blk_opf_t req_flags =REQ_FAILFAST_DEV |REQ_FAILFAST_TRANSPORT | -REQ_FAILFAST_DRIVER ; +blk_opf_t opf =REQ_OP_DRV_IN |REQ_FAILFAST_DEV | +REQ_FAILFAST_TRANSPORT |REQ_FAILFAST_DRIVER ; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; retry: - res =scsi_execute (sdev, cmd,DMA_NONE ,NULL ,0 ,NULL , &sshdr, -HP_SW_TIMEOUT ,HP_SW_RETRIES , req_flags,0 ,NULL ); + res =scsi_execute_cmd (sdev, cmd, opf,NULL ,0 ,HP_SW_TIMEOUT , +HP_SW_RETRIES , &exec_args);if (res) {if (scsi_sense_valid (&sshdr)) ret =tur_done (sdev, h, &sshdr);
@@ -121,12 +124,15 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h)struct scsi_device *sdev = h->sdev;int res, rc =SCSI_DH_OK ;int retry_cnt =HP_SW_RETRIES ; -blk_opf_t req_flags =REQ_FAILFAST_DEV |REQ_FAILFAST_TRANSPORT | -REQ_FAILFAST_DRIVER ; +blk_opf_t opf =REQ_OP_DRV_IN |REQ_FAILFAST_DEV | +REQ_FAILFAST_TRANSPORT |REQ_FAILFAST_DRIVER ; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; retry: - res =scsi_execute (sdev, cmd,DMA_NONE ,NULL ,0 ,NULL , &sshdr, -HP_SW_TIMEOUT ,HP_SW_RETRIES , req_flags,0 ,NULL ); + res =scsi_execute_cmd (sdev, cmd, opf,NULL ,0 ,HP_SW_TIMEOUT , +HP_SW_RETRIES , &exec_args);if (res) {if (!scsi_sense_valid (&sshdr)) { sdev_printk(KERN_WARNING, sdev,
drivers/scsi/device_handler/scsi_dh_rdac.c +7 -5
@@ -536,8 +536,11 @@ static void send_mode_select(struct work_struct *work)unsigned char cdb[MAX_COMMAND_SIZE ];struct scsi_sense_hdr sshdr;unsigned int data_size; -blk_opf_t req_flags =REQ_FAILFAST_DEV |REQ_FAILFAST_TRANSPORT | -REQ_FAILFAST_DRIVER ; +blk_opf_t opf =REQ_OP_DRV_OUT |REQ_FAILFAST_DEV | +REQ_FAILFAST_TRANSPORT |REQ_FAILFAST_DRIVER ; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };spin_lock (&ctlr->ms_lock);list_splice_init (&ctlr->ms_head, &list);
@@ -555,9 +558,8 @@ static void send_mode_select(struct work_struct *work) (char *) h->ctlr->array_name, h->ctlr->index, (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); -if (scsi_execute (sdev, cdb,DMA_TO_DEVICE , &h->ctlr->mode_select, - data_size,NULL , &sshdr,RDAC_TIMEOUT *HZ , -RDAC_RETRIES , req_flags,0 ,NULL )) { +if (scsi_execute_cmd (sdev, cdb, opf, &h->ctlr->mode_select, data_size, +RDAC_TIMEOUT *HZ ,RDAC_RETRIES , &exec_args)) { err =mode_select_handle_sense (sdev, &sshdr);if (err ==SCSI_DH_RETRY && retry_cnt--) goto retry;
Signature · 1 line
2.25.1
PATCH v3 6/15 scsi: core: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Convert scsi-ml to scsi_execute_cmd.
--- drivers/scsi/scsi.c | 12 +++++++----- drivers/scsi/scsi_ioctl.c | 7 +++++-- drivers/scsi/scsi_lib.c | 26 +++++++++++++++++--------- drivers/scsi/scsi_scan.c | 26 ++++++++++++++++---------- 4 files changed, 45 insertions(+), 26 deletions(-)
drivers/scsi/scsi.c +7 -5
@@ -309,8 +309,8 @@ 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_execute_cmd (sdev, cmd,REQ_OP_DRV_IN , buffer, len, +30 *HZ ,3 ,NULL );if (result)return -EIO ;
@@ -510,6 +510,9 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,unsigned char cmd[16 ];struct scsi_sense_hdr sshdr;int result, request_len; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };if (sdev->no_report_opcodes || sdev->scsi_level <SCSI_SPC_3 )return -EINVAL ;
@@ -531,9 +534,8 @@ 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_execute_cmd (sdev, cmd,REQ_OP_DRV_IN , buffer, + request_len,30 *HZ ,3 , &exec_args);if (result <0 )return result; if (result && scsi_sense_valid(&sshdr) &&
drivers/scsi/scsi_ioctl.c +5 -2
@@ -69,12 +69,15 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, {int result;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };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_execute_cmd (sdev, cmd,REQ_OP_DRV_IN ,NULL ,0 , timeout, + retries, &exec_args);SCSI_LOG_IOCTL (2 ,sdev_printk (KERN_INFO , sdev,"Ioctl returned 0x%x\n" , result));
drivers/scsi/scsi_lib.c +17 -9
@@ -2084,6 +2084,9 @@ int scsi_mode_select(struct scsi_device *sdev, int pf, int sp, {unsigned char cmd[10 ];unsigned char *real_buffer; +const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + };int ret;memset (cmd,0 ,sizeof (cmd));
@@ -2133,8 +2136,8 @@ 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_execute_cmd (sdev, cmd,REQ_OP_DRV_OUT , real_buffer, len, + timeout, retries, &exec_args);kfree (real_buffer);return ret; }
@@ -2165,6 +2168,10 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,int header_length;int result, retry_count = retries;struct scsi_sense_hdr my_sshdr; +const struct scsi_exec_args exec_args = { +/* caller might not be interested in sense, but we need it */ + .sshdr = sshdr ? : &my_sshdr, + };memset (data,0 ,sizeof (*data));memset (&cmd[0 ],0 ,12 );
@@ -2173,9 +2180,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, cmd[1 ] = dbd &0x18 ;/* allows DBD and LLBA bits */ cmd[2 ] = modepage; -/* caller might not be interested in sense, but we need it */ -if (!sshdr) - sshdr = &my_sshdr; + sshdr = exec_args.sshdr; retry: use_10_for_ms = sdev->use_10_for_ms || len >255 ;
@@ -2198,8 +2203,8 @@ 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_execute_cmd (sdev, cmd,REQ_OP_DRV_IN , buffer, len, + timeout, retries, &exec_args);if (result <0 )return result;
@@ -2279,12 +2284,15 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries,char cmd[] = {TEST_UNIT_READY ,0 ,0 ,0 ,0 ,0 , }; +const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + };int result;/* 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_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, NULL, 0, + timeout, 1, &exec_args); if (sdev->removable && scsi_sense_valid(sshdr) && sshdr->sense_key == UNIT_ATTENTION) sdev->changed = 1;
drivers/scsi/scsi_scan.c +16 -10
@@ -210,7 +210,7 @@ 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_execute_cmd (sdev, scsi_cmd,REQ_OP_DRV_IN , result,0x2a ,SCSI_TIMEOUT ,3 ,NULL ); }
@@ -647,8 +647,12 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,unsigned char scsi_cmd[MAX_COMMAND_SIZE ];int first_inquiry_len, try_inquiry_len, next_inquiry_len;int response_len =0 ; -int pass, count, result; +int pass, count, result, resid;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .resid = &resid, + }; *bflags =0 ;
@@ -666,18 +670,16 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,/* Each pass gets up to three chances to ignore Unit Attention */ for (count =0 ; count <3 ; ++count) { -int resid; -memset (scsi_cmd,0 ,6 ); scsi_cmd[0 ] =INQUIRY ; scsi_cmd[4 ] = (unsigned char ) try_inquiry_len;memset (inq_result,0 , try_inquiry_len); - result =scsi_execute_req (sdev, scsi_cmd,DMA_FROM_DEVICE , - inq_result, try_inquiry_len, &sshdr, + result =scsi_execute_cmd (sdev, scsi_cmd,REQ_OP_DRV_IN , + inq_result, try_inquiry_len,HZ /2 +HZ * scsi_inq_timeout,3 , - &resid); + &exec_args); SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, "scsi scan: INQUIRY %s with code 0x%x\n",
@@ -1403,6 +1405,9 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflagstruct scsi_sense_hdr sshdr;struct scsi_device *sdev;struct Scsi_Host *shost =dev_to_shost (&starget->dev); +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };int ret =0 ;/*
@@ -1477,9 +1482,10 @@ 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_execute_cmd (sdev, scsi_cmd,REQ_OP_DRV_IN , + lun_data, length, +SCSI_REPORT_LUNS_TIMEOUT ,3 , + &exec_args); SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, "scsi scan: REPORT LUNS"
Signature · 1 line
2.25.1
Re: [PATCH v3 06/15] scsi: core: Convert to scsi_execute_cmd
Looks good:
PATCH v3 7/15 scsi: spi: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute is going to be removed. Convert to the SPI class to scsi_execute_cmd.
--- drivers/scsi/scsi_transport_spi.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/scsi/scsi_transport_spi.c +15 -16
@@ -105,28 +105,27 @@ static int sprint_frac(char *dest, int value, int denom) }static int spi_execute (struct scsi_device *sdev,const void *cmd, -enum dma_data_direction dir, -void *buffer,unsigned bufflen, +enum req_op op,void *buffer,unsigned int bufflen,struct scsi_sense_hdr *sshdr) {int i, result; -unsigned char sense[SCSI_SENSE_BUFFERSIZE ];struct scsi_sense_hdr sshdr_tmp; +blk_opf_t opf = op |REQ_FAILFAST_DEV |REQ_FAILFAST_TRANSPORT | +REQ_FAILFAST_DRIVER ; +const struct scsi_exec_args exec_args = { + .req_flags =BLK_MQ_REQ_PM , + .sshdr = sshdr ? : &sshdr_tmp, + }; -if (!sshdr) - sshdr = &sshdr_tmp; + sshdr = exec_args.sshdr;for (i =0 ; i <DV_RETRIES ; i++) {/* * The purpose of the RQF_PM flag below is to bypass the * SDEV_QUIESCE state. */ - result =scsi_execute (sdev, cmd, dir, buffer, bufflen, sense, - sshdr,DV_TIMEOUT ,/* retries */ 1 , -REQ_FAILFAST_DEV | -REQ_FAILFAST_TRANSPORT | -REQ_FAILFAST_DRIVER , -RQF_PM ,NULL ); + result =scsi_execute_cmd (sdev, cmd, opf, buffer, bufflen, +DV_TIMEOUT ,1 , &exec_args);if (result <0 || !scsi_sense_valid (sshdr) || sshdr->sense_key !=UNIT_ATTENTION )break ;
@@ -675,7 +674,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer, }for (r =0 ; r < retries; r++) { - result =spi_execute (sdev, spi_write_buffer,DMA_TO_DEVICE , + result =spi_execute (sdev, spi_write_buffer,REQ_OP_DRV_OUT , buffer, len, &sshdr);if (result || !scsi_device_online (sdev)) {
@@ -697,7 +696,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer, }memset (ptr,0 , len); -spi_execute (sdev, spi_read_buffer,DMA_FROM_DEVICE , +spi_execute (sdev, spi_read_buffer,REQ_OP_DRV_IN , ptr, len,NULL );scsi_device_set_state (sdev,SDEV_QUIESCE );
@@ -722,7 +721,7 @@ spi_dv_device_compare_inquiry(struct scsi_device *sdev, u8 *buffer,for (r =0 ; r < retries; r++) {memset (ptr,0 , len); - result =spi_execute (sdev, spi_inquiry,DMA_FROM_DEVICE , + result =spi_execute (sdev, spi_inquiry,REQ_OP_DRV_IN , ptr, len,NULL );if (result || !scsi_device_online (sdev)) {
@@ -828,7 +827,7 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sdev, u8 *buffer)* (reservation conflict, device not ready, etc) just * skip the write tests */ for (l =0 ; ; l++) { - result =spi_execute (sdev, spi_test_unit_ready,DMA_NONE , + result =spi_execute (sdev, spi_test_unit_ready,REQ_OP_DRV_IN ,NULL ,0 ,NULL );if (result) {
@@ -841,7 +840,7 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sdev, u8 *buffer) } result =spi_execute (sdev, spi_read_buffer_descriptor, -DMA_FROM_DEVICE , buffer,4 ,NULL ); +REQ_OP_DRV_IN , buffer,4 ,NULL );if (result)/* Device has no echo buffer */
Signature · 1 line
2.25.1
PATCH v3 8/15 scsi: sd: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute* is going to be removed. Convert sd_mod to use scsi_execute_cmd.
--- drivers/scsi/sd.c | 83 +++++++++++++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 28 deletions(-)
drivers/scsi/sd.c +55 -28
@@ -664,6 +664,9 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer,struct scsi_disk *sdkp = data;struct scsi_device *sdev = sdkp->device;u8 cdb[12 ] = {0 , }; +const struct scsi_exec_args exec_args = { + .req_flags =BLK_MQ_REQ_PM , + };int ret; cdb[0 ] = send ?SECURITY_PROTOCOL_OUT :SECURITY_PROTOCOL_IN ;
@@ -671,9 +674,9 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer,put_unaligned_be16 (spsp, &cdb[2 ]);put_unaligned_be32 (len, &cdb[6 ]); - ret =scsi_execute (sdev, cdb, send ?DMA_TO_DEVICE :DMA_FROM_DEVICE , - buffer, len,NULL ,NULL ,SD_TIMEOUT , sdkp->max_retries,0 , -RQF_PM ,NULL ); + ret =scsi_execute_cmd (sdev, cdb, send ?REQ_OP_DRV_OUT :REQ_OP_DRV_IN , + buffer, len,SD_TIMEOUT , sdkp->max_retries, + &exec_args); return ret <= 0 ? ret : -EIO; }#endif /* CONFIG_BLK_SED_OPAL */
@@ -1583,13 +1586,16 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)const int timeout = sdp->request_queue->rq_timeout *SD_FLUSH_TIMEOUT_MULTIPLIER ;struct scsi_sense_hdr my_sshdr; +const struct scsi_exec_args exec_args = { + .req_flags =BLK_MQ_REQ_PM , +/* caller might not be interested in sense, but we need it */ + .sshdr = sshdr ? : &my_sshdr, + };if (!scsi_device_online (sdp))return -ENODEV ; -/* caller might not be interested in sense, but we need it */ -if (!sshdr) - sshdr = &my_sshdr; + sshdr = exec_args.sshdr;for (retries =3 ; retries >0 ; --retries) {unsigned char cmd[16 ] = {0 };
@@ -1602,8 +1608,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)* Leave the rest of the command zero to indicate * flush everything. */ - res =scsi_execute (sdp, cmd,DMA_NONE ,NULL ,0 ,NULL , sshdr, - timeout, sdkp->max_retries,0 ,RQF_PM ,NULL ); + res =scsi_execute_cmd (sdp, cmd,REQ_OP_DRV_IN ,NULL ,0 , + timeout, sdkp->max_retries, &exec_args);if (res ==0 )break ; }
@@ -1745,6 +1751,9 @@ static int sd_pr_command(struct block_device *bdev, u8 sa,struct scsi_disk *sdkp =scsi_disk (bdev->bd_disk);struct scsi_device *sdev = sdkp->device;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };int result;u8 cmd[16 ] = {0 , };u8 data[24 ] = {0 , };
@@ -1758,8 +1767,9 @@ static int sd_pr_command(struct block_device *bdev, u8 sa,put_unaligned_be64 (sa_key, &data[8 ]); data[20 ] = flags; - result =scsi_execute_req (sdev, cmd,DMA_TO_DEVICE , &data,sizeof (data), - &sshdr,SD_TIMEOUT , sdkp->max_retries,NULL ); + result =scsi_execute_cmd (sdev, cmd,REQ_OP_DRV_OUT , &data, +sizeof (data),SD_TIMEOUT , sdkp->max_retries, + &exec_args);if (scsi_status_is_check_condition (result) &&scsi_sense_valid (&sshdr)) {
@@ -2088,6 +2098,9 @@ sd_spinup_disk(struct scsi_disk *sdkp)int retries, spintime;unsigned int the_result;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };int sense_valid =0 ; spintime =0 ;
@@ -2103,10 +2116,11 @@ sd_spinup_disk(struct scsi_disk *sdkp) cmd[0 ] =TEST_UNIT_READY ;memset ((void *) &cmd[1 ],0 ,9 ); - the_result =scsi_execute_req (sdkp->device, cmd, -DMA_NONE ,NULL ,0 , - &sshdr,SD_TIMEOUT , - sdkp->max_retries,NULL ); + the_result =scsi_execute_cmd (sdkp->device, cmd, +REQ_OP_DRV_IN ,NULL ,0 , +SD_TIMEOUT , + sdkp->max_retries, + &exec_args);/* * If the drive has indicated to us that it
@@ -2163,10 +2177,10 @@ sd_spinup_disk(struct scsi_disk *sdkp) cmd[4 ] =1 ;/* Start spin cycle */ if (sdkp->device->start_stop_pwr_cond) cmd[4 ] |=1 <<4 ; -scsi_execute_req (sdkp->device, cmd,DMA_NONE , -NULL ,0 , &sshdr, +scsi_execute_cmd (sdkp->device, cmd, +REQ_OP_DRV_IN ,NULL ,0 ,SD_TIMEOUT , sdkp->max_retries, -NULL ); + &exec_args); spintime_expire = jiffies +100 *HZ ; spintime =1 ; }
@@ -2296,6 +2310,9 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, {unsigned char cmd[16 ];struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };int sense_valid =0 ;int the_result;int retries =3 , reset_retries =READ_CAPACITY_RETRIES_ON_RESET ;
@@ -2313,9 +2330,9 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, cmd[13 ] =RC16_LEN ;memset (buffer,0 ,RC16_LEN ); - the_result =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , - buffer,RC16_LEN , &sshdr, -SD_TIMEOUT , sdkp->max_retries,NULL ); + the_result =scsi_execute_cmd (sdp, cmd,REQ_OP_DRV_IN , + buffer,RC16_LEN ,SD_TIMEOUT , + sdkp->max_retries, &exec_args);if (media_not_present (sdkp, &sshdr))return -ENODEV ;
@@ -2387,6 +2404,9 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, {unsigned char cmd[16 ];struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };int sense_valid =0 ;int the_result;int retries =3 , reset_retries =READ_CAPACITY_RETRIES_ON_RESET ;
@@ -2398,9 +2418,9 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,memset (&cmd[1 ],0 ,9 );memset (buffer,0 ,8 ); - the_result =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , - buffer,8 , &sshdr, -SD_TIMEOUT , sdkp->max_retries,NULL ); + the_result =scsi_execute_cmd (sdp, cmd,REQ_OP_DRV_IN , buffer, +8 ,SD_TIMEOUT , sdkp->max_retries, + &exec_args);if (media_not_present (sdkp, &sshdr))return -ENODEV ;
@@ -3637,6 +3657,10 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start) {unsigned char cmd[6 ] = {START_STOP };/* START_VALID */ struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .req_flags =BLK_MQ_REQ_PM , + };struct scsi_device *sdp = sdkp->device;int res;
@@ -3649,8 +3673,8 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)if (!scsi_device_online (sdp))return -ENODEV ; - res =scsi_execute (sdp, cmd,DMA_NONE ,NULL ,0 ,NULL , &sshdr, -SD_TIMEOUT , sdkp->max_retries,0 ,RQF_PM ,NULL ); + res =scsi_execute_cmd (sdp, cmd,REQ_OP_DRV_IN ,NULL ,0 ,SD_TIMEOUT , + sdkp->max_retries, &exec_args);if (res) {sd_print_result (sdkp,"Start/Stop Unit failed" , res);if (res >0 &&scsi_sense_valid (&sshdr)) {
@@ -3790,10 +3814,13 @@ static int sd_resume_runtime(struct device *dev)if (sdp->ignore_media_change) {/* clear the device's sense data */ static const u8 cmd[10 ] = {REQUEST_SENSE }; +const struct scsi_exec_args exec_args = { + .req_flags =BLK_MQ_REQ_PM , + }; -if (scsi_execute (sdp, cmd,DMA_NONE ,NULL ,0 ,NULL , -NULL , sdp->request_queue->rq_timeout,1 ,0 , -RQF_PM ,NULL )) +if (scsi_execute_cmd (sdp, cmd,REQ_OP_DRV_IN ,NULL ,0 , + sdp->request_queue->rq_timeout,1 , + &exec_args))sd_printk (KERN_NOTICE , sdkp,"Failed to clear sense data\n" ); }
Signature · 1 line
2.25.1
Re: [PATCH v3 08/15] scsi: sd: Convert to scsi_execute_cmd
Looks good:
PATCH v3 9/15 scsi: zbc: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Conver zbc to scsi_execute_cmd.
--- drivers/scsi/sd_zbc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/sd_zbc.c +5 -3
@@ -148,6 +148,9 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf,struct scsi_device *sdp = sdkp->device;const int timeout = sdp->request_queue->rq_timeout;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };unsigned char cmd[16 ];unsigned int rep_len;int result;
@@ -160,9 +163,8 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf,if (partial) cmd[14 ] =ZBC_REPORT_ZONE_PARTIAL ; - result =scsi_execute_req (sdp, cmd,DMA_FROM_DEVICE , - buf, buflen, &sshdr, - timeout,SD_MAX_RETRIES ,NULL ); + result =scsi_execute_cmd (sdp, cmd,REQ_OP_DRV_IN , buf, buflen, + timeout,SD_MAX_RETRIES , &exec_args);if (result) {sd_printk (KERN_ERR , sdkp,"REPORT ZONES start lba %llu failed\n" , lba);
Signature · 1 line
2.25.1
Re: [PATCH v3 09/15] scsi: zbc: Convert to scsi_execute_cmd
Looks good:
PATCH v3 10/15 scsi: ses: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Convert ses to scsi_execute_cmd.
--- drivers/scsi/ses.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/scsi/ses.c +10 -4
@@ -89,10 +89,13 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,unsigned char recv_page_code;unsigned int retries =SES_RETRIES ;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };do { - ret =scsi_execute_req (sdev, cmd,DMA_FROM_DEVICE , buf, bufflen, - &sshdr,SES_TIMEOUT ,1 ,NULL ); + ret =scsi_execute_cmd (sdev, cmd,REQ_OP_DRV_IN , buf, bufflen, +SES_TIMEOUT ,1 , &exec_args); }while (ret >0 && --retries &&scsi_sense_valid (&sshdr) && (sshdr.sense_key ==NOT_READY || (sshdr.sense_key ==UNIT_ATTENTION && sshdr.asc ==0x29 )));
@@ -130,10 +133,13 @@ static int ses_send_diag(struct scsi_device *sdev, int page_code, };struct scsi_sense_hdr sshdr;unsigned int retries =SES_RETRIES ; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };do { - result =scsi_execute_req (sdev, cmd,DMA_TO_DEVICE , buf, bufflen, - &sshdr,SES_TIMEOUT ,1 ,NULL ); + result =scsi_execute_cmd (sdev, cmd,REQ_OP_DRV_OUT , buf, + bufflen,SES_TIMEOUT ,1 , &exec_args); }while (result >0 && --retries &&scsi_sense_valid (&sshdr) && (sshdr.sense_key ==NOT_READY || (sshdr.sense_key ==UNIT_ATTENTION && sshdr.asc ==0x29 )));
Signature · 1 line
2.25.1
PATCH v3 11/15 scsi: sr: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute* is going to be removed. Convert sr to scsi_execute_cmd.
--- drivers/scsi/sr.c | 11 +++++++---- drivers/scsi/sr_ioctl.c | 17 ++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-)
drivers/scsi/sr.c +7 -4
@@ -170,10 +170,13 @@ static unsigned int sr_get_events(struct scsi_device *sdev)struct event_header *eh = (void *)buf;struct media_event_desc *med = (void *)(buf +4 );struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };int result; - result =scsi_execute_req (sdev, cmd,DMA_FROM_DEVICE , buf,sizeof (buf), - &sshdr,SR_TIMEOUT ,MAX_RETRIES ,NULL ); + result =scsi_execute_cmd (sdev, cmd,REQ_OP_DRV_IN , buf,sizeof (buf), +SR_TIMEOUT ,MAX_RETRIES , &exec_args);if (scsi_sense_valid (&sshdr) && sshdr.sense_key ==UNIT_ATTENTION )return DISK_EVENT_MEDIA_CHANGE ;
@@ -730,8 +733,8 @@ static void get_sectorsize(struct scsi_cd *cd)memset (buffer,0 ,sizeof (buffer));/* Do the command and wait.. */ - the_result =scsi_execute_req (cd->device, cmd,DMA_FROM_DEVICE , - buffer,sizeof (buffer),NULL , + the_result =scsi_execute_cmd (cd->device, cmd,REQ_OP_DRV_IN , + buffer,sizeof (buffer),SR_TIMEOUT ,MAX_RETRIES ,NULL ); retries--;
drivers/scsi/sr_ioctl.c +10 -7
@@ -188,13 +188,15 @@ static int sr_play_trkind(struct cdrom_device_info *cdi,int sr_do_ioctl (Scsi_CD *cd,struct packet_command *cgc) {struct scsi_device *SDev; -struct scsi_sense_hdr local_sshdr, *sshdr = &local_sshdr; +struct scsi_sense_hdr local_sshdr, *sshdr;int result, err =0 , retries =0 ; +const struct scsi_exec_args exec_args = { + .sshdr = cgc->sshdr ? : &local_sshdr, + }; SDev = cd->device; -if (cgc->sshdr) - sshdr = cgc->sshdr; + sshdr = exec_args.sshdr; retry:if (!scsi_block_when_processing_errors (SDev)) {
@@ -202,10 +204,11 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) goto out; } - result =scsi_execute (SDev, cgc->cmd, cgc->data_direction, - cgc->buffer, cgc->buflen,NULL , sshdr, - cgc->timeout,IOCTL_RETRIES ,0 ,0 ,NULL ); - + result =scsi_execute_cmd (SDev, cgc->cmd, + cgc->data_direction ==DMA_TO_DEVICE ? +REQ_OP_DRV_OUT :REQ_OP_DRV_IN , cgc->buffer, + cgc->buflen, cgc->timeout,IOCTL_RETRIES , + &exec_args);/* Minimal error checking. Ignore cases we know about, and report the rest. */ if (result <0 ) { err = result;
Signature · 1 line
2.25.1
Re: [PATCH v3 11/15] scsi: sr: Convert to scsi_execute_cmd
Looks good:
PATCH v3 12/15 scsi: virtio_scsi: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Convert virtio_scsi to scsi_execute_cmd.
--- drivers/scsi/virtio_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/virtio_scsi.c +2 -2
@@ -347,8 +347,8 @@ static void virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi)memset (inq_result,0 , inq_result_len); - result =scsi_execute_req (sdev, scsi_cmd,DMA_FROM_DEVICE , - inq_result, inquiry_len,NULL , + result =scsi_execute_cmd (sdev, scsi_cmd,REQ_OP_DRV_IN , + inq_result, inquiry_len,SD_TIMEOUT ,SD_MAX_RETRIES ,NULL );if (result ==0 && inq_result[0 ] >>5 ) {
Signature · 1 line
2.25.1
Re: [PATCH v3 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd
The conversion itself looks good, but how the f**k did we end up with a LLDD calling unquiry below the SCSI midlayer?
Re: [PATCH v3 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd
Quoted 2 lines · Christoph Hellwig
The conversion itself looks good, but how the f**k did we end up with a LLDD calling unquiry below the SCSI midlayer?
I don't know how it happened.
It looks like a hack around scsi_scan_host not removing devices. Going forward, it looks like we can remove the inquiry code by having scsi_scan_host be able to remove devices that are no longer returned.
However, there's an extra catch because they have that DID_BAD_TARGET case where qemu returns VIRTIO_SCSI_S_BAD_TARGET if there are no devices on the host, but other drivers uses that error code for a bunch of different reasons.
I was thinking to handle the DID_BAD_TARGET use case above and this type of issue:
maybe we want to have a driver level BLIST like:
static struct {
char *driver;
blist_flags_t flags;
} scsi_static_driver_list[] __initdata = {
{"virtio_scsi", BLIST_REMOVE_ON_BAD_TARGET},
{"aacard", BLIST_SHOW_DEV_PQ1},One other question, can I do this work after the patchset in this email, the scsi_cmnd retry patches and the actual PR ones? I keep going off track on these side adventures.
Re: [PATCH v3 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd
Quoted 3 lines · Mike Christie
It looks like a hack around
scsi_scan_hostnot removing devices. Going forward, it looks like we can remove the inquiry code by havingscsi_scan_hostbe able to remove devices that are no longer returned.
Yes, that's the place to do it. I can see arguments for and against that, but doing it from and LLDD (and including sd.h in the LLDD implementation!) just doesn't make sense.
Quoted 6 lines
I was thinking to handle the
DID_BAD_TARGETuse case above and this type of issue:maybe we want to have a driver level BLIST like:
Maybe instead of a blist we just need better way to communicate this rather than abusing DID_BAD_TARGET?
Quoted 3 lines
One other question, can I do this work after the patchset in this email, the
scsi_cmndretry patches and the actual PR ones? I keep going off track on these side adventures.
Yes, please. I think we need to finish this series first.
Re: [PATCH v3 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd
Quoted 12 lines · Christoph Hellwig
Quoted 3 lines · Mike Christie
It looks like a hack around
scsi_scan_hostnot removing devices. Going forward, it looks like we can remove the inquiry code by havingscsi_scan_hostbe able to remove devices that are no longer returned.Yes, that's the place to do it. I can see arguments for and against that, but doing it from and LLDD (and including
sd.hin the LLDD implementation!) just doesn't make sense.Quoted 3 lines
I was thinking to handle the
DID_BAD_TARGETuse case above and this type of issue:
Quoted 6 lines
Quoted 3 lines
maybe we want to have a driver level BLIST like:
Maybe instead of a blist we just need better way to communicate this rather than abusing
DID_BAD_TARGET?
Yeah, after I sent the blist email I looked into qemu and the DID_BAD_TARGET uses more and we can do more what you are thinking.
I'm going to do:
0. qemu only uses VIRTIO_SCSI_S_BAD_TARGET (this gets converted to DID_BAD_TARGET) when the device does not exist, or if you are using a sg device and it returns DID_BAD_TARGET.
1. Most driver uses of DID_BAD_TARGET are when the device is missing, disconnected, timedout, or the bus:target_id:LUN value was not supported by the driver. So I was going to rename DID_BAD_TARGET to DID_INVALID_DEVICE/DID_DEVICE_INACCESSIBLE for those cases.
2. Create a new DID_ error code for the other use cases where the driver meant that the target did something incorrect/invalid like send a invalid response.
In the scan code then we know if we got a DID_INVALID_DEVICE the device is not there anymore so we can remove it.
PATCH v3 13/15 scsi: target_core_pscsi: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute_req is going to be removed. Convert pscsi to scsi_execute_cmd.
--- drivers/target/target_core_pscsi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/target/target_core_pscsi.c +5 -7
@@ -144,8 +144,7 @@ static void pscsi_tape_read_blocksize(struct se_device *dev, cdb[0 ] =MODE_SENSE ; cdb[4 ] =0x0c ;/* 12 bytes */ - ret =scsi_execute_req (sdev, cdb,DMA_FROM_DEVICE , buf,12 ,NULL , -HZ ,1 ,NULL ); + ret =scsi_execute_cmd (sdev, cdb,REQ_OP_DRV_IN , buf,12 ,HZ ,1 ,NULL );if (ret) goto out_free;
@@ -195,8 +194,8 @@ pscsi_get_inquiry_vpd_serial(struct scsi_device *sdev, struct t10_wwn *wwn) cdb[2 ] =0x80 ;/* Unit Serial Number */ put_unaligned_be16 (INQUIRY_VPD_SERIAL_LEN , &cdb[3 ]); - ret =scsi_execute_req (sdev, cdb,DMA_FROM_DEVICE , buf, -INQUIRY_VPD_SERIAL_LEN ,NULL ,HZ ,1 ,NULL ); + ret =scsi_execute_cmd (sdev, cdb,REQ_OP_DRV_IN , buf, +INQUIRY_VPD_SERIAL_LEN ,HZ ,1 ,NULL );if (ret) goto out_free;
@@ -230,9 +229,8 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, cdb[2 ] =0x83 ;/* Device Identifier */ put_unaligned_be16 (INQUIRY_VPD_DEVICE_IDENTIFIER_LEN , &cdb[3 ]); - ret =scsi_execute_req (sdev, cdb,DMA_FROM_DEVICE , buf, -INQUIRY_VPD_DEVICE_IDENTIFIER_LEN , -NULL ,HZ ,1 ,NULL ); + ret =scsi_execute_cmd (sdev, cdb,REQ_OP_DRV_IN , buf, +INQUIRY_VPD_DEVICE_IDENTIFIER_LEN ,HZ ,1 ,NULL );if (ret) goto out;
Signature · 1 line
2.25.1
PATCH v3 14/15 scsi: cxlflash: Convert to scsi_execute_cmd
In reply to Mike Christiescsi_execute is going to be removed. Convert cxlflash to use scsi_execute_cmd.
--- drivers/scsi/cxlflash/superpipe.c | 34 ++++++++++++++++--------------- drivers/scsi/cxlflash/vlun.c | 32 ++++++++++++++--------------- 2 files changed, 34 insertions(+), 32 deletions(-)
drivers/scsi/cxlflash/superpipe.c +18 -16
@@ -308,19 +308,19 @@ static int afu_attach(struct cxlflash_cfg *cfg, struct ctx_info *ctxi)* @lli: LUN destined for capacity request. * * The READ_CAP16 can take quite a while to complete. Should an EEH occur while -* in scsi_execute(), the EEH handler will attempt to recover. As part of the -* recovery, the handler drains all currently running ioctls, waiting until they -* have completed before proceeding with a reset. As this routine is used on the -* ioctl path, this can create a condition where the EEH handler becomes stuck, -* infinitely waiting for this ioctl thread. To avoid this behavior, temporarily -* unmark this thread as an ioctl thread by releasing the ioctl read semaphore. -* This will allow the EEH handler to proceed with a recovery while this thread -* is still running. Once the scsi_execute() returns, reacquire the ioctl read -* semaphore and check the adapter state in case it changed while inside of -* scsi_execute(). The state check will wait if the adapter is still being -* recovered or return a failure if the recovery failed. In the event that the -* adapter reset failed, simply return the failure as the ioctl would be unable -* to continue. +* in scsi_execute_cmd(), the EEH handler will attempt to recover. As part of +* the recovery, the handler drains all currently running ioctls, waiting until +* they have completed before proceeding with a reset. As this routine is used +* on the ioctl path, this can create a condition where the EEH handler becomes +* stuck, infinitely waiting for this ioctl thread. To avoid this behavior, +* temporarily unmark this thread as an ioctl thread by releasing the ioctl +* read semaphore. This will allow the EEH handler to proceed with a recovery +* while this thread is still running. Once the scsi_execute_cmd() returns, +* reacquire the ioctl read semaphore and check the adapter state in case it +* changed while inside of scsi_execute_cmd(). The state check will wait if the +* adapter is still being recovered or return a failure if the recovery failed. +* In the event that the adapter reset failed, simply return the failure as the +* ioctl would be unable to continue. * * Note that the above puts a requirement on this routine to only be called on * an ioctl thread.
@@ -333,6 +333,9 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli)struct device *dev = &cfg->dev->dev;struct glun_info *gli = lli->parent;struct scsi_sense_hdr sshdr; +const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + };u8 *cmd_buf =NULL ;u8 *scsi_cmd =NULL ;int rc =0 ;
@@ -357,9 +360,8 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli)/* Drop the ioctl read semahpore across lengthy call */ up_read (&cfg->ioctl_rwsem); - result =scsi_execute (sdev, scsi_cmd,DMA_FROM_DEVICE , cmd_buf, -CMD_BUFSIZE ,NULL , &sshdr, to,CMD_RETRIES , -0 ,0 ,NULL ); + result =scsi_execute_cmd (sdev, scsi_cmd,REQ_OP_DRV_IN , cmd_buf, +CMD_BUFSIZE , to,CMD_RETRIES , exec_args);down_read (&cfg->ioctl_rwsem); rc =check_state (cfg);if (rc) {
drivers/scsi/cxlflash/vlun.c +16 -16
@@ -397,19 +397,19 @@ static int init_vlun(struct llun_info *lli)* @nblks: Number of logical blocks to write same. * * The SCSI WRITE_SAME16 can take quite a while to complete. Should an EEH occur -* while in scsi_execute(), the EEH handler will attempt to recover. As part of -* the recovery, the handler drains all currently running ioctls, waiting until -* they have completed before proceeding with a reset. As this routine is used -* on the ioctl path, this can create a condition where the EEH handler becomes -* stuck, infinitely waiting for this ioctl thread. To avoid this behavior, -* temporarily unmark this thread as an ioctl thread by releasing the ioctl read -* semaphore. This will allow the EEH handler to proceed with a recovery while -* this thread is still running. Once the scsi_execute() returns, reacquire the -* ioctl read semaphore and check the adapter state in case it changed while -* inside of scsi_execute(). The state check will wait if the adapter is still -* being recovered or return a failure if the recovery failed. In the event that -* the adapter reset failed, simply return the failure as the ioctl would be -* unable to continue. +* while in scsi_execute_cmd(), the EEH handler will attempt to recover. As +* part of the recovery, the handler drains all currently running ioctls, +* waiting until they have completed before proceeding with a reset. As this +* routine is used on the ioctl path, this can create a condition where the +* EEH handler becomes stuck, infinitely waiting for this ioctl thread. To +* avoid this behavior, temporarily unmark this thread as an ioctl thread by +* releasing the ioctl read semaphore. This will allow the EEH handler to +* proceed with a recovery while this thread is still running. Once the +* scsi_execute_cmd() returns, reacquire the ioctl read semaphore and check the +* adapter state in case it changed while inside of scsi_execute_cmd(). The +* state check will wait if the adapter is still being recovered or return a +* failure if the recovery failed. In the event that the adapter reset failed, +* simply return the failure as the ioctl would be unable to continue. * * Note that the above puts a requirement on this routine to only be called on * an ioctl thread.
@@ -450,9 +450,9 @@ static int write_same16(struct scsi_device *sdev,/* Drop the ioctl read semahpore across lengthy call */ up_read (&cfg->ioctl_rwsem); - result =scsi_execute (sdev, scsi_cmd,DMA_TO_DEVICE , cmd_buf, -CMD_BUFSIZE ,NULL ,NULL , to, -CMD_RETRIES ,0 ,0 ,NULL ); + result =scsi_execute_cmd (sdev, scsi_cmd,REQ_OP_DRV_OUT , + cmd_buf,CMD_BUFSIZE , to, +CMD_RETRIES ,NULL );down_read (&cfg->ioctl_rwsem); rc =check_state (cfg);if (rc) {
Signature · 1 line
2.25.1
PATCH v3 15/15 scsi: Remove scsi_execute_req/scsi_execute functions
In reply to Mike Christiescsi_execute and scsi_execute_req are no longer used so remove them.
--- include/scsi/scsi_device.h | 31 ------------------------------- 1 file changed, 31 deletions(-)
include/scsi/scsi_device.h +0 -31
@@ -470,37 +470,6 @@ int scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd, int timeout, int retries, const struct scsi_exec_args *args); -/* Make sure any sense buffer is the correct size. */ -#define scsi_execute (_sdev, _cmd, _data_dir, _buffer, _bufflen, _sense, \ - _sshdr, _timeout, _retries, _flags, _rq_flags, \ - _resid) \ -({ \ - scsi_execute_cmd(_sdev, _cmd, (_data_dir == DMA_TO_DEVICE ? \ - REQ_OP_DRV_OUT : REQ_OP_DRV_IN) | _flags, \ - _buffer, _bufflen, _timeout, _retries, \ - &(struct scsi_exec_args) { \ - .sense = _sense, \ - .sshdr = _sshdr, \ - .req_flags = _rq_flags & RQF_PM ? \ - BLK_MQ_REQ_PM : 0, \ - .resid = _resid, \ - }); \ -}) - -static inline int scsi_execute_req (struct scsi_device *sdev, -const unsigned char *cmd,int data_direction,void *buffer, -unsigned bufflen,struct scsi_sense_hdr *sshdr,int timeout, -int retries,int *resid) -{ -return scsi_execute_cmd (sdev, cmd, - data_direction ==DMA_TO_DEVICE ? -REQ_OP_DRV_OUT :REQ_OP_DRV_IN , buffer, - bufflen, timeout, retries, - &(struct scsi_exec_args ) { - .sshdr = sshdr, - .resid = resid, - }); -}extern void sdev_disable_disk_events (struct scsi_device *sdev);extern void sdev_enable_disk_events (struct scsi_device *sdev);extern int scsi_vpd_lun_id (struct scsi_device *,char *,size_t );
Signature · 1 line
2.25.1
Re: [PATCH v3 15/15] scsi: Remove scsi_execute_req/scsi_execute functions
Looks good: