Commit a4f7980f authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[PATCH] PATCH [4/8] qla2xxx: 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: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 9a583e9f
......@@ -217,7 +217,9 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
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 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
rval = QLA_SUCCESS;
if (ha->flags.init_done)
return (rval);
/* Determine NVRAM starting address. */
ha->nvram_base = 0;
if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && !IS_QLA2300(ha))
......
......@@ -418,12 +418,9 @@ qla2x00_start_scsi(srb_t *sp)
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);
......
......@@ -969,7 +969,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
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 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
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;
......
......@@ -1582,12 +1582,8 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
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 (cmd->device->host->eh_active)
if (!qla2x00_eh_wait_for_pending_commands(ha))
rval = FAILED;
......@@ -1932,7 +1928,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
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 */
......@@ -2155,6 +2151,9 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
scsi_host_put(host);
probe_disable_device:
pci_disable_device(pdev);
return -1;
}
EXPORT_SYMBOL_GPL(qla2x00_probe_one);
......@@ -2223,6 +2222,8 @@ qla2x00_free_device(scsi_qla_host_t *ha)
/* 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);
......@@ -3231,9 +3232,6 @@ qla2x00_do_dpc(void *data)
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. */
......@@ -3244,6 +3242,9 @@ qla2x00_do_dpc(void *data)
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)) {
DEBUG(printk("scsi(%ld): DPC checking retry_q. "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment