GIT 03c1c39680f949e0a944d540949b2d3d6887cdc0 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6.git commit Author: Andrew Vasquez Date: Wed Dec 13 19:20:33 2006 -0800 [SCSI] qla2xxx: Update version number to 8.01.07-k4. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 96ca5cad09edd86da9c8fd613c9406cdf978cd6d Author: Andrew Vasquez Date: Wed Dec 13 19:20:32 2006 -0800 [SCSI] qla2xxx: Use generic isp_ops.fw_dump() function. Rather than a direct call, as was done in the case of a RISC-paused state within the ISP24xx interrupt handler. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 07f31805e1fa98f802f60433cdd1c0461120ef0e Author: Andrew Vasquez Date: Wed Dec 13 19:20:31 2006 -0800 [SCSI] qla2xxx: Perform a fw-dump when an ISP23xx RISC-paused state is detected. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 0c8c39af1699227e5a5d13e54a71f93347fe4f61 Author: Andrew Vasquez Date: Wed Dec 13 19:20:30 2006 -0800 [SCSI] qla2xxx: Correct reset handling logic. - honor ISP24XX NVRAM settings for lip-reset, full-login-lip, and device-reset. - correct LIP_FULL_LOGIN mailbox command issuance. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 8bc69e7dc307d6195d92fa87da1fcbae6e5dda69 Author: Andrew Vasquez Date: Wed Dec 13 19:20:29 2006 -0800 [SCSI] qla2xxx: Correct IOCB queueing mechanism for ISP54XX HBAs. Original code would incorrectly use non-24xx code-paths. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 4346b14942dbb65e5d4fa7ec0e6567c39861ae6c Author: Andrew Vasquez Date: Wed Dec 13 19:20:28 2006 -0800 [SCSI] qla2xxx: Detect GPSC capabilities within a fabric. Disable subsequent GPSC queries if Fabric Management services do not support the operation. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 71ea9949a307e92fd5f8b4107814014464f38f91 Author: Andrew Vasquez Date: Wed Dec 13 19:20:27 2006 -0800 [SCSI] qla2xxx: Use proper prep_ms_iocb() function during GFPN_ID. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit cdfc82ade68ca11aafc900c56ef2be2b4aea8f58 Author: Andrew Vasquez Date: Wed Dec 13 19:20:26 2006 -0800 [SCSI] qla2xxx: Correct endianess issue while interrogating MS status. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 87b2380fcc6ff97c6ff5afd66ff50e94e6188d6b Author: Andrew Vasquez Date: Wed Dec 13 19:20:25 2006 -0800 [SCSI] qla2xxx: Don't log trace-control async-events. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley commit 9ef3c10e2009d8479b27e3ff39a7779fbca5711c Author: James Bottomley Date: Wed Dec 13 09:19:49 2006 -0600 [SCSI] seagate: remove BROKEN tag Apparently the driver compiles and runs, so tidy up some macro warnings and bring it back as unBROKEN. Signed-off-by: James Bottomley commit 4ed381ee559ebfab32d3b21896c204992c36179a Author: James Bottomley Date: Mon Dec 11 09:47:06 2006 -0600 [SCSI] scsi_transport_spi: fix sense buffer size error The code does this: unsigned char sense[SCSI_SENSE_BUFFERSIZE]; ... scsi_normalize_sense(sense, sizeof(*sense), sshdr) however the sizeof will return 1 not 96 which means the sense data will have no valid ASC/ASCQ values. Fix by putting the correct sense size. The only affected case for this would have been the DV buffer sanity check failure, which is fortunately quite rare. Signed-off-by: James Bottomley commit 8bcc24127be12967588db0ad0e614be937ee1d5a Author: Matthew Wilcox Date: Thu Dec 7 19:29:27 2006 -0700 [SCSI] Add missing completion to scsi_complete_async_scans() If either scsi_complete_async_scans() is called a second time before the first call has finished, or a host scan is started while scsi_complete_async_scans() is still sleeping, it would fail to wake up the other task, which would sleep forever. I've changed the kernel-doc to make it clear that scsi_complete_async_scans() only guarantees that scans which started before it was called are guaranteed to have finished when it returns. I considered making it wait until all scans are completed, but it can't guarantee that no more scans will start before it returns anyway, and it runs the risk of confusing other callers of scsi_complete_async_scans() for hosts actually scanning. Signed-off-by: Matthew Wilcox Signed-off-by: James Bottomley commit 23be331d9e5077edf07d73813f870d3b895c8593 Author: Adrian Bunk Date: Fri Nov 24 02:46:01 2006 +0100 [SCSI] qla2xxx: make qla2x00_reg_remote_port() static Signed-off-by: Adrian Bunk Acked-by: Andrew Vasquez Signed-off-by: James Bottomley commit d8dafd8ccde06f16095234dc3addf52b511805b3 Author: Randy Dunlap Date: Tue Nov 21 13:50:47 2006 -0800 [SCSI] advansys: wrap PCI table inside ifdef CONFIG_PCI The Advansys ISA/EISA/PCI driver has a compile error when CONFIG_PCI=n, so wrap the pci_device_id table inside ifdef CONFIG_PCI. drivers/scsi/advansys.c: At top level: drivers/scsi/advansys.c:18219: error: array type has incomplete element type drivers/scsi/advansys.c:18221: error: 'PCI_ANY_ID' undeclared here (not in a function) make[2]: *** [drivers/scsi/advansys.o] Error 1 make[1]: *** [drivers/scsi] Error 2 make: *** [drivers] Error 2 Signed-off-by: Randy Dunlap Signed-off-by: James Bottomley drivers/scsi/Kconfig | 2 - drivers/scsi/advansys.c | 3 + drivers/scsi/qla2xxx/qla_def.h | 2 + drivers/scsi/qla2xxx/qla_gbl.h | 1 drivers/scsi/qla2xxx/qla_gs.c | 24 +++++++++-- drivers/scsi/qla2xxx/qla_init.c | 76 ++++++++++++++++++------------------ drivers/scsi/qla2xxx/qla_isr.c | 15 ++++--- drivers/scsi/qla2xxx/qla_mbx.c | 12 +++--- drivers/scsi/qla2xxx/qla_os.c | 59 +++++++++++++++------------- drivers/scsi/qla2xxx/qla_version.h | 2 - drivers/scsi/scsi_scan.c | 15 ++++--- drivers/scsi/scsi_transport_spi.c | 2 - drivers/scsi/seagate.c | 5 +- 13 files changed, 123 insertions(+), 95 deletions(-) diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 60f5827..7869c34 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -1303,7 +1303,7 @@ config SCSI_LPFC config SCSI_SEAGATE tristate "Seagate ST-02 and Future Domain TMC-8xx SCSI support" - depends on X86 && ISA && SCSI && BROKEN + depends on X86 && ISA && SCSI ---help--- These are 8-bit SCSI controllers; the ST-01 is also supported by this driver. It is explained in section 3.9 of the SCSI-HOWTO, diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 2b34435..306bec3 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -18215,6 +18215,7 @@ AdvInquiryHandling( } MODULE_LICENSE("Dual BSD/GPL"); +#ifdef CONFIG_PCI /* PCI Devices supported by this driver */ static struct pci_device_id advansys_pci_tbl[] __devinitdata = { { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A, @@ -18232,4 +18233,4 @@ static struct pci_device_id advansys_pci { } }; MODULE_DEVICE_TABLE(pci, advansys_pci_tbl); - +#endif /* CONFIG_PCI */ diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c4fc40f..2c10130 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1602,6 +1602,7 @@ #define FC_NO_LOOP_ID 0x1000 #define CT_REJECT_RESPONSE 0x8001 #define CT_ACCEPT_RESPONSE 0x8002 +#define CT_REASON_INVALID_COMMAND_CODE 0x01 #define CT_REASON_CANNOT_PERFORM 0x09 #define CT_EXPL_ALREADY_REGISTERED 0x10 @@ -2079,6 +2080,7 @@ typedef struct scsi_qla_host { uint32_t msi_enabled :1; uint32_t msix_enabled :1; uint32_t disable_serdes :1; + uint32_t gpsc_supported :1; } flags; atomic_t loop_state; diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 32ebeec..e4dd12f 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -45,7 +45,6 @@ extern void qla2x00_update_fcports(scsi_ extern int qla2x00_abort_isp(scsi_qla_host_t *); extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *); -extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *); extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *); extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 97fbc62..ec5b2dd 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -127,8 +127,8 @@ qla2x00_chk_ms_status(scsi_qla_host_t *h ha->host_no, routine, ms_pkt->entry_status)); } else { if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) - comp_status = - ((struct ct_entry_24xx *)ms_pkt)->comp_status; + comp_status = le16_to_cpu( + ((struct ct_entry_24xx *)ms_pkt)->comp_status); else comp_status = le16_to_cpu(ms_pkt->status); switch (comp_status) { @@ -143,6 +143,7 @@ qla2x00_chk_ms_status(scsi_qla_host_t *h DEBUG2_3(qla2x00_dump_buffer( (uint8_t *)&ct_rsp->header, sizeof(struct ct_rsp_hdr))); + rval = QLA_INVALID_COMMAND; } else rval = QLA_SUCCESS; break; @@ -1683,7 +1684,7 @@ qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_ memset(list[i].fabric_port_name, 0, WWN_SIZE); /* Prepare common MS IOCB */ - ms_pkt = qla2x00_prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, + ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, GFPN_ID_RSP_SIZE); /* Prepare CT request */ @@ -1784,6 +1785,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_inf if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) return QLA_FUNCTION_FAILED; + if (!ha->flags.gpsc_supported) + return QLA_FUNCTION_FAILED; rval = qla2x00_mgmt_svr_login(ha); if (rval) @@ -1813,8 +1816,19 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_inf /*EMPTY*/ DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB " "failed (%d).\n", ha->host_no, rval)); - } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, - "GPSC") != QLA_SUCCESS) { + } else if ((rval = qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, + "GPSC")) != QLA_SUCCESS) { + /* FM command unsupported? */ + if (rval == QLA_INVALID_COMMAND && + ct_rsp->header.reason_code == + CT_REASON_INVALID_COMMAND_CODE) { + DEBUG2(printk("scsi(%ld): GPSC command " + "unsupported, disabling query...\n", + ha->host_no)); + ha->flags.gpsc_supported = 0; + rval = QLA_FUNCTION_FAILED; + break; + } rval = QLA_FUNCTION_FAILED; } else { /* Save portname */ diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a823f0b..b3dac26 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -2103,40 +2103,7 @@ #define LS_UNKNOWN 2 } } -/* - * qla2x00_update_fcport - * Updates device on list. - * - * Input: - * ha = adapter block pointer. - * fcport = port structure pointer. - * - * Return: - * 0 - Success - * BIT_0 - error - * - * Context: - * Kernel context. - */ -void -qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) -{ - fcport->ha = ha; - fcport->login_retry = 0; - fcport->port_login_retry_count = ha->port_down_retry_count * - PORT_RETRY_TIME; - atomic_set(&fcport->port_down_timer, ha->port_down_retry_count * - PORT_RETRY_TIME); - fcport->flags &= ~FCF_LOGIN_NEEDED; - - qla2x00_iidma_fcport(ha, fcport); - - atomic_set(&fcport->state, FCS_ONLINE); - - qla2x00_reg_remote_port(ha, fcport); -} - -void +static void qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) { struct fc_rport_identifiers rport_ids; @@ -2179,6 +2146,39 @@ qla2x00_reg_remote_port(scsi_qla_host_t } /* + * qla2x00_update_fcport + * Updates device on list. + * + * Input: + * ha = adapter block pointer. + * fcport = port structure pointer. + * + * Return: + * 0 - Success + * BIT_0 - error + * + * Context: + * Kernel context. + */ +void +qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) +{ + fcport->ha = ha; + fcport->login_retry = 0; + fcport->port_login_retry_count = ha->port_down_retry_count * + PORT_RETRY_TIME; + atomic_set(&fcport->port_down_timer, ha->port_down_retry_count * + PORT_RETRY_TIME); + fcport->flags &= ~FCF_LOGIN_NEEDED; + + qla2x00_iidma_fcport(ha, fcport); + + atomic_set(&fcport->state, FCS_ONLINE); + + qla2x00_reg_remote_port(ha, fcport); +} + +/* * qla2x00_configure_fabric * Setup SNS devices with loop ID's. * @@ -3476,9 +3476,11 @@ qla24xx_nvram_config(scsi_qla_host_t *ha /* Set host adapter parameters. */ ha->flags.disable_risc_code_load = 0; - ha->flags.enable_lip_reset = 1; - ha->flags.enable_lip_full_login = 1; - ha->flags.enable_target_reset = 1; + ha->flags.enable_lip_reset = 0; + ha->flags.enable_lip_full_login = + le32_to_cpu(nv->host_p) & BIT_10 ? 1: 0; + ha->flags.enable_target_reset = + le32_to_cpu(nv->host_p) & BIT_11 ? 1: 0; ha->flags.enable_led_scheme = 0; ha->flags.disable_serdes = le32_to_cpu(nv->host_p) & BIT_5 ? 1: 0; diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index d3b6df4..39fd17b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -134,11 +134,11 @@ qla2300_intr_handler(int irq, void *dev_ if (stat & HSR_RISC_PAUSED) { hccr = RD_REG_WORD(®->hccr); if (hccr & (BIT_15 | BIT_13 | BIT_11 | BIT_8)) - qla_printk(KERN_INFO, ha, - "Parity error -- HCCR=%x.\n", hccr); + qla_printk(KERN_INFO, ha, "Parity error -- " + "HCCR=%x, Dumping firmware!\n", hccr); else - qla_printk(KERN_INFO, ha, - "RISC paused -- HCCR=%x.\n", hccr); + qla_printk(KERN_INFO, ha, "RISC paused -- " + "HCCR=%x, Dumping firmware!\n", hccr); /* * Issue a "HARD" reset in order for the RISC @@ -147,6 +147,8 @@ qla2300_intr_handler(int irq, void *dev_ */ WRT_REG_WORD(®->hccr, HCCR_RESET_RISC); RD_REG_WORD(®->hccr); + + ha->isp_ops.fw_dump(ha, 1); set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); break; } else if ((stat & HSR_RISC_INT) == 0) @@ -475,6 +477,8 @@ #define LS_UNKNOWN 2 set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); } set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); + + ha->flags.gpsc_supported = 1; break; case MBA_CHG_IN_CONNECTION: /* Change in connection mode */ @@ -1440,8 +1444,7 @@ qla24xx_intr_handler(int irq, void *dev_ qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " "Dumping firmware!\n", hccr); - qla24xx_fw_dump(ha, 1); - + ha->isp_ops.fw_dump(ha, 1); set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); break; } else if ((stat & HSRX_RISC_INT) == 0) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 4cde76c..077e578 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -1339,9 +1339,9 @@ qla2x00_lip_reset(scsi_qla_host_t *ha) if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { mcp->mb[0] = MBC_LIP_FULL_LOGIN; - mcp->mb[1] = BIT_0; - mcp->mb[2] = 0xff; - mcp->mb[3] = 0; + mcp->mb[1] = BIT_6; + mcp->mb[2] = 0; + mcp->mb[3] = ha->loop_reset_delay; mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; } else { mcp->mb[0] = MBC_LIP_RESET; @@ -1823,8 +1823,8 @@ qla2x00_full_login_lip(scsi_qla_host_t * ha->host_no)); mcp->mb[0] = MBC_LIP_FULL_LOGIN; - mcp->mb[1] = 0; - mcp->mb[2] = 0xff; + mcp->mb[1] = IS_QLA24XX(ha) || IS_QLA54XX(ha) ? BIT_3: 0; + mcp->mb[2] = 0; mcp->mb[3] = 0; mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; mcp->in_mb = MBX_0; @@ -2486,7 +2486,7 @@ qla2x00_trace_control(scsi_qla_host_t *h mcp->mb[4] = LSW(MSD(eft_dma)); mcp->mb[5] = MSW(MSD(eft_dma)); mcp->mb[6] = buffers; - mcp->mb[7] = buffers; + mcp->mb[7] = 0; mcp->out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2; } mcp->tov = 30; diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index d03523d..d6445ae 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1037,48 +1037,49 @@ eh_host_reset_lock: static int qla2x00_loop_reset(scsi_qla_host_t *ha) { - int status = QLA_SUCCESS; + int ret; struct fc_port *fcport; + if (ha->flags.enable_lip_full_login) { + ret = qla2x00_full_login_lip(ha); + if (ret != QLA_SUCCESS) { + DEBUG2_3(printk("%s(%ld): bus_reset failed: " + "full_login_lip=%d.\n", __func__, ha->host_no, + ret)); + } + atomic_set(&ha->loop_state, LOOP_DOWN); + atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); + qla2x00_mark_all_devices_lost(ha, 0); + qla2x00_wait_for_loop_ready(ha); + } + if (ha->flags.enable_lip_reset) { - status = qla2x00_lip_reset(ha); + ret = qla2x00_lip_reset(ha); + if (ret != QLA_SUCCESS) { + DEBUG2_3(printk("%s(%ld): bus_reset failed: " + "lip_reset=%d.\n", __func__, ha->host_no, ret)); + } + qla2x00_wait_for_loop_ready(ha); } - if (status == QLA_SUCCESS && ha->flags.enable_target_reset) { + if (ha->flags.enable_target_reset) { list_for_each_entry(fcport, &ha->fcports, list) { if (fcport->port_type != FCT_TARGET) continue; - status = qla2x00_device_reset(ha, fcport); - if (status != QLA_SUCCESS) - break; + ret = qla2x00_device_reset(ha, fcport); + if (ret != QLA_SUCCESS) { + DEBUG2_3(printk("%s(%ld): bus_reset failed: " + "target_reset=%d d_id=%x.\n", __func__, + ha->host_no, ret, fcport->d_id.b24)); + } } } - if (status == QLA_SUCCESS && - ((!ha->flags.enable_target_reset && - !ha->flags.enable_lip_reset) || - ha->flags.enable_lip_full_login)) { - - status = qla2x00_full_login_lip(ha); - } - /* Issue marker command only when we are going to start the I/O */ ha->marker_needed = 1; - if (status) { - /* Empty */ - DEBUG2_3(printk("%s(%ld): **** FAILED ****\n", - __func__, - ha->host_no)); - } else { - /* Empty */ - DEBUG3(printk("%s(%ld): exiting normally.\n", - __func__, - ha->host_no)); - } - - return(status); + return QLA_SUCCESS; } /* @@ -1413,7 +1414,9 @@ qla2x00_probe_one(struct pci_dev *pdev, sht = &qla2x00_driver_template; if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || - pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432) + pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432 || + pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5422 || + pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5432) sht = &qla24xx_driver_template; host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); if (host == NULL) { diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 1fa0bce..459e0d6 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.01.07-k3" +#define QLA2XXX_VERSION "8.01.07-k4" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 14e635a..1322831 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -133,12 +133,10 @@ struct async_scan_data { /** * scsi_complete_async_scans - Wait for asynchronous scans to complete * - * Asynchronous scans add themselves to the scanning_hosts list. Once - * that list is empty, we know that the scans are complete. Rather than - * waking up periodically to check the state of the list, we pretend to be - * a scanning task by adding ourselves at the end of the list and going to - * sleep. When the task before us wakes us up, we take ourselves off the - * list and return. + * When this function returns, any host which started scanning before + * this function was called will have finished its scan. Hosts which + * started scanning after this function was called may or may not have + * finished. */ int scsi_complete_async_scans(void) { @@ -171,6 +169,11 @@ int scsi_complete_async_scans(void) spin_lock(&async_scan_lock); list_del(&data->list); + if (!list_empty(&scanning_hosts)) { + struct async_scan_data *next = list_entry(scanning_hosts.next, + struct async_scan_data, list); + complete(&next->prev_finished); + } done: spin_unlock(&async_scan_lock); diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 3fded48..014d7fe 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -122,7 +122,7 @@ static int spi_execute(struct scsi_devic if (!sshdr) sshdr = &sshdr_tmp; - if (scsi_normalize_sense(sense, sizeof(*sense), + if (scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE, sshdr) && sshdr->sense_key == UNIT_ATTENTION) continue; diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c index 5ffec27..ff62e97 100644 --- a/drivers/scsi/seagate.c +++ b/drivers/scsi/seagate.c @@ -114,6 +114,7 @@ #ifdef DEBUG #define DPRINTK( when, msg... ) do { if ( (DEBUG & (when)) == (when) ) printk( msg ); } while (0) #else #define DPRINTK( when, msg... ) do { } while (0) +#define DEBUG 0 #endif #define DANY( msg... ) DPRINTK( 0xffff, msg ); @@ -523,7 +524,7 @@ #endif #ifdef ARBITRATE " ARBITRATE" #endif -#ifdef DEBUG +#if DEBUG " DEBUG" #endif #ifdef FAST @@ -733,7 +734,7 @@ static int internal_command (unsigned ch unsigned char *data = NULL; struct scatterlist *buffer = NULL; int clock, temp, nobuffs = 0, done = 0, len = 0; -#ifdef DEBUG +#if DEBUG int transfered = 0, phase = 0, newphase; #endif register unsigned char status_read;