PATCH [4/8] qla2xxx: Small fixes
Subsystems (2)
ChangeSet
1.1874 04/09/06 11:47:07 [email protected] +4 -0 Misc. small fixes:
o Always set an TCQ modifier for each command submitted.
o Always (re)-initialize NVRAM during execution.
o Add pci_disable_device() calls to proper locations during pci-probe failure and pci-remove.
o Do not begin processing until the DPC has been marked 'active'.
o Fix off-by-one error while copying sense-data.
o Fix bus-reset issue during back-door execution.
Signed-off-by Andrew Vasquez <[email protected]>
drivers/scsi/qla2xxx/qla_init.c | 7 +++---- drivers/scsi/qla2xxx/qla_iocb.c | 5 +---- drivers/scsi/qla2xxx/qla_isr.c | 4 ++-- drivers/scsi/qla2xxx/qla_os.c | 23 ++++++++++++----------- 4 files changed, 18 insertions(+), 21 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +3 -4
@@ -217,7 +217,9 @@ rval =QLA_FUNCTION_FAILED ;if (ha->mem_err) restart_risc =1 ; - } + }else if (ha->device_flags &DFLG_NO_CABLE ) +/* If no cable, then all is good. */ + rval =QLA_SUCCESS ; } }while (restart_risc && retry--);
@@ -1202,9 +1204,6 @@uint8_t timer_mode; rval =QLA_SUCCESS ; - -if (ha->flags.init_done) -return (rval);/* Determine NVRAM starting address. */ ha->nvram_base =0 ;
drivers/scsi/qla2xxx/qla_iocb.c +1 -4
@@ -418,12 +418,9 @@ cmd_pkt->lun =cpu_to_le16 (fclun->lun);/* Update tagged queuing modifier */ + cmd_pkt->control_flags =__constant_cpu_to_le16 (CF_SIMPLE_TAG );if (scsi_populate_tag_msg (cmd, tag)) {switch (tag[0 ]) { -case MSG_SIMPLE_TAG : - cmd_pkt->control_flags = -__constant_cpu_to_le16 (CF_SIMPLE_TAG ); -break ;case MSG_HEAD_TAG : cmd_pkt->control_flags =__constant_cpu_to_le16 (CF_HEAD_TAG );
drivers/scsi/qla2xxx/qla_isr.c +2 -2
@@ -969,7 +969,7 @@ sizeof(cp->sense_buffer)) sense_sz =le16_to_cpu (pkt->req_sense_length); else - sense_sz =sizeof (cp->sense_buffer) -1 ; + sense_sz =sizeof (cp->sense_buffer);CMD_ACTUAL_SNSLEN (cp) = sense_sz; sp->request_sense_length = sense_sz;
@@ -1039,7 +1039,7 @@ sizeof(cp->sense_buffer)) sense_sz =le16_to_cpu (pkt->req_sense_length); else - sense_sz =sizeof (cp->sense_buffer) -1 ; + sense_sz =sizeof (cp->sense_buffer);CMD_ACTUAL_SNSLEN (cp) = sense_sz; sp->request_sense_length = sense_sz;
drivers/scsi/qla2xxx/qla_os.c +12 -11
@@ -1583,14 +1583,10 @@if (rval ==FAILED ) goto out; -/* -* Blocking Call. It goes to sleep waiting for cmd to get to done q -* -* XXX(hch): really? We're under host_lock here.. -*/ /* Waiting for our command in done_queue to be returned to OS.*/ -if (!qla2x00_eh_wait_for_pending_commands (ha)) - rval =FAILED ; +if (cmd->device->host->eh_active) +if (!qla2x00_eh_wait_for_pending_commands (ha)) + rval =FAILED ; out: qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__,
@@ -1933,7 +1929,7 @@if (host ==NULL ) {printk (KERN_WARNING "qla2xxx: Couldn't allocate host from scsi layer!\n" ); -return -1 ; + goto probe_disable_device; }/* Clear our data area */
@@ -2157,6 +2153,9 @@scsi_host_put (host); +probe_disable_device: +pci_disable_device (pdev); +return -1 ; }EXPORT_SYMBOL_GPL (qla2x00_probe_one);
@@ -2225,6 +2224,8 @@/* release io space registers */ pci_release_regions (ha->pdev); +pci_disable_device (ha->pdev); +#if MEMORY_MAPPED_IO if (ha->mmio_address)iounmap (ha->mmio_address);
@@ -3243,9 +3244,6 @@if (ha->dpc_should_die)break ; -if (!list_empty (&ha->done_queue)) -qla2x00_done (ha); -DEBUG3 (printk ("qla2x00: DPC handler waking up\n" ));/* Initialization not yet finished. Don't do anything yet. */
@@ -3255,6 +3253,9 @@DEBUG3 (printk ("scsi(%ld): DPC handler\n" , ha->host_no)); ha->dpc_active =1 ; + +if (!list_empty (&ha->done_queue)) +qla2x00_done (ha);/* Process commands in retry queue */ if (test_and_clear_bit (PORT_RESTART_NEEDED , &ha->dpc_flags)) {