cmd->serial_number removal, part 1
Subsystems (9)
cover cmd->serial_number removal, part 1
This removes all the east users of the command serial number. After this we still have dpt_i2o, which uses the serial number for finding commands in it's completion handler, and the eata and u14-34f drivers which use it for their own elevator algorithms.
PATCH 1/4 scsi: remove cmd->serial_number litter
Stop using cmd->serial_number in printks.
drivers/message/i2o/i2o_scsi.c +2 -2
@@ -361,7 +361,7 @@ static int i2o_scsi_reply(struct i2o_con*/ error =le32_to_cpu (msg->body[0 ]); -osm_debug ("Completed %ld\n" , cmd->serial_number); +osm_debug ("Completed %0x%p\n" , cmd); cmd->result = error &0xff ;/*
@@ -678,7 +678,7 @@ static int i2o_scsi_queuecommand_lck(str/* Queue the message */ i2o_msg_post (c, msg); -osm_debug ("Issued %ld\n" , SCpnt->serial_number); +osm_debug ("Issued %0x%p\n" , SCpnt);return 0 ;
drivers/scsi/dc395x.c +96 -97
513 lines not on this page · raw message
drivers/scsi/eata_pio.c +8 -11
@@ -372,8 +372,7 @@ static int eata_pio_queue_lck(struct scs cp->status =USED ;/* claim free slot */ DBG (DBG_QUEUE ,scmd_printk (KERN_DEBUG , cmd, -"eata_pio_queue pid %ld, y %d\n" , - cmd->serial_number, y)); +"eata_pio_queue 0x%p, y %d\n" , cmd, y)); cmd->scsi_done = (void *) done;
@@ -417,8 +416,8 @@ static int eata_pio_queue_lck(struct scsif (eata_pio_send_command (base,EATA_CMD_PIO_SEND_CP )) { cmd->result =DID_BUS_BUSY <<16 ;scmd_printk (KERN_NOTICE , cmd, -"eata_pio_queue pid %ld, HBA busy, " -"returning DID_BUS_BUSY, done.\n" , cmd->serial_number); +"eata_pio_queue pid 0x%p, HBA busy, " +"returning DID_BUS_BUSY, done.\n" , cmd);done (cmd); cp->status =FREE ;return 0 ;
@@ -432,8 +431,8 @@ static int eata_pio_queue_lck(struct scsoutw (0 , base +HA_RDATA );DBG (DBG_QUEUE ,scmd_printk (KERN_DEBUG , cmd, -"Queued base %#.4lx pid: %ld " -"slot %d irq %d\n" , sh->base, cmd->serial_number, y, sh->irq)); +"Queued base %#.4lx cmd: 0x%p " +"slot %d irq %d\n" , sh->base, cmd, y, sh->irq));return 0 ; }
@@ -445,8 +444,7 @@ static int eata_pio_abort(struct scsi_cmunsigned int loop =100 ;DBG (DBG_ABNORM ,scmd_printk (KERN_WARNING , cmd, -"eata_pio_abort called pid: %ld\n" , - cmd->serial_number)); +"eata_pio_abort called pid: 0x%p\n" , cmd));while (inb (cmd->device->host->base +HA_RAUXSTAT ) &HA_ABUSY )if (--loop ==0 ) {
@@ -481,8 +479,7 @@ static int eata_pio_host_reset(struct scstruct Scsi_Host *host = cmd->device->host;DBG (DBG_ABNORM ,scmd_printk (KERN_WARNING , cmd, -"eata_pio_reset called pid:%ld\n" , - cmd->serial_number)); +"eata_pio_reset called\n" ));spin_lock_irq (host->host_lock);
@@ -501,7 +498,7 @@ static int eata_pio_host_reset(struct sc sp =HD (cmd)->ccb[x].cmd;HD (cmd)->ccb[x].status =RESET ; -printk (KERN_WARNING "eata_pio_reset: slot %d in reset, pid %ld.\n" , x, sp->serial_number); +printk (KERN_WARNING "eata_pio_reset: slot %d in reset.\n" , x);if (sp ==NULL )panic ("eata_pio_reset: slot %d, sp==NULL.\n" , x);
drivers/scsi/u14-34f.c +27 -34
169 lines not on this page · raw message
drivers/scsi/wd33c93.c +22 -23
141 lines not on this page · raw message
drivers/scsi/dpt_i2o.c +3 -3
@@ -780,7 +780,7 @@ static int adpt_abort(struct scsi_cmnd *return FAILED ; } pHba = (adpt_hba *) cmd->device->host->hostdata[0 ]; -printk (KERN_INFO "%s: Trying to Abort cmd=%ld\n" ,pHba->name, cmd->serial_number); +printk (KERN_INFO "%s: Trying to Abort\n" ,pHba->name);if ((dptdevice = (void *) (cmd->device->hostdata)) ==NULL ) {printk (KERN_ERR "%s: Unable to abort: No device in cmnd\n" ,pHba->name);return FAILED ;
@@ -802,10 +802,10 @@ static int adpt_abort(struct scsi_cmnd *printk (KERN_INFO "%s: Abort cmd not supported\n" ,pHba->name);return FAILED ; } -printk (KERN_INFO "%s: Abort cmd=%ld failed.\n" ,pHba->name, cmd->serial_number); +printk (KERN_INFO "%s: Abort failed.\n" ,pHba->name);return FAILED ; } -printk (KERN_INFO "%s: Abort cmd=%ld complete.\n" ,pHba->name, cmd->serial_number); +printk (KERN_INFO "%s: Abort complete.\n" ,pHba->name);return SUCCESS ; }
drivers/scsi/eata.c +31 -35
178 lines not on this page · raw message
drivers/scsi/in2000.c +14 -15
@@ -343,7 +343,7 @@ static int in2000_queuecommand_lck(Scsi_ instance = cmd->device->host; hostdata = (struct IN2000_hostdata *) instance->hostdata; -DB (DB_QUEUE_COMMAND ,scmd_printk (KERN_DEBUG , cmd,"Q-%02x-%ld(" , cmd->cmnd[0 ], cmd->serial_number)) +DB (DB_QUEUE_COMMAND ,scmd_printk (KERN_DEBUG , cmd,"Q-%02x(" , cmd->cmnd[0 ]))/* Set up a few fields in the Scsi_Cmnd structure for our own use: * - host_scribble is the pointer to the next cmd in the input queue
@@ -427,7 +427,7 @@ static int in2000_queuecommand_lck(Scsi_in2000_execute (cmd->device->host); - DB(DB_QUEUE_COMMAND, printk(")Q-%ld ", cmd->serial_number)) + DB(DB_QUEUE_COMMAND, printk(")Q "))return 0 ; }
@@ -705,7 +705,7 @@ static void in2000_execute(struct Scsi_H* to search the input_Q again... */ - DB(DB_EXECUTE, printk("%s%ld)EX-2 ", (cmd->SCp.phase) ? "d:" : "", cmd->serial_number)) + DB(DB_EXECUTE, printk("%s)EX-2 ", (cmd->SCp.phase) ? "d:" : "")) }
@@ -1149,7 +1149,7 @@ static irqreturn_t in2000_intr(int irqnucase CSR_XFER_DONE |PHS_COMMAND :case CSR_UNEXP |PHS_COMMAND :case CSR_SRV_REQ |PHS_COMMAND : - DB(DB_INTR, printk("CMND-%02x,%ld", cmd->cmnd[0], cmd->serial_number)) + DB(DB_INTR, printk("CMND-%02x", cmd->cmnd[0]))transfer_pio (cmd->cmnd, cmd->cmd_len,DATA_OUT_DIR , hostdata); hostdata->state =S_CONNECTED ;break ;
@@ -1191,7 +1191,7 @@ static irqreturn_t in2000_intr(int irqnuswitch (msg) {case COMMAND_COMPLETE : - DB(DB_INTR, printk("CCMP-%ld", cmd->serial_number)) + DB(DB_INTR, printk("CCMP"))write_3393_cmd (hostdata,WD_CMD_NEGATE_ACK ); hostdata->state =S_PRE_CMP_DISC ;break ;
@@ -1329,7 +1329,7 @@ static irqreturn_t in2000_intr(int irqnuwrite_3393 (hostdata,WD_SOURCE_ID ,SRCID_ER );if (phs ==0x60 ) { -DB (DB_INTR ,printk ("SX-DONE-%ld" , cmd->serial_number)) +DB (DB_INTR ,printk ("SX-DONE" )) cmd->SCp.Message = COMMAND_COMPLETE; lun =read_3393 (hostdata,WD_TARGET_LUN );DB (DB_INTR ,printk (":%d.%d" , cmd->SCp.Status, lun))
@@ -1350,7 +1350,7 @@ static irqreturn_t in2000_intr(int irqnuin2000_execute (instance); }else { -printk ("%02x:%02x:%02x-%ld: Unknown SEL_XFER_DONE phase!!---" , asr, sr, phs, cmd->serial_number); +printk ("%02x:%02x:%02x: Unknown SEL_XFER_DONE phase!!---" , asr, sr, phs); }break ;
@@ -1417,7 +1417,7 @@ static irqreturn_t in2000_intr(int irqnuspin_unlock_irqrestore (instance->host_lock, flags);return IRQ_HANDLED ; } -DB (DB_INTR ,printk ("UNEXP_DISC-%ld" , cmd->serial_number)) +DB (DB_INTR ,printk ("UNEXP_DISC" )) hostdata->connected = NULL; hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); hostdata->state =S_UNCONNECTED ;
@@ -1442,7 +1442,7 @@ static irqreturn_t in2000_intr(int irqnu*/ write_3393 (hostdata,WD_SOURCE_ID ,SRCID_ER ); - DB(DB_INTR, printk("DISC-%ld", cmd->serial_number)) + DB(DB_INTR, printk("DISC"))if (cmd ==NULL ) {printk (" - Already disconnected! " ); hostdata->state =S_UNCONNECTED ;
@@ -1575,7 +1575,6 @@ static irqreturn_t in2000_intr(int irqnu }else hostdata->state =S_CONNECTED ; -DB (DB_INTR ,printk ("-%ld" , cmd->serial_number))break ;default :
@@ -1704,7 +1703,7 @@ static int __in2000_abort(Scsi_Cmnd * cm prev->host_scribble = cmd->host_scribble; cmd->host_scribble =NULL ; cmd->result =DID_ABORT <<16 ; -printk (KERN_WARNING "scsi%d: Abort - removing command %ld from input_Q. " , instance->host_no, cmd->serial_number); +printk (KERN_WARNING "scsi%d: Abort - removing command from input_Q. " , instance->host_no); cmd->scsi_done (cmd);return SUCCESS ; }
@@ -1725,7 +1724,7 @@ static int __in2000_abort(Scsi_Cmnd * cmif (hostdata->connected == cmd) { -printk (KERN_WARNING "scsi%d: Aborting connected command %ld - " , instance->host_no, cmd->serial_number); +printk (KERN_WARNING "scsi%d: Aborting connected command - " , instance->host_no);printk ("sending wd33c93 ABORT command - " );write_3393 (hostdata,WD_CONTROL ,CTRL_IDI |CTRL_EDI |CTRL_POLLED );
@@ -2270,7 +2269,7 @@ static int in2000_proc_info(struct Scsi_strcat (bp,"\nconnected: " );if (hd->connected) { cmd = (Scsi_Cmnd *) hd->connected; -sprintf (tbuf," %ld-%d:%d(%02x)" , cmd->serial_number, cmd->device->id, cmd->device->lun, cmd->cmnd[0 ]); +sprintf (tbuf," %d:%d(%02x)" , cmd->device->id, cmd->device->lun, cmd->cmnd[0 ]);strcat (bp, tbuf); } }
@@ -2278,7 +2277,7 @@ static int in2000_proc_info(struct Scsi_strcat (bp,"\ninput_Q: " ); cmd = (Scsi_Cmnd *) hd->input_Q;while (cmd) { -sprintf (tbuf," %ld-%d:%d(%02x)" , cmd->serial_number, cmd->device->id, cmd->device->lun, cmd->cmnd[0 ]); +sprintf (tbuf," %d:%d(%02x)" , cmd->device->id, cmd->device->lun, cmd->cmnd[0 ]);strcat (bp, tbuf); cmd = (Scsi_Cmnd *) cmd->host_scribble; }
@@ -2287,7 +2286,7 @@ static int in2000_proc_info(struct Scsi_strcat (bp,"\ndisconnected_Q:" ); cmd = (Scsi_Cmnd *) hd->disconnected_Q;while (cmd) { -sprintf (tbuf," %ld-%d:%d(%02x)" , cmd->serial_number, cmd->device->id, cmd->device->lun, cmd->cmnd[0 ]); +sprintf (tbuf," %d:%d(%02x)" , cmd->device->id, cmd->device->lun, cmd->cmnd[0 ]);strcat (bp, tbuf); cmd = (Scsi_Cmnd *) cmd->host_scribble; }
drivers/scsi/lpfc/lpfc_scsi.c +6 -8
@@ -3238,9 +3238,8 @@ lpfc_abort_handler(struct scsi_cmnd *cmnif (!lpfc_cmd) {lpfc_printf_vlog (vport,KERN_WARNING ,LOG_FCP ,"2873 SCSI Layer I/O Abort Request IO CMPL Status " -"x%x ID %d " -"LUN %d snum %#lx\n" , ret, cmnd->device->id, - cmnd->device->lun, cmnd->serial_number); +"x%x ID %d LUN %d\n" , + ret, cmnd->device->id, cmnd->device->lun);return SUCCESS ; }
@@ -3318,16 +3317,15 @@ lpfc_abort_handler(struct scsi_cmnd *cmnlpfc_printf_vlog (vport,KERN_ERR ,LOG_FCP ,"0748 abort handler timed out waiting " "for abort to complete: ret %#x, ID %d, " -"LUN %d, snum %#lx\n" , - ret, cmnd->device->id, cmnd->device->lun, - cmnd->serial_number); +"LUN %d\n" , + ret, cmnd->device->id, cmnd->device->lun); } out:lpfc_printf_vlog (vport,KERN_WARNING ,LOG_FCP ,"0749 SCSI Layer I/O Abort Request Status x%x ID %d " -"LUN %d snum %#lx\n" , ret, cmnd->device->id, - cmnd->device->lun, cmnd->serial_number); +"LUN %d\n" , ret, cmnd->device->id, + cmnd->device->lun);return ret; }
drivers/scsi/megaraid.c +10 -10
@@ -1469,8 +1469,8 @@ mega_cmd_done(adapter_t *adapter, u8 comif ( scb->state &SCB_ABORT ) {printk (KERN_WARNING -"megaraid: aborted cmd %lx[%x] complete.\n" , - scb->cmd->serial_number, scb->idx); +"megaraid: aborted cmd [%x] complete.\n" , + scb->idx); scb->cmd->result = (DID_ABORT <<16 );
@@ -1488,8 +1488,8 @@ mega_cmd_done(adapter_t *adapter, u8 comif ( scb->state &SCB_RESET ) {printk (KERN_WARNING -"megaraid: reset cmd %lx[%x] complete.\n" , - scb->cmd->serial_number, scb->idx); +"megaraid: reset cmd [%x] complete.\n" , + scb->idx); scb->cmd->result = (DID_RESET <<16 );
@@ -1958,8 +1958,8 @@ megaraid_abort_and_reset(adapter_t *adapstruct list_head *pos, *next;scb_t *scb; -printk (KERN_WARNING "megaraid: %s-%lx cmd=%x <c=%d t=%d l=%d>\n" , - (aor ==SCB_ABORT )?"ABORTING" :"RESET" , cmd->serial_number, +printk (KERN_WARNING "megaraid: %s cmd=%x <c=%d t=%d l=%d>\n" , + (aor ==SCB_ABORT )?"ABORTING" :"RESET" , cmd->cmnd[0 ], cmd->device->channel, cmd->device->id, cmd->device->lun);
@@ -1983,9 +1983,9 @@ megaraid_abort_and_reset(adapter_t *adapif ( scb->state &SCB_ISSUED ) {printk (KERN_WARNING -"megaraid: %s-%lx[%x], fw owner.\n" , +"megaraid: %s[%x], fw owner.\n" , (aor==SCB_ABORT ) ?"ABORTING" :"RESET" , - cmd->serial_number, scb->idx); + scb->idx);return FALSE; }
@@ -1996,9 +1996,9 @@ megaraid_abort_and_reset(adapter_t *adap* list */ printk (KERN_WARNING -"megaraid: %s-%lx[%x], driver owner.\n" , +"megaraid: %s-[%x], driver owner.\n" , (aor==SCB_ABORT ) ?"ABORTING" :"RESET" , - cmd->serial_number, scb->idx); + scb->idx);mega_free_scb (adapter, scb);
drivers/scsi/megaraid/megaraid_mbox.c +15 -22
@@ -2315,8 +2315,8 @@ megaraid_mbox_dpc(unsigned long devp)// Was an abort issued for this command earlier if (scb->state &SCB_ABORT ) {con_log (CL_ANN , (KERN_NOTICE -"megaraid: aborted cmd %lx[%x] completed\n" , - scp->serial_number, scb->sno)); +"megaraid: aborted cmd [%x] completed\n" , + scb->sno)); }/*
@@ -2472,8 +2472,8 @@ megaraid_abort_handler(struct scsi_cmnd raid_dev =ADAP2RAIDDEV (adapter);con_log (CL_ANN , (KERN_WARNING -"megaraid: aborting-%ld cmd=%x <c=%d t=%d l=%d>\n" , - scp->serial_number, scp->cmnd[0 ],SCP2CHANNEL (scp), +"megaraid: aborting cmd=%x <c=%d t=%d l=%d>\n" , + scp->cmnd[0 ],SCP2CHANNEL (scp),SCP2TARGET (scp),SCP2LUN (scp)));// If FW has stopped responding, simply return failure
@@ -2496,9 +2496,8 @@ megaraid_abort_handler(struct scsi_cmndlist_del_init (&scb->list);// from completed list con_log (CL_ANN , (KERN_WARNING -"megaraid: %ld:%d[%d:%d], abort from completed list\n" , - scp->serial_number, scb->sno, - scb->dev_channel, scb->dev_target)); +"megaraid: %d[%d:%d], abort from completed list\n" , + scb->sno, scb->dev_channel, scb->dev_target)); scp->result = (DID_ABORT <<16 ); scp->scsi_done (scp);
@@ -2527,9 +2526,8 @@ megaraid_abort_handler(struct scsi_cmndASSERT (!(scb->state &SCB_ISSUED ));con_log (CL_ANN , (KERN_WARNING -"megaraid abort: %ld[%d:%d], driver owner\n" , - scp->serial_number, scb->dev_channel, - scb->dev_target)); +"megaraid abort: [%d:%d], driver owner\n" , + scb->dev_channel, scb->dev_target)); scp->result = (DID_ABORT <<16 ); scp->scsi_done (scp);
@@ -2560,25 +2558,21 @@ megaraid_abort_handler(struct scsi_cmndif (!(scb->state &SCB_ISSUED )) {con_log (CL_ANN , (KERN_WARNING -"megaraid abort: %ld%d[%d:%d], invalid state\n" , - scp->serial_number, scb->sno, scb->dev_channel, - scb->dev_target)); +"megaraid abort: %d[%d:%d], invalid state\n" , + scb->sno, scb->dev_channel, scb->dev_target));BUG (); }else {con_log (CL_ANN , (KERN_WARNING -"megaraid abort: %ld:%d[%d:%d], fw owner\n" , - scp->serial_number, scb->sno, scb->dev_channel, - scb->dev_target)); +"megaraid abort: %d[%d:%d], fw owner\n" , + scb->sno, scb->dev_channel, scb->dev_target)); } } }spin_unlock_irq (&adapter->lock);if (!found) { -con_log (CL_ANN , (KERN_WARNING -"megaraid abort: scsi cmd:%ld, do now own\n" , - scp->serial_number)); +con_log (CL_ANN , (KERN_WARNING "megaraid abort: do now own\n" ));// FIXME: Should there be a callback for this command? return SUCCESS ;
@@ -2649,9 +2643,8 @@ megaraid_reset_handler(struct scsi_cmnd }else {if (scb->scp == scp) {// Found command con_log (CL_ANN , (KERN_WARNING -"megaraid: %ld:%d[%d:%d], reset from pending list\n" , - scp->serial_number, scb->sno, - scb->dev_channel, scb->dev_target)); +"megaraid: %d[%d:%d], reset from pending list\n" , + scb->sno, scb->dev_channel, scb->dev_target)); }else { con_log(CL_ANN, (KERN_WARNING "megaraid: IO packet with %d[%d:%d] being reset\n",
drivers/scsi/mesh.c +1 -2
@@ -415,8 +415,7 @@ static void mesh_start_cmd(struct mesh_s#if 1 if (DEBUG_TARGET (cmd)) {int i; -printk (KERN_DEBUG "mesh_start: %p ser=%lu tgt=%d cmd=" , - cmd, cmd->serial_number, id); +printk (KERN_DEBUG "mesh_start: %p tgt=%d cmd=" , cmd, id);for (i =0 ; i < cmd->cmd_len; ++i)printk (" %x" , cmd->cmnd[i]); printk(" use_sg=%d buffer=%p bufflen=%u\n",
drivers/scsi/ncr53c8xx.c +1 -1
@@ -8147,7 +8147,7 @@ static int ncr53c8xx_abort(struct scsi_cunsigned long flags;struct scsi_cmnd *done_list; -printk ("ncr53c8xx_abort: command pid %lu\n" , cmd->serial_number); +printk ("ncr53c8xx_abort\n" );NCR_LOCK_NCB (np, flags);
drivers/scsi/qla1280.c +1 -1
@@ -4066,7 +4066,7 @@ __qla1280_print_scsi_cmd(struct scsi_cmn} */ printk (" tag=%d, transfersize=0x%x \n" , cmd->tag, cmd->transfersize); -printk (" Pid=%li, SP=0x%p\n" , cmd->serial_number,CMD_SP (cmd)); +printk (" SP=0x%p\n" ,CMD_SP (cmd));printk (" underflow size = 0x%x, direction=0x%x\n" , cmd->underflow, cmd->sc_data_direction); }
drivers/scsi/qla4xxx/ql4_os.c +2 -3
@@ -2068,15 +2068,14 @@ static int qla4xxx_eh_abort(struct scsi_struct scsi_qla_host *ha =to_qla_host (cmd->device->host);unsigned int id = cmd->device->id;unsigned int lun = cmd->device->lun; -unsigned long serial = cmd->serial_number;unsigned long flags;struct srb *srb =NULL ;int ret =SUCCESS ;int wait =0 ;ql4_printk (KERN_INFO , ha, -"scsi%ld:%d:%d: Abort command issued cmd=%p, pid=%ld\n" , - ha->host_no, id, lun, cmd, serial); +"scsi%ld:%d:%d: Abort command issued cmd=%p\n" , + ha->host_no, id, lun, cmd);spin_lock_irqsave (&ha->hardware_lock, flags); srb = (struct srb *)CMD_SP (cmd);
drivers/scsi/tmscsim.c +10 -12
@@ -565,12 +565,12 @@ dc390_StartSCSI( struct dc390_acb* pACB, pDCB->TagMask |=1 << tag[1 ]; pSRB->TagNumber = tag[1 ];DC390_write8 (ScsiFifo, tag[1 ]); -DEBUG1 (printk (KERN_INFO "DC390: Select w/DisCn for Cmd %li (SRB %p), block tag %02x\n" , scmd->serial_number, pSRB, tag[1 ])); +DEBUG1 (printk (KERN_INFO "DC390: Select w/DisCn for SRB %p, block tag %02x\n" , pSRB, tag[1 ])); cmd =SEL_W_ATN3 ; }else {/* No TagQ */ //no_tag: -DEBUG1 (printk (KERN_INFO "DC390: Select w%s/DisCn for Cmd %li (SRB %p), No TagQ\n" , disc_allowed ?"" :"o" , scmd->serial_number, pSRB)); +DEBUG1 (printk (KERN_INFO "DC390: Select w%s/DisCn for SRB %p, No TagQ\n" , disc_allowed ?"" :"o" , pSRB)); } pSRB->SRBState =SRB_START_ ;
@@ -620,8 +620,8 @@ dc390_StartSCSI( struct dc390_acb* pACB,if (DC390_read8 (Scsi_Status) &INTERRUPT ) {dc390_freetag (pDCB, pSRB); -DEBUG0 (printk ("DC390: Interrupt during Start SCSI (pid %li, target %02i-%02i)\n" , - scmd->serial_number, scmd->device->id, scmd->device->lun)); +DEBUG0 (printk ("DC390: Interrupt during Start SCSI (target %02i-%02i)\n" , + scmd->device->id, scmd->device->lun)); pSRB->SRBState =SRB_READY ;//DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD); pACB->SelLost++;
@@ -1705,8 +1705,7 @@ dc390_SRBdone( struct dc390_acb* pACB, s status = pSRB->TargetStatus; -DEBUG0 (printk (" SRBdone (%02x,%08x), SRB %p, pid %li\n" , status, pcmd->result,\ - pSRB, pcmd->serial_number)); +DEBUG0 (printk (" SRBdone (%02x,%08x), SRB %p\n" , status, pcmd->result, pSRB));if (pSRB->SRBFlag &AUTO_REQSENSE ) {/* Last command was a Request Sense */ pSRB->SRBFlag &= ~AUTO_REQSENSE ;
@@ -1727,7 +1726,7 @@ dc390_SRBdone( struct dc390_acb* pACB, s }else {SET_RES_DRV (pcmd->result,DRIVER_SENSE );//pSRB->ScsiCmdLen = (u8) (pSRB->Segment1[0] >> 8); -DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n" , pcmd->serial_number, pcmd->cmnd[0 ], pcmd->device->id, pcmd->device->lun)); +DEBUG0 (printk ("DC390: RETRY (%02x), target %02i-%02i\n" , pcmd->cmnd[0 ], pcmd->device->id, pcmd->device->lun)); pSRB->TotalXferredLen =0 ;SET_RES_DID (pcmd->result,DID_SOFT_ERROR ); }
@@ -1747,7 +1746,7 @@ dc390_SRBdone( struct dc390_acb* pACB, selse if (status ==SAM_STAT_TASK_SET_FULL ) {scsi_track_queue_full (pcmd->device, pDCB->GoingSRBCnt -1 ); -DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n" , pcmd->serial_number, pcmd->cmnd[0 ], pcmd->device->id, pcmd->device->lun)); +DEBUG0 (printk ("DC390: RETRY (%02x), target %02i-%02i\n" , pcmd->cmnd[0 ], pcmd->device->id, pcmd->device->lun)); pSRB->TotalXferredLen =0 ;SET_RES_DID (pcmd->result,DID_SOFT_ERROR ); }
@@ -1801,7 +1800,7 @@ cmd_done:/* Add to free list */ dc390_Free_insert (pACB, pSRB); -DEBUG0 (printk (KERN_DEBUG "DC390: SRBdone: done pid %li\n" , pcmd->serial_number)); +DEBUG0 (printk (KERN_DEBUG "DC390: SRBdone: done\n" )); pcmd->scsi_done (pcmd);return ;
@@ -1997,8 +1996,7 @@ static int DC390_abort(struct scsi_cmndstruct dc390_acb *pACB = (struct dc390_acb *) cmd->device->host->hostdata;struct dc390_dcb *pDCB = (struct dc390_dcb *) cmd->device->hostdata; -scmd_printk (KERN_WARNING , cmd, -"DC390: Abort command (pid %li)\n" , cmd->serial_number); +scmd_printk (KERN_WARNING , cmd,"DC390: Abort command\n" );/* abort() is too stupid for already sent commands at the moment. * If it's called we are in trouble anyway, so let's dump some info
@@ -2006,7 +2004,7 @@ static int DC390_abort(struct scsi_cmnddc390_dumpinfo (pACB, pDCB,NULL ); pDCB->DCBFlag |=ABORT_DEV_ ; -printk (KERN_INFO "DC390: Aborted pid %li\n" , cmd->serial_number); +printk (KERN_INFO "DC390: Aborted.\n" );return FAILED ; }
drivers/scsi/megaraid/megaraid_sas_base.c +6 -7
@@ -1751,10 +1751,9 @@ static int megasas_wait_for_outstanding(list_del_init (&reset_cmd->list);if (reset_cmd->scmd) { reset_cmd->scmd->result =DID_RESET <<16 ; -printk (KERN_NOTICE "%d:%p reset [%02x], %#lx\n" , +printk (KERN_NOTICE "%d:%p reset [%02x]\n" , reset_index, reset_cmd, - reset_cmd->scmd->cmnd[0 ], - reset_cmd->scmd->serial_number); + reset_cmd->scmd->cmnd[0 ]); reset_cmd->scmd->scsi_done (reset_cmd->scmd);megasas_return_cmd (instance, reset_cmd);
@@ -1879,8 +1878,8 @@ static int megasas_generic_reset(struct instance = (struct megasas_instance *)scmd->device->host->hostdata; -scmd_printk (KERN_NOTICE , scmd,"megasas: RESET -%ld cmd=%x retries=%x\n" , - scmd->serial_number, scmd->cmnd[0 ], scmd->retries); +scmd_printk (KERN_NOTICE , scmd,"megasas: RESET cmd=%x retries=%x\n" , + scmd->cmnd[0 ], scmd->retries);if (instance->adprecovery ==MEGASAS_HW_CRITICAL_ERROR ) { printk(KERN_ERR "megasas: cannot recover from previous reset "
@@ -2349,9 +2348,9 @@ megasas_issue_pending_cmds_again(struct cmd->frame_phys_addr , 0, instance->reg_set); }else if (cmd->scmd) { -printk (KERN_NOTICE "megasas: %p scsi cmd [%02x],%#lx" +printk (KERN_NOTICE "megasas: %p scsi cmd [%02x]" "detected on the internal queue, issue again.\n" , - cmd, cmd->scmd->cmnd[0 ], cmd->scmd->serial_number); + cmd, cmd->scmd->cmnd[0 ]);atomic_inc (&instance->fw_outstanding); instance->instancet->fire_cmd(instance,
PATCH 2/4 usb-storage: do not increment cmd->serial_number
In reply to Christoph HellwigThe isd200 sub-driver increments the command serial number despite not using it at all in it's routine for sending internal scsi commands. Remove the increment to prepare for removing the serial_number field.
drivers/usb/storage/isd200.c +0 -1
@@ -499,7 +499,6 @@ static int isd200_action( struct us_datamemset (&ata,0 ,sizeof (ata)); srb->cmnd = info->cmnd; srb->device = &srb_dev; - ++srb->serial_number; ata.generic.SignatureByte0 = info->ConfigData.ATAMajorCommand; ata.generic.SignatureByte1 = info->ConfigData.ATAMinorCommand;
PATCH 3/4 mpt2sas: do not check serial_number in the abort handler
In reply to Christoph HellwigThe SCSI midlayer stops all command processing when in error handling, which means there is no chance for command reuse when the abort handler is called.
drivers/scsi/mpt2sas/mpt2sas_scsih.c +1 -2
@@ -2133,8 +2133,7 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADswitch (type) {case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK : scmd_lookup =_scsih_scsi_lookup_get (ioc, smid_task); -if (scmd_lookup && (scmd_lookup->serial_number == - scmd->serial_number)) +if (scmd_lookup) rc =FAILED ;else rc =SUCCESS ;
RE: [PATCH 3/4] mpt2sas: do not check serial_number in the abort handler
sounds good
ACK
________________________________________
From: Christoph Hellwig [[email protected]]
Sent: Monday, April 04, 2011 7:42 AM
To: [email protected]
Cc: [email protected]; Moore, Eric
Subject: [PATCH 3/4] mpt2sas: do not check serial_number in the abort handler
The SCSI midlayer stops all command processing when in error handling, which means there is no chance for command reuse when the abort handler is called.
drivers/scsi/mpt2sas/mpt2sas_scsih.c 2011-04-04 06:25:24.592763544 -0700 renamed from drivers/scsi/mpt2sas/mpt2sas_scsih.c 2011-04-04 06:25:05.892763786 -0700 +1 -2
@@ -2133,8 +2133,7 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_AD switch (type) { case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK: scmd_lookup = _scsih_scsi_lookup_get(ioc, smid_task); - if (scmd_lookup && (scmd_lookup->serial_number == - scmd->serial_number)) + if (scmd_lookup) rc = FAILED; else rc = SUCCESS;
PATCH 4/4 fusion: do not check serial_number in the abort handler
In reply to Christoph HellwigThe SCSI midlayer stops all command processing when in error handling, which means there is no chance for command reuse when the abort handler is called.
drivers/message/fusion/mptscsih.c +3 -5
@@ -1773,7 +1773,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)int scpnt_idx;int retval;VirtDevice *vdevice; -ulong sn = SCpnt->serial_number;MPT_ADAPTER *ioc;/* If we can't locate our host adapter structure, return FAILED status.
@@ -1859,8 +1858,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) vdevice->vtarget->id, vdevice->lun, ctx2abort, mptscsih_get_tm_timeout(ioc)); -if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx && - SCpnt->serial_number == sn) { +if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx) {dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"task abort: command still in active list! (sc=%p)\n" , ioc->name, SCpnt));
@@ -1873,9 +1871,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) } out: -printk (MYIOC_s_INFO_FMT"task abort: %s (rv=%04x) (sc=%p) (sn=%ld)\n" , +printk (MYIOC_s_INFO_FMT"task abort: %s (rv=%04x) (sc=%p)\n" , ioc->name, ((retval ==SUCCESS ) ?"SUCCESS" :"FAILED" ), retval, - SCpnt, SCpnt->serial_number); + SCpnt);return retval; }
RE: [PATCH 4/4] fusion: do not check serial_number in the abort handler
Quoted 43 lines
-----Original Message-----
From: [email protected] [mailto:linux-scsi- [email protected]] On Behalf Of Christoph Hellwig
Sent: Monday, April 04, 2011 7:13 PM
To: [email protected]
Cc: [email protected]; Moore, Eric
Subject: [PATCH 4/4] fusion: do not checkserial_numberin the abort handlerThe SCSI midlayer stops all command processing when in error handling, which
means there is no chance for command reuse when the abort handler is called.Signed-off-by Christoph Hellwig <[email protected]>Index:
linux-2.6/drivers/message/fusion/mptscsih.c
===================================================================
---linux-2.6.orig/drivers/message/fusion/mptscsih.c2011-04-04
06:25:45.526096602 -0700
+++linux-2.6/drivers/message/fusion/mptscsih.c2011-04-04
06:26:07.036096337 -0700drivers/message/fusion/mptscsih.c +0
-1@@ -1773,7 +1773,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)int scpnt_idx;int retval;VirtDevice *vdevice; -ulong sn = SCpnt->serial_number;MPT_ADAPTER *ioc;/* If we can't locate our host adapter structure, return FAILED status.
drivers/message/fusion/mptscsih.c +1
-2@@ -1859,8 +1858,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) vdevice->vtarget->id, vdevice->lun, ctx2abort, mptscsih_get_tm_timeout(ioc)); -if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx && - SCpnt->serial_number == sn) { +if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx) {dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"task abort: command still in active list! (sc=%p)\n" , ioc->name, SCpnt));
drivers/message/fusion/mptscsih.c mptscsih_abort(struct scsi_cmnd * SCpnt) · line 1872
Quoted 2 lines
drivers/message/fusion/mptscsih.c +0
-0@@ -1873,9 +1871,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) }
This change looks good to me.!
drivers/message/fusion/mptscsih.c mptscsih_abort(struct scsi_cmnd * SCpnt) · line 1876
Quoted 8 lines
drivers/message/fusion/mptscsih.c +2
-2out: - printk(MYIOC_s_INFO_FMT "task abort: %s (rv=%04x) (sc=%p) (sn=%ld)\n", + printk(MYIOC_s_INFO_FMT"task abort: %s (rv=%04x) (sc=%p)\n" , ioc->name, ((retval ==SUCCESS ) ?"SUCCESS" :"FAILED" ), retval, - SCpnt, SCpnt->serial_number); + SCpnt);
Can't we keep serial_number print for debugging purpose. ?
Quoted 8 lines
drivers/message/fusion/mptscsih.c +0
-0return retval;}
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
James Bottomley
maintainerRE: [PATCH 4/4] fusion: do not check serial_number in the abort handler
Quoted 47 lines · Kashyap
Quoted 42 lines
-----Original Message-----
From: [email protected] [mailto:linux-scsi- [email protected]] On Behalf Of Christoph Hellwig
Sent: Monday, April 04, 2011 7:13 PM
To: [email protected]
Cc: [email protected]; Moore, Eric
Subject: [PATCH 4/4] fusion: do not checkserial_numberin the abort handlerThe SCSI midlayer stops all command processing when in error handling, which
means there is no chance for command reuse when the abort handler is called.Signed-off-by Christoph Hellwig <[email protected]>Index:
linux-2.6/drivers/message/fusion/mptscsih.c
===================================================================
---linux-2.6.orig/drivers/message/fusion/mptscsih.c2011-04-04
06:25:45.526096602 -0700
+++linux-2.6/drivers/message/fusion/mptscsih.c2011-04-04
06:26:07.036096337 -0700drivers/message/fusion/mptscsih.c +0
-1@@ -1773,7 +1773,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)int scpnt_idx;int retval;VirtDevice *vdevice; -ulong sn = SCpnt->serial_number;MPT_ADAPTER *ioc;/* If we can't locate our host adapter structure, return FAILED status.
drivers/message/fusion/mptscsih.c +1
-2@@ -1859,8 +1858,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) vdevice->vtarget->id, vdevice->lun, ctx2abort, mptscsih_get_tm_timeout(ioc)); -if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx && - SCpnt->serial_number == sn) { +if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx) {dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"task abort: command still in active list! (sc=%p)\n" , ioc->name, SCpnt));drivers/message/fusion/mptscsih.c mptscsih_abort(struct scsi_cmnd * SCpnt) · line 1872
Quoted 2 lines
drivers/message/fusion/mptscsih.c +0
-0@@ -1873,9 +1871,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) }This change looks good to me.!
Quoted 10 lines
drivers/message/fusion/mptscsih.c mptscsih_abort(struct scsi_cmnd * SCpnt) · line 1876
Quoted 8 lines
drivers/message/fusion/mptscsih.c +2
-2out: - printk(MYIOC_s_INFO_FMT "task abort: %s (rv=%04x) (sc=%p) (sn=%ld)\n", + printk(MYIOC_s_INFO_FMT"task abort: %s (rv=%04x) (sc=%p)\n" , ioc->name, ((retval ==SUCCESS ) ?"SUCCESS" :"FAILED" ), retval, - SCpnt, SCpnt->serial_number); + SCpnt);Can't we keep
serial_numberprint for debugging purpose. ?
There's no real point ... it's a useless number unrelated to anything else in the system (there's nothing you can really use it for in debugging).
Plus once all of these patches are through, we'll eliminate the serial number field from the host and command.
James
RE: [PATCH 4/4] fusion: do not check serial_number in the abort handler
Quoted 73 lines
-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Wednesday, May 25, 2011 8:49 PM
To: Desai, Kashyap
Cc: Christoph Hellwig; [email protected]; linux- [email protected]; Moore, Eric
Subject: RE: [PATCH 4/4] fusion: do not checkserial_numberin the abort handlerQuoted 7 lines · Kashyap
Quoted 7 lines
-----Original Message-----
From: [email protected] [mailto:linux-scsi- [email protected]] On Behalf Of Christoph Hellwig
Sent: Monday, April 04, 2011 7:13 PM
To: [email protected]
Cc: [email protected]; Moore, Eric
Subject: [PATCH 4/4] fusion: do not checkserial_numberin theabort
Quoted 3 lines
Quoted 3 lines
handler
The SCSI midlayer stops all command processing when in error
handling,
Quoted 2 lines
Quoted 2 lines
which
means there is no chance for command reuse when the abort handleris
Quoted 35 lines
Quoted 30 lines
called.
Signed-off-by Christoph Hellwig <[email protected]>Index:
linux-2.6/drivers/message/fusion/mptscsih.c
===================================================================
---linux-2.6.orig/drivers/message/fusion/mptscsih.c2011-04-04
06:25:45.526096602 -0700
+++linux-2.6/drivers/message/fusion/mptscsih.c2011-04-04
06:26:07.036096337 -0700drivers/message/fusion/mptscsih.c +0
-1@@ -1773,7 +1773,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)int scpnt_idx;int retval;VirtDevice *vdevice; -ulong sn = SCpnt->serial_number;MPT_ADAPTER *ioc;/* If we can't locate our host adapter structure, return FAILED status.
drivers/message/fusion/mptscsih.c +1
-2@@ -1859,8 +1858,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) vdevice->vtarget->id, vdevice->lun, ctx2abort, mptscsih_get_tm_timeout(ioc)); -if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx && - SCpnt->serial_number == sn) { +if (SCPNT_TO_LOOKUP_IDX (ioc, SCpnt) == scpnt_idx) {dtmprintk (ioc,printk (MYIOC_s_DEBUG_FMT"task abort: command still in active list! (sc=%p)\n" , ioc->name, SCpnt));drivers/message/fusion/mptscsih.c mptscsih_abort(struct scsi_cmnd * SCpnt) · line 1872
Quoted 2 lines
drivers/message/fusion/mptscsih.c +0
-0@@ -1873,9 +1871,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) }This change looks good to me.!
Quoted 10 lines
drivers/message/fusion/mptscsih.c mptscsih_abort(struct scsi_cmnd * SCpnt) · line 1876
Quoted 8 lines
drivers/message/fusion/mptscsih.c +2
-2out: - printk(MYIOC_s_INFO_FMT "task abort: %s (rv=%04x) (sc=%p) (sn=%ld)\n", + printk(MYIOC_s_INFO_FMT"task abort: %s (rv=%04x) (sc=%p)\n" , ioc->name, ((retval ==SUCCESS ) ?"SUCCESS" :"FAILED" ), retval, - SCpnt, SCpnt->serial_number); + SCpnt);Can't we keep
serial_numberprint for debugging purpose. ?
Quoted 6 lines
There's no real point ... it's a useless number unrelated to anything else in the system (there's nothing you can really use it for in debugging).
Plus once all of these patches are through, we'll eliminate the serial number field from the host and command.
James, Yes I understand your point. I went through other threads and found my argument is not valid..Thanks for bringing this to my notice. Consider this patch as Acked by me.
Quoted 3 lines
James