Remove SUGGEST flags
Subsystems (11)
RFC 1/1 Remove SUGGEST flags
The SUGGEST_* flags in the SCSI command result have been out of fashion for a while and we don't actually use them in the error handling. Remove the remaining occurrences.
---
drivers/s390/scsi/zfcp_fsf.c | 1 - drivers/scsi/constants.c | 11 ++--------- drivers/scsi/hptiop.c | 3 +-- drivers/scsi/ips.c | 3 +-- drivers/scsi/libfc/fc_fcp.c | 6 +++--- drivers/scsi/lpfc/lpfc_scsi.c | 6 +++--- drivers/scsi/st.c | 6 +++--- drivers/usb/storage/transport.c | 2 +- include/scsi/scsi.h | 11 ----------- 9 files changed, 14 insertions(+), 35 deletions(-)
drivers/s390/scsi/zfcp_fsf.c +0 -1
@@ -2147,7 +2147,6 @@ static void zfcp_fsf_send_fcp_command_taif (unlikely (req->status &ZFCP_STATUS_FSFREQ_ABORTED )) {set_host_byte (scpnt,DID_SOFT_ERROR ); -set_driver_byte (scpnt,SUGGEST_RETRY ); goto skip_fsfstatus; }
drivers/scsi/constants.c +3 -10
@@ -1373,21 +1373,14 @@ static const char * const driverbyte_tab "DRIVER_INVALID", "DRIVER_TIMEOUT", "DRIVER_HARD", "DRIVER_SENSE"};#define NUM_DRIVERBYTE_STRS ARRAY_SIZE(driverbyte_table) -static const char *const driversuggest_table[]={"SUGGEST_OK" , -"SUGGEST_RETRY" ,"SUGGEST_ABORT" ,"SUGGEST_REMAP" ,"SUGGEST_DIE" , -"SUGGEST_5" ,"SUGGEST_6" ,"SUGGEST_7" ,"SUGGEST_SENSE" }; -#define NUM_SUGGEST_STRS ARRAY_SIZE(driversuggest_table) -void scsi_show_result (int result) {int hb =host_byte (result); -int db = (driver_byte (result) &DRIVER_MASK ); -int su = ((driver_byte (result) &SUGGEST_MASK ) >>4 ); +int db =driver_byte (result); -printk ("Result: hostbyte=%s driverbyte=%s,%s\n" , +printk ("Result: hostbyte=%s driverbyte=%s\n" , (hb <NUM_HOSTBYTE_STRS ? hostbyte_table[hb] :"invalid" ), - (db <NUM_DRIVERBYTE_STRS ? driverbyte_table[db] :"invalid" ), - (su <NUM_SUGGEST_STRS ? driversuggest_table[su] :"invalid" )); + (db <NUM_DRIVERBYTE_STRS ? driverbyte_table[db] :"invalid" )); }#else
drivers/scsi/hptiop.c +1 -2
@@ -580,8 +580,7 @@ static void hptiop_finish_scsi_req(strucbreak ;default : - scp->result = ((DRIVER_INVALID |SUGGEST_ABORT )<<24 ) | - (DID_ABORT <<16 ); + scp->result =DRIVER_INVALID <<24 |DID_ABORT <<16 ;break ; }
drivers/scsi/ips.c +1 -2
@@ -1004,8 +1004,7 @@ static int __ips_eh_reset(struct scsi_cmDEBUG_VAR (1 ,"(%s%d) Failing active commands" , ips_name, ha->host_num);while ((scb =ips_removeq_scb_head (&ha->scb_activelist))) { - scb->scsi_cmd->result = - (DID_RESET <<16 ) | (SUGGEST_RETRY <<24 ); + scb->scsi_cmd->result =DID_RESET <<16 ; scb->scsi_cmd->scsi_done (scb->scsi_cmd);ips_freescb (ha, scb); }
drivers/scsi/libfc/fc_fcp.c +3 -3
@@ -260,7 +260,7 @@ static void fc_fcp_retry_cmd(struct fc_f } fsp->state &= ~FC_SRB_ABORT_PENDING ; - fsp->io_status =SUGGEST_RETRY <<24 ; + fsp->io_status =0 ; fsp->status_code =FC_ERROR ;fc_fcp_complete_locked (fsp); }
@@ -860,7 +860,7 @@ static void fc_fcp_complete_locked(struc (!(fsp->scsi_comp_flags & FCP_RESID_UNDER) || fsp->xfer_len < fsp->data_len - fsp->scsi_resid)) { fsp->status_code =FC_DATA_UNDRUN ; - fsp->io_status =SUGGEST_RETRY <<24 ; + fsp->io_status =0 ; } }
@@ -1268,7 +1268,7 @@ static void fc_fcp_rec(struct fc_fcp_pkt rp = rport->dd_data;if (!fsp->seq_ptr || rp->rp_state !=RPORT_ST_READY ) { fsp->status_code =FC_HRD_ERROR ; - fsp->io_status =SUGGEST_RETRY <<24 ; + fsp->io_status =0 ;fc_fcp_complete_locked (fsp);return ; }
drivers/scsi/lpfc/lpfc_scsi.c +3 -3
@@ -1357,7 +1357,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba,scsi_build_sense_buffer (1 , cmd->sense_buffer,ILLEGAL_REQUEST ,0x10 ,0x1 ); - cmd->result = (DRIVER_SENSE |SUGGEST_DIE ) <<24 + cmd->result =DRIVER_SENSE <<24 |ScsiResult (DID_ABORT ,SAM_STAT_CHECK_CONDITION ); phba->bg_guard_err_cnt++;printk (KERN_ERR "BLKGRD: guard_tag error\n" );
@@ -1368,7 +1368,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba,scsi_build_sense_buffer (1 , cmd->sense_buffer,ILLEGAL_REQUEST ,0x10 ,0x3 ); - cmd->result = (DRIVER_SENSE |SUGGEST_DIE ) <<24 + cmd->result =DRIVER_SENSE <<24 |ScsiResult (DID_ABORT ,SAM_STAT_CHECK_CONDITION ); phba->bg_reftag_err_cnt++;
@@ -1380,7 +1380,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba,scsi_build_sense_buffer (1 , cmd->sense_buffer,ILLEGAL_REQUEST ,0x10 ,0x2 ); - cmd->result = (DRIVER_SENSE |SUGGEST_DIE ) <<24 + cmd->result =DRIVER_SENSE <<24 |ScsiResult (DID_ABORT ,SAM_STAT_CHECK_CONDITION ); phba->bg_apptag_err_cnt++;
drivers/scsi/st.c +3 -3
@@ -376,9 +376,9 @@ static int st_chk_result(struct scsi_tapif (!debugging) {/* Abnormal conditions for tape */ if (!cmdstatp->have_sense)printk (KERN_WARNING -"%s: Error %x (sugg. bt 0x%x, driver bt 0x%x, host bt 0x%x).\n" , - name, result,suggestion (result), -driver_byte (result) &DRIVER_MASK ,host_byte (result)); +"%s: Error %x (driver bt 0x%x, host bt 0x%x).\n" , + name, result,driver_byte (result), +host_byte (result)); else if (cmdstatp->have_sense && scode != NO_SENSE && scode != RECOVERED_ERROR &&
drivers/usb/storage/transport.c +1 -1
@@ -665,7 +665,7 @@ void usb_stor_invoke_transport(struct sc/* Did we transfer less than the minimum amount required? */ if ((srb->result ==SAM_STAT_GOOD || srb->sense_buffer[2 ] ==0 ) &&scsi_bufflen (srb) -scsi_get_resid (srb) < srb->underflow) - srb->result = (DID_ERROR <<16 ) | (SUGGEST_RETRY <<24 ); + srb->result =DID_ERROR <<16 ;return ;
include/scsi/scsi.h +0 -11
@@ -402,16 +402,6 @@ static inline int scsi_is_wlun(unsigned#define DRIVER_HARD 0x07#define DRIVER_SENSE 0x08 -#define SUGGEST_RETRY 0x10 -#define SUGGEST_ABORT 0x20 -#define SUGGEST_REMAP 0x30 -#define SUGGEST_DIE 0x40 -#define SUGGEST_SENSE 0x80 -#define SUGGEST_IS_OK 0xff - -#define DRIVER_MASK 0x0f -#define SUGGEST_MASK 0xf0 -/* * Internal return values. */
@@ -447,7 +437,6 @@ static inline int scsi_is_wlun(unsigned#define msg_byte (result) (((result) >> 8) & 0xff)#define host_byte (result) (((result) >> 16) & 0xff)#define driver_byte (result) (((result) >> 24) & 0xff) -#define suggestion (result) (driver_byte(result) & SUGGEST_MASK)static inline void set_msg_byte (struct scsi_cmnd *cmd,char status) {
Quoted 4 lines · Martin K. Petersen
The SUGGEST_* flags in the SCSI command result have been out of fashion for a while and we don't actually use them in the error handling. Remove the remaining occurrences.
OK So is there an up-to-date definitive document that explains all the bit-fields and their possible values of the scsi_cmnd's result member?
Quoted 2 lines
Signed-off-by Martin K. Petersen <[email protected]>
Thanks, these confused me.
Boaz
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Boaz" == Boaz Harrosh <[email protected]> writes:
Quoted 4 lines · Boaz> Martin K. Petersen wrote:
Quoted 4 lines
The SUGGEST_* flags in the SCSI command result have been out of fashion for a while and we don't actually use them in the error handling. Remove the remaining occurrences.
Boaz> OK So is there an up-to-date definitive document that explains all Boaz> the bit-fields and their possible values of the scsi_cmnd's result Boaz> member?
Not that I know of :|
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
James Bottomley
maintainerQuoted 3 lines · Martin K. Petersen
The SUGGEST_* flags in the SCSI command result have been out of fashion for a while and we don't actually use them in the error handling. Remove the remaining occurrences.
You forgot osst.c
I think this fixes it.
James
---
drivers/scsi/osst.c +2 -2
@@ -280,8 +280,8 @@ static int osst_chk_result(struct osst_tape * STp, struct osst_request * SRpnt)static int notyetprinted =1 ;printk (KERN_WARNING -"%s:W: Warning %x (sugg. bt 0x%x, driver bt 0x%x, host bt 0x%x).\n" , - name, result,suggestion (result),driver_byte (result) &DRIVER_MASK , +"%s:W: Warning %x (driver bt 0x%x, host bt 0x%x).\n" , + name, result,driver_byte (result),host_byte (result));if (notyetprinted) { notyetprinted =0 ;