Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
[SCSI] qla2xxx: Update version number to 8.02.01-k4.
[SCSI] qla2xxx: Correct handling of AENs postings for vports.
[SCSI] qla2xxx: Revert "qla2xxx: Use proper HA during asynchronous event handling."
[SCSI] ibmvscsi: Non SCSI error status fixup
[SCSI] fusion mpt: fix target missing after resetting external raid
[SCSI] fix intermittent oops in scsi_bus_uevent
[SCSI] qla2xxx: Update version number to 8.02.01-k3.
[SCSI] qla2xxx: Revert "qla2xxx: Validate mid-layer 'underflow' during check-condition handling."
[SCSI] qla2xxx: Disable local-interrupts while polling for RISC status.
[SCSI] qla2xxx: Extend the 'fw_dump' SYSFS node the ability to initiate a firmware dump.
[SCSI] qla2xxx: Don't depend on mailbox return values while enabling FCE tracing.
[SCSI] qla2xxx: Convert vport_sem to a mutex
[SCSI] qla2xxx: firmware semaphore to mutex
[SCSI] qla2xxx: Correct locking within MSI-X interrupt handlers.
[SCSI] qla2xxx: Display driver version at module init-time.
[SCSI] qla2xxx: Return correct port_type to FC-transport for Vports.

+73 -99
-2
drivers/message/fusion/mptfc.c
··· 1238 sh->max_id = ioc->pfacts->MaxDevices; 1239 sh->max_lun = max_lun; 1240 1241 - sh->this_id = ioc->pfacts[0].PortSCSIID; 1242 - 1243 /* Required entry. 1244 */ 1245 sh->unique_id = ioc->id;
··· 1238 sh->max_id = ioc->pfacts->MaxDevices; 1239 sh->max_lun = max_lun; 1240 1241 /* Required entry. 1242 */ 1243 sh->unique_id = ioc->id;
-2
drivers/message/fusion/mptsas.c
··· 3193 3194 sh->transportt = mptsas_transport_template; 3195 3196 - sh->this_id = ioc->pfacts[0].PortSCSIID; 3197 - 3198 /* Required entry. 3199 */ 3200 sh->unique_id = ioc->id;
··· 3193 3194 sh->transportt = mptsas_transport_template; 3195 3196 /* Required entry. 3197 */ 3198 sh->unique_id = ioc->id;
-8
drivers/message/fusion/mptscsih.c
··· 2451 ioc->name, sdev->sdtr, sdev->wdtr, 2452 sdev->ppr, sdev->inquiry_len)); 2453 2454 - if (sdev->id > sh->max_id) { 2455 - /* error case, should never happen */ 2456 - scsi_adjust_queue_depth(sdev, 0, 1); 2457 - goto slave_configure_exit; 2458 - } 2459 - 2460 vdevice->configured_lun = 1; 2461 mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH); 2462 ··· 2463 "negoFlags=%x, maxOffset=%x, SyncFactor=%x\n", 2464 ioc->name, vtarget->negoFlags, vtarget->maxOffset, 2465 vtarget->minSyncFactor)); 2466 - 2467 - slave_configure_exit: 2468 2469 dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2470 "tagged %d, simple %d, ordered %d\n",
··· 2451 ioc->name, sdev->sdtr, sdev->wdtr, 2452 sdev->ppr, sdev->inquiry_len)); 2453 2454 vdevice->configured_lun = 1; 2455 mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH); 2456 ··· 2469 "negoFlags=%x, maxOffset=%x, SyncFactor=%x\n", 2470 ioc->name, vtarget->negoFlags, vtarget->maxOffset, 2471 vtarget->minSyncFactor)); 2472 2473 dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2474 "tagged %d, simple %d, ordered %d\n",
+1 -1
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 1348 1349 del_timer(&evt_struct->timer); 1350 1351 - if (crq->status != VIOSRP_OK && evt_struct->cmnd) 1352 evt_struct->cmnd->result = DID_ERROR << 16; 1353 if (evt_struct->done) 1354 evt_struct->done(evt_struct);
··· 1348 1349 del_timer(&evt_struct->timer); 1350 1351 + if ((crq->status != VIOSRP_OK && crq->status != VIOSRP_OK2) && evt_struct->cmnd) 1352 evt_struct->cmnd->result = DID_ERROR << 16; 1353 if (evt_struct->done) 1354 evt_struct->done(evt_struct);
+2 -1
drivers/scsi/ibmvscsi/viosrp.h
··· 65 VIOSRP_VIOLATES_MAX_XFER = 0x2, 66 VIOSRP_PARTNER_PANIC = 0x3, 67 VIOSRP_DEVICE_BUSY = 0x8, 68 - VIOSRP_ADAPTER_FAIL = 0x10 69 }; 70 71 struct viosrp_crq {
··· 65 VIOSRP_VIOLATES_MAX_XFER = 0x2, 66 VIOSRP_PARTNER_PANIC = 0x3, 67 VIOSRP_DEVICE_BUSY = 0x8, 68 + VIOSRP_ADAPTER_FAIL = 0x10, 69 + VIOSRP_OK2 = 0x99, 70 }; 71 72 struct viosrp_crq {
+10 -3
drivers/scsi/qla2xxx/qla_attr.c
··· 70 case 2: 71 qla2x00_alloc_fw_dump(ha); 72 break; 73 } 74 return (count); 75 } ··· 889 static void 890 qla2x00_get_host_port_type(struct Scsi_Host *shost) 891 { 892 - scsi_qla_host_t *ha = to_qla_parent(shost_priv(shost)); 893 uint32_t port_type = FC_PORTTYPE_UNKNOWN; 894 895 switch (ha->current_topology) { 896 case ISP_CFG_NL: 897 port_type = FC_PORTTYPE_LPORT; ··· 1179 qla24xx_disable_vp(vha); 1180 qla24xx_deallocate_vp_id(vha); 1181 1182 - down(&ha->vport_sem); 1183 ha->cur_vport_count--; 1184 clear_bit(vha->vp_idx, ha->vp_idx_map); 1185 - up(&ha->vport_sem); 1186 1187 kfree(vha->node_name); 1188 kfree(vha->port_name);
··· 70 case 2: 71 qla2x00_alloc_fw_dump(ha); 72 break; 73 + case 3: 74 + qla2x00_system_error(ha); 75 + break; 76 } 77 return (count); 78 } ··· 886 static void 887 qla2x00_get_host_port_type(struct Scsi_Host *shost) 888 { 889 + scsi_qla_host_t *ha = shost_priv(shost); 890 uint32_t port_type = FC_PORTTYPE_UNKNOWN; 891 892 + if (ha->parent) { 893 + fc_host_port_type(shost) = FC_PORTTYPE_NPIV; 894 + return; 895 + } 896 switch (ha->current_topology) { 897 case ISP_CFG_NL: 898 port_type = FC_PORTTYPE_LPORT; ··· 1172 qla24xx_disable_vp(vha); 1173 qla24xx_deallocate_vp_id(vha); 1174 1175 + mutex_lock(&ha->vport_lock); 1176 ha->cur_vport_count--; 1177 clear_bit(vha->vp_idx, ha->vp_idx_map); 1178 + mutex_unlock(&ha->vport_lock); 1179 1180 kfree(vha->node_name); 1181 kfree(vha->port_name);
+1 -1
drivers/scsi/qla2xxx/qla_def.h
··· 2457 #define MBX_INTR_WAIT 2 2458 #define MBX_UPDATE_FLASH_ACTIVE 3 2459 2460 - struct semaphore vport_sem; /* Virtual port synchronization */ 2461 struct completion mbx_cmd_comp; /* Serialize mbx access */ 2462 struct completion mbx_intr_comp; /* Used for completion notification */ 2463
··· 2457 #define MBX_INTR_WAIT 2 2458 #define MBX_UPDATE_FLASH_ACTIVE 3 2459 2460 + struct mutex vport_lock; /* Virtual port synchronization */ 2461 struct completion mbx_cmd_comp; /* Serialize mbx access */ 2462 struct completion mbx_intr_comp; /* Used for completion notification */ 2463
+3
drivers/scsi/qla2xxx/qla_gbl.h
··· 228 extern int qla24xx_lun_reset(struct fc_port *, unsigned int); 229 230 extern int 231 qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t); 232 233 extern int
··· 228 extern int qla24xx_lun_reset(struct fc_port *, unsigned int); 229 230 extern int 231 + qla2x00_system_error(scsi_qla_host_t *); 232 + 233 + extern int 234 qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t); 235 236 extern int
+4
drivers/scsi/qla2xxx/qla_inline.h
··· 34 static inline void 35 qla2x00_poll(scsi_qla_host_t *ha) 36 { 37 ha->isp_ops->intr_handler(0, ha); 38 } 39 40 static __inline__ scsi_qla_host_t *
··· 34 static inline void 35 qla2x00_poll(scsi_qla_host_t *ha) 36 { 37 + unsigned long flags; 38 + 39 + local_irq_save(flags); 40 ha->isp_ops->intr_handler(0, ha); 41 + local_irq_restore(flags); 42 } 43 44 static __inline__ scsi_qla_host_t *
+14 -49
drivers/scsi/qla2xxx/qla_isr.c
··· 272 uint32_t rscn_entry, host_pid; 273 uint8_t rscn_queue_index; 274 unsigned long flags; 275 - scsi_qla_host_t *vha; 276 - int i; 277 278 /* Setup to process RIO completion. */ 279 handle_cnt = 0; ··· 542 break; 543 544 case MBA_PORT_UPDATE: /* Port database update */ 545 - if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { 546 - for_each_mapped_vp_idx(ha, i) { 547 - list_for_each_entry(vha, &ha->vp_list, 548 - vp_list) { 549 - if ((mb[3] & 0xff) 550 - == vha->vp_idx) { 551 - ha = vha; 552 - break; 553 - } 554 - } 555 - } 556 - } 557 /* 558 * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET 559 * event etc. earlier indicating loop is down) then process ··· 580 break; 581 582 case MBA_RSCN_UPDATE: /* State Change Registration */ 583 - if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { 584 - for_each_mapped_vp_idx(ha, i) { 585 - list_for_each_entry(vha, &ha->vp_list, 586 - vp_list) { 587 - if ((mb[3] & 0xff) 588 - == vha->vp_idx) { 589 - ha = vha; 590 - break; 591 - } 592 - } 593 - } 594 - } 595 596 DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", 597 ha->host_no)); ··· 1116 break; 1117 1118 qla2x00_handle_sense(sp, sense_data, sense_len); 1119 - 1120 - /* 1121 - * In case of a Underrun condition, set both the lscsi 1122 - * status and the completion status to appropriate 1123 - * values. 1124 - */ 1125 - if (resid && 1126 - ((unsigned)(scsi_bufflen(cp) - resid) < 1127 - cp->underflow)) { 1128 - DEBUG2(qla_printk(KERN_INFO, ha, 1129 - "scsi(%ld:%d:%d:%d): Mid-layer underflow " 1130 - "detected (%x of %x bytes)...returning " 1131 - "error status.\n", ha->host_no, 1132 - cp->device->channel, cp->device->id, 1133 - cp->device->lun, resid, 1134 - scsi_bufflen(cp))); 1135 - 1136 - cp->result = DID_ERROR << 16 | lscsi_status; 1137 - } 1138 } else { 1139 /* 1140 * If RISC reports underrun and target does not report ··· 1604 ha = dev_id; 1605 reg = &ha->iobase->isp24; 1606 1607 - spin_lock(&ha->hardware_lock); 1608 1609 qla24xx_process_response_queue(ha); 1610 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 1611 1612 - spin_unlock(&ha->hardware_lock); 1613 1614 return IRQ_HANDLED; 1615 } ··· 1628 reg = &ha->iobase->isp24; 1629 status = 0; 1630 1631 - spin_lock(&ha->hardware_lock); 1632 do { 1633 stat = RD_REG_DWORD(&reg->host_status); 1634 if (stat & HSRX_RISC_PAUSED) { ··· 1681 } 1682 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 1683 } while (0); 1684 - spin_unlock(&ha->hardware_lock); 1685 1686 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 1687 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
··· 272 uint32_t rscn_entry, host_pid; 273 uint8_t rscn_queue_index; 274 unsigned long flags; 275 276 /* Setup to process RIO completion. */ 277 handle_cnt = 0; ··· 544 break; 545 546 case MBA_PORT_UPDATE: /* Port database update */ 547 + /* Only handle SCNs for our Vport index. */ 548 + if (ha->parent && ha->vp_idx != (mb[3] & 0xff)) 549 + break; 550 + 551 /* 552 * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET 553 * event etc. earlier indicating loop is down) then process ··· 590 break; 591 592 case MBA_RSCN_UPDATE: /* State Change Registration */ 593 + /* Check if the Vport has issued a SCR */ 594 + if (ha->parent && test_bit(VP_SCR_NEEDED, &ha->vp_flags)) 595 + break; 596 + /* Only handle SCNs for our Vport index. */ 597 + if (ha->parent && ha->vp_idx != (mb[3] & 0xff)) 598 + break; 599 600 DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", 601 ha->host_no)); ··· 1132 break; 1133 1134 qla2x00_handle_sense(sp, sense_data, sense_len); 1135 } else { 1136 /* 1137 * If RISC reports underrun and target does not report ··· 1639 ha = dev_id; 1640 reg = &ha->iobase->isp24; 1641 1642 + spin_lock_irq(&ha->hardware_lock); 1643 1644 qla24xx_process_response_queue(ha); 1645 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 1646 1647 + spin_unlock_irq(&ha->hardware_lock); 1648 1649 return IRQ_HANDLED; 1650 } ··· 1663 reg = &ha->iobase->isp24; 1664 status = 0; 1665 1666 + spin_lock_irq(&ha->hardware_lock); 1667 do { 1668 stat = RD_REG_DWORD(&reg->host_status); 1669 if (stat & HSRX_RISC_PAUSED) { ··· 1716 } 1717 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 1718 } while (0); 1719 + spin_unlock_irq(&ha->hardware_lock); 1720 1721 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 1722 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
+4 -8
drivers/scsi/qla2xxx/qla_mbx.c
··· 2303 return __qla24xx_issue_tmf("Lun", TCF_LUN_RESET, fcport, l); 2304 } 2305 2306 - #if 0 2307 - 2308 int 2309 qla2x00_system_error(scsi_qla_host_t *ha) 2310 { ··· 2310 mbx_cmd_t mc; 2311 mbx_cmd_t *mcp = &mc; 2312 2313 - if (!IS_FWI2_CAPABLE(ha)) 2314 return QLA_FUNCTION_FAILED; 2315 2316 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); ··· 2331 2332 return rval; 2333 } 2334 - 2335 - #endif /* 0 */ 2336 2337 /** 2338 * qla2x00_set_serdes_params() - ··· 2504 if (mb) 2505 memcpy(mb, mcp->mb, 8 * sizeof(*mb)); 2506 if (dwords) 2507 - *dwords = mcp->mb[6]; 2508 } 2509 2510 return rval; ··· 2803 */ 2804 map = (vp_index - 1) / 8; 2805 pos = (vp_index - 1) & 7; 2806 - down(&ha->vport_sem); 2807 vce->vp_idx_map[map] |= 1 << pos; 2808 - up(&ha->vport_sem); 2809 2810 rval = qla2x00_issue_iocb(ha, vce, vce_dma, 0); 2811 if (rval != QLA_SUCCESS) {
··· 2303 return __qla24xx_issue_tmf("Lun", TCF_LUN_RESET, fcport, l); 2304 } 2305 2306 int 2307 qla2x00_system_error(scsi_qla_host_t *ha) 2308 { ··· 2312 mbx_cmd_t mc; 2313 mbx_cmd_t *mcp = &mc; 2314 2315 + if (!IS_QLA23XX(ha) && !IS_FWI2_CAPABLE(ha)) 2316 return QLA_FUNCTION_FAILED; 2317 2318 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); ··· 2333 2334 return rval; 2335 } 2336 2337 /** 2338 * qla2x00_set_serdes_params() - ··· 2508 if (mb) 2509 memcpy(mb, mcp->mb, 8 * sizeof(*mb)); 2510 if (dwords) 2511 + *dwords = buffers; 2512 } 2513 2514 return rval; ··· 2807 */ 2808 map = (vp_index - 1) / 8; 2809 pos = (vp_index - 1) & 7; 2810 + mutex_lock(&ha->vport_lock); 2811 vce->vp_idx_map[map] |= 1 << pos; 2812 + mutex_unlock(&ha->vport_lock); 2813 2814 rval = qla2x00_issue_iocb(ha, vce, vce_dma, 0); 2815 if (rval != QLA_SUCCESS) {
+10 -9
drivers/scsi/qla2xxx/qla_mid.c
··· 32 scsi_qla_host_t *ha = vha->parent; 33 34 /* Find an empty slot and assign an vp_id */ 35 - down(&ha->vport_sem); 36 vp_id = find_first_zero_bit(ha->vp_idx_map, ha->max_npiv_vports + 1); 37 if (vp_id > ha->max_npiv_vports) { 38 DEBUG15(printk ("vp_id %d is bigger than max-supported %d.\n", 39 vp_id, ha->max_npiv_vports)); 40 - up(&ha->vport_sem); 41 return vp_id; 42 } 43 ··· 45 ha->num_vhosts++; 46 vha->vp_idx = vp_id; 47 list_add_tail(&vha->vp_list, &ha->vp_list); 48 - up(&ha->vport_sem); 49 return vp_id; 50 } 51 ··· 55 uint16_t vp_id; 56 scsi_qla_host_t *ha = vha->parent; 57 58 - down(&ha->vport_sem); 59 vp_id = vha->vp_idx; 60 ha->num_vhosts--; 61 clear_bit(vp_id, ha->vp_idx_map); 62 list_del(&vha->vp_list); 63 - up(&ha->vport_sem); 64 } 65 66 static scsi_qla_host_t * ··· 145 } 146 147 /* Initialize the new vport unless it is a persistent port */ 148 - down(&ha->vport_sem); 149 ret = qla24xx_modify_vp_config(vha); 150 - up(&ha->vport_sem); 151 152 if (ret != QLA_SUCCESS) { 153 fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED); ··· 406 INIT_LIST_HEAD(&vha->list); 407 INIT_LIST_HEAD(&vha->fcports); 408 INIT_LIST_HEAD(&vha->vp_fcports); 409 410 vha->dpc_flags = 0L; 411 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); ··· 438 vha->flags.init_done = 1; 439 num_hosts++; 440 441 - down(&ha->vport_sem); 442 set_bit(vha->vp_idx, ha->vp_idx_map); 443 ha->cur_vport_count++; 444 - up(&ha->vport_sem); 445 446 return vha; 447
··· 32 scsi_qla_host_t *ha = vha->parent; 33 34 /* Find an empty slot and assign an vp_id */ 35 + mutex_lock(&ha->vport_lock); 36 vp_id = find_first_zero_bit(ha->vp_idx_map, ha->max_npiv_vports + 1); 37 if (vp_id > ha->max_npiv_vports) { 38 DEBUG15(printk ("vp_id %d is bigger than max-supported %d.\n", 39 vp_id, ha->max_npiv_vports)); 40 + mutex_unlock(&ha->vport_lock); 41 return vp_id; 42 } 43 ··· 45 ha->num_vhosts++; 46 vha->vp_idx = vp_id; 47 list_add_tail(&vha->vp_list, &ha->vp_list); 48 + mutex_unlock(&ha->vport_lock); 49 return vp_id; 50 } 51 ··· 55 uint16_t vp_id; 56 scsi_qla_host_t *ha = vha->parent; 57 58 + mutex_lock(&ha->vport_lock); 59 vp_id = vha->vp_idx; 60 ha->num_vhosts--; 61 clear_bit(vp_id, ha->vp_idx_map); 62 list_del(&vha->vp_list); 63 + mutex_unlock(&ha->vport_lock); 64 } 65 66 static scsi_qla_host_t * ··· 145 } 146 147 /* Initialize the new vport unless it is a persistent port */ 148 + mutex_lock(&ha->vport_lock); 149 ret = qla24xx_modify_vp_config(vha); 150 + mutex_unlock(&ha->vport_lock); 151 152 if (ret != QLA_SUCCESS) { 153 fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED); ··· 406 INIT_LIST_HEAD(&vha->list); 407 INIT_LIST_HEAD(&vha->fcports); 408 INIT_LIST_HEAD(&vha->vp_fcports); 409 + INIT_LIST_HEAD(&vha->work_list); 410 411 vha->dpc_flags = 0L; 412 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); ··· 437 vha->flags.init_done = 1; 438 num_hosts++; 439 440 + mutex_lock(&ha->vport_lock); 441 set_bit(vha->vp_idx, ha->vp_idx_map); 442 ha->cur_vport_count++; 443 + mutex_unlock(&ha->vport_lock); 444 445 return vha; 446
+17 -13
drivers/scsi/qla2xxx/qla_os.c
··· 10 #include <linux/vmalloc.h> 11 #include <linux/delay.h> 12 #include <linux/kthread.h> 13 14 #include <scsi/scsi_tcq.h> 15 #include <scsi/scsicam.h> ··· 1632 /* load the F/W, read paramaters, and init the H/W */ 1633 ha->instance = num_hosts; 1634 1635 - init_MUTEX(&ha->vport_sem); 1636 init_completion(&ha->mbx_cmd_comp); 1637 complete(&ha->mbx_cmd_comp); 1638 init_completion(&ha->mbx_intr_comp); ··· 2157 qla2x00_post_work(struct scsi_qla_host *ha, struct qla_work_evt *e, int locked) 2158 { 2159 unsigned long flags; 2160 2161 if (!locked) 2162 - spin_lock_irqsave(&ha->hardware_lock, flags); 2163 list_add_tail(&e->list, &ha->work_list); 2164 qla2xxx_wake_dpc(ha); 2165 if (!locked) 2166 - spin_unlock_irqrestore(&ha->hardware_lock, flags); 2167 return QLA_SUCCESS; 2168 } 2169 ··· 2204 qla2x00_do_work(struct scsi_qla_host *ha) 2205 { 2206 struct qla_work_evt *e; 2207 2208 - spin_lock_irq(&ha->hardware_lock); 2209 while (!list_empty(&ha->work_list)) { 2210 e = list_entry(ha->work_list.next, struct qla_work_evt, list); 2211 list_del_init(&e->list); 2212 - spin_unlock_irq(&ha->hardware_lock); 2213 2214 switch (e->type) { 2215 case QLA_EVT_AEN: ··· 2224 } 2225 if (e->flags & QLA_EVT_FLAG_FREE) 2226 kfree(e); 2227 - spin_lock_irq(&ha->hardware_lock); 2228 } 2229 - spin_unlock_irq(&ha->hardware_lock); 2230 } 2231 2232 /************************************************************************** ··· 2637 #define FW_FILE_ISP24XX "ql2400_fw.bin" 2638 #define FW_FILE_ISP25XX "ql2500_fw.bin" 2639 2640 - static DECLARE_MUTEX(qla_fw_lock); 2641 2642 static struct fw_blob qla_fw_blobs[FW_BLOBS] = { 2643 { .name = FW_FILE_ISP21XX, .segs = { 0x1000, 0 }, }, ··· 2668 blob = &qla_fw_blobs[FW_ISP25XX]; 2669 } 2670 2671 - down(&qla_fw_lock); 2672 if (blob->fw) 2673 goto out; 2674 ··· 2681 } 2682 2683 out: 2684 - up(&qla_fw_lock); 2685 return blob; 2686 } 2687 ··· 2690 { 2691 int idx; 2692 2693 - down(&qla_fw_lock); 2694 for (idx = 0; idx < FW_BLOBS; idx++) 2695 if (qla_fw_blobs[idx].fw) 2696 release_firmware(qla_fw_blobs[idx].fw); 2697 - up(&qla_fw_lock); 2698 } 2699 2700 static pci_ers_result_t ··· 2867 return -ENODEV; 2868 } 2869 2870 - printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n"); 2871 ret = pci_register_driver(&qla2xxx_pci_driver); 2872 if (ret) { 2873 kmem_cache_destroy(srb_cachep);
··· 10 #include <linux/vmalloc.h> 11 #include <linux/delay.h> 12 #include <linux/kthread.h> 13 + #include <linux/mutex.h> 14 15 #include <scsi/scsi_tcq.h> 16 #include <scsi/scsicam.h> ··· 1631 /* load the F/W, read paramaters, and init the H/W */ 1632 ha->instance = num_hosts; 1633 1634 + mutex_init(&ha->vport_lock); 1635 init_completion(&ha->mbx_cmd_comp); 1636 complete(&ha->mbx_cmd_comp); 1637 init_completion(&ha->mbx_intr_comp); ··· 2156 qla2x00_post_work(struct scsi_qla_host *ha, struct qla_work_evt *e, int locked) 2157 { 2158 unsigned long flags; 2159 + scsi_qla_host_t *pha = to_qla_parent(ha); 2160 2161 if (!locked) 2162 + spin_lock_irqsave(&pha->hardware_lock, flags); 2163 list_add_tail(&e->list, &ha->work_list); 2164 qla2xxx_wake_dpc(ha); 2165 if (!locked) 2166 + spin_unlock_irqrestore(&pha->hardware_lock, flags); 2167 return QLA_SUCCESS; 2168 } 2169 ··· 2202 qla2x00_do_work(struct scsi_qla_host *ha) 2203 { 2204 struct qla_work_evt *e; 2205 + scsi_qla_host_t *pha = to_qla_parent(ha); 2206 2207 + spin_lock_irq(&pha->hardware_lock); 2208 while (!list_empty(&ha->work_list)) { 2209 e = list_entry(ha->work_list.next, struct qla_work_evt, list); 2210 list_del_init(&e->list); 2211 + spin_unlock_irq(&pha->hardware_lock); 2212 2213 switch (e->type) { 2214 case QLA_EVT_AEN: ··· 2221 } 2222 if (e->flags & QLA_EVT_FLAG_FREE) 2223 kfree(e); 2224 + spin_lock_irq(&pha->hardware_lock); 2225 } 2226 + spin_unlock_irq(&pha->hardware_lock); 2227 } 2228 2229 /************************************************************************** ··· 2634 #define FW_FILE_ISP24XX "ql2400_fw.bin" 2635 #define FW_FILE_ISP25XX "ql2500_fw.bin" 2636 2637 + static DEFINE_MUTEX(qla_fw_lock); 2638 2639 static struct fw_blob qla_fw_blobs[FW_BLOBS] = { 2640 { .name = FW_FILE_ISP21XX, .segs = { 0x1000, 0 }, }, ··· 2665 blob = &qla_fw_blobs[FW_ISP25XX]; 2666 } 2667 2668 + mutex_lock(&qla_fw_lock); 2669 if (blob->fw) 2670 goto out; 2671 ··· 2678 } 2679 2680 out: 2681 + mutex_unlock(&qla_fw_lock); 2682 return blob; 2683 } 2684 ··· 2687 { 2688 int idx; 2689 2690 + mutex_lock(&qla_fw_lock); 2691 for (idx = 0; idx < FW_BLOBS; idx++) 2692 if (qla_fw_blobs[idx].fw) 2693 release_firmware(qla_fw_blobs[idx].fw); 2694 + mutex_unlock(&qla_fw_lock); 2695 } 2696 2697 static pci_ers_result_t ··· 2864 return -ENODEV; 2865 } 2866 2867 + printk(KERN_INFO "QLogic Fibre Channel HBA Driver: %s\n", 2868 + qla2x00_version_str); 2869 ret = pci_register_driver(&qla2xxx_pci_driver); 2870 if (ret) { 2871 kmem_cache_destroy(srb_cachep);
+1 -1
drivers/scsi/qla2xxx/qla_version.h
··· 7 /* 8 * Driver version 9 */ 10 - #define QLA2XXX_VERSION "8.02.01-k2" 11 12 #define QLA_DRIVER_MAJOR_VER 8 13 #define QLA_DRIVER_MINOR_VER 2
··· 7 /* 8 * Driver version 9 */ 10 + #define QLA2XXX_VERSION "8.02.01-k4" 11 12 #define QLA_DRIVER_MAJOR_VER 8 13 #define QLA_DRIVER_MINOR_VER 2
+6 -1
drivers/scsi/scsi_sysfs.c
··· 359 360 static int scsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env) 361 { 362 - struct scsi_device *sdev = to_scsi_device(dev); 363 364 add_uevent_var(env, "MODALIAS=" SCSI_DEVICE_MODALIAS_FMT, sdev->type); 365 return 0;
··· 359 360 static int scsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env) 361 { 362 + struct scsi_device *sdev; 363 + 364 + if (dev->type != &scsi_dev_type) 365 + return 0; 366 + 367 + sdev = to_scsi_device(dev); 368 369 add_uevent_var(env, "MODALIAS=" SCSI_DEVICE_MODALIAS_FMT, sdev->type); 370 return 0;