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: (22 commits)
[SCSI] ibmvfc: Driver version 1.0.2
[SCSI] ibmvfc: Add details to async event log
[SCSI] ibmvfc: Sanitize response lengths
[SCSI] ibmvfc: Fix for lost async events
[SCSI] ibmvfc: Fixup host state during reinit
[SCSI] ibmvfc: Fix another hang on module removal
[SCSI] ibmvscsi: Fixup desired DMA value for shared memory partitions
[SCSI] megaraid_sas: remove sysfs dbg_lvl world writeable permissions
[SCSI] qla2xxx: Update version number to 8.02.01-k7.
[SCSI] qla2xxx: Explicitly tear-down vports during PCI remove_one().
[SCSI] qla2xxx: Reference proper ha during SBR handling.
[SCSI] qla2xxx: Set npiv_supported flag for FCoE HBAs.
[SCSI] qla2xxx: Don't leak SG-DMA mappings while aborting commands.
[SCSI] qla2xxx: Correct vport-state management issues during ISP-ABORT.
[SCSI] qla2xxx: Correct synchronization of software/firmware fcport states.
[SCSI] scsi_dh: Initialize lun_state in check_ownership()
[SCSI] scsi_dh: Do not use scsilun in rdac hardware handler
[SCSI] megaraid_sas: version and Documentation Update
[SCSI] megaraid_sas: add new controllers (0x78 0x79)
[SCSI] megaraid_sas: add the shutdown DCMD cmd to driver shutdown routine
...

+214 -43
+23
Documentation/scsi/ChangeLog.megaraid_sas
··· 1 + 2 + 1 Release Date : Thur.July. 24 11:41:51 PST 2008 - 3 + (emaild-id:megaraidlinux@lsi.com) 4 + Sumant Patro 5 + Bo Yang 6 + 7 + 2 Current Version : 00.00.04.01 8 + 3 Older Version : 00.00.03.22 9 + 10 + 1. Add the new controller (0078, 0079) support to the driver 11 + Those controllers are LSI's next generatation(gen2) SAS controllers. 12 + 13 + 1 Release Date : Mon.June. 23 10:12:45 PST 2008 - 14 + (emaild-id:megaraidlinux@lsi.com) 15 + Sumant Patro 16 + Bo Yang 17 + 18 + 2 Current Version : 00.00.03.22 19 + 3 Older Version : 00.00.03.20 20 + 21 + 1. Add shutdown DCMD cmd to the shutdown routine to make FW shutdown proper. 22 + 2. Unexpected interrupt occurs in HWR Linux driver, add the dumy readl pci flush will fix this issue. 23 + 1 24 1 Release Date : Mon. March 10 11:02:31 PDT 2008 - 2 25 (emaild-id:megaraidlinux@lsi.com) 3 26 Sumant Patro
+2 -1
drivers/scsi/device_handler/scsi_dh_rdac.c
··· 376 376 if (inqp->page_id[0] != 'e' || inqp->page_id[1] != 'd' || 377 377 inqp->page_id[2] != 'i' || inqp->page_id[3] != 'd') 378 378 return SCSI_DH_NOSYS; 379 - h->lun = scsilun_to_int((struct scsi_lun *)inqp->lun); 379 + h->lun = inqp->lun[7]; /* Uses only the last byte */ 380 380 } 381 381 return err; 382 382 } ··· 386 386 int err; 387 387 struct c9_inquiry *inqp; 388 388 389 + h->lun_state = RDAC_LUN_UNOWNED; 389 390 err = submit_inquiry(sdev, 0xC9, sizeof(struct c9_inquiry), h); 390 391 if (err == SCSI_DH_OK) { 391 392 inqp = &h->inq.c9;
+22 -15
drivers/scsi/ibmvscsi/ibmvfc.c
··· 556 556 /** 557 557 * ibmvfc_init_host - Start host initialization 558 558 * @vhost: ibmvfc host struct 559 + * @relogin: is this a re-login? 559 560 * 560 561 * Return value: 561 562 * nothing 562 563 **/ 563 - static void ibmvfc_init_host(struct ibmvfc_host *vhost) 564 + static void ibmvfc_init_host(struct ibmvfc_host *vhost, int relogin) 564 565 { 565 566 struct ibmvfc_target *tgt; 566 567 ··· 575 574 } 576 575 577 576 if (!ibmvfc_set_host_state(vhost, IBMVFC_INITIALIZING)) { 577 + if (!relogin) { 578 + memset(vhost->async_crq.msgs, 0, PAGE_SIZE); 579 + vhost->async_crq.cur = 0; 580 + } 581 + 578 582 list_for_each_entry(tgt, &vhost->targets, queue) 579 583 tgt->need_login = 1; 580 584 scsi_block_requests(vhost->host); ··· 1065 1059 static int ibmvfc_wait_while_resetting(struct ibmvfc_host *vhost) 1066 1060 { 1067 1061 long timeout = wait_event_timeout(vhost->init_wait_q, 1068 - (vhost->state == IBMVFC_ACTIVE || 1069 - vhost->state == IBMVFC_HOST_OFFLINE || 1070 - vhost->state == IBMVFC_LINK_DEAD), 1062 + ((vhost->state == IBMVFC_ACTIVE || 1063 + vhost->state == IBMVFC_HOST_OFFLINE || 1064 + vhost->state == IBMVFC_LINK_DEAD) && 1065 + vhost->action == IBMVFC_HOST_ACTION_NONE), 1071 1066 (init_timeout * HZ)); 1072 1067 1073 1068 return timeout ? 0 : -EIO; ··· 1457 1450 struct ibmvfc_cmd *vfc_cmd = &evt->xfer_iu->cmd; 1458 1451 struct ibmvfc_fcp_rsp *rsp = &vfc_cmd->rsp; 1459 1452 struct scsi_cmnd *cmnd = evt->cmnd; 1460 - int rsp_len = 0; 1461 - int sense_len = rsp->fcp_sense_len; 1453 + u32 rsp_len = 0; 1454 + u32 sense_len = rsp->fcp_sense_len; 1462 1455 1463 1456 if (cmnd) { 1464 1457 if (vfc_cmd->response_flags & IBMVFC_ADAPTER_RESID_VALID) ··· 1475 1468 rsp_len = rsp->fcp_rsp_len; 1476 1469 if ((sense_len + rsp_len) > SCSI_SENSE_BUFFERSIZE) 1477 1470 sense_len = SCSI_SENSE_BUFFERSIZE - rsp_len; 1478 - if ((rsp->flags & FCP_SNS_LEN_VALID) && rsp->fcp_sense_len) 1471 + if ((rsp->flags & FCP_SNS_LEN_VALID) && rsp->fcp_sense_len && rsp_len <= 8) 1479 1472 memcpy(cmnd->sense_buffer, rsp->data.sense + rsp_len, sense_len); 1480 1473 1481 1474 ibmvfc_log_error(evt); ··· 2084 2077 { 2085 2078 const char *desc = ibmvfc_get_ae_desc(crq->event); 2086 2079 2087 - ibmvfc_log(vhost, 3, "%s event received\n", desc); 2080 + ibmvfc_log(vhost, 3, "%s event received. scsi_id: %lx, wwpn: %lx," 2081 + " node_name: %lx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name); 2088 2082 2089 2083 switch (crq->event) { 2090 2084 case IBMVFC_AE_LINK_UP: 2091 2085 case IBMVFC_AE_RESUME: 2092 2086 vhost->events_to_log |= IBMVFC_AE_LINKUP; 2093 - ibmvfc_init_host(vhost); 2087 + ibmvfc_init_host(vhost, 1); 2094 2088 break; 2095 2089 case IBMVFC_AE_SCN_FABRIC: 2096 2090 vhost->events_to_log |= IBMVFC_AE_RSCN; 2097 - ibmvfc_init_host(vhost); 2091 + ibmvfc_init_host(vhost, 1); 2098 2092 break; 2099 2093 case IBMVFC_AE_SCN_NPORT: 2100 2094 case IBMVFC_AE_SCN_GROUP: ··· 2141 2133 /* Send back a response */ 2142 2134 rc = ibmvfc_send_crq_init_complete(vhost); 2143 2135 if (rc == 0) 2144 - ibmvfc_init_host(vhost); 2136 + ibmvfc_init_host(vhost, 0); 2145 2137 else 2146 2138 dev_err(vhost->dev, "Unable to send init rsp. rc=%ld\n", rc); 2147 2139 break; 2148 2140 case IBMVFC_CRQ_INIT_COMPLETE: 2149 2141 dev_info(vhost->dev, "Partner initialization complete\n"); 2150 - ibmvfc_init_host(vhost); 2142 + ibmvfc_init_host(vhost, 0); 2151 2143 break; 2152 2144 default: 2153 2145 dev_err(vhost->dev, "Unknown crq message type: %d\n", crq->format); ··· 3365 3357 mad->buffer.va = vhost->login_buf_dma; 3366 3358 mad->buffer.len = sizeof(*vhost->login_buf); 3367 3359 3368 - memset(vhost->async_crq.msgs, 0, PAGE_SIZE); 3369 - vhost->async_crq.cur = 0; 3370 3360 ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT_WAIT); 3371 3361 3372 3362 if (!ibmvfc_send_event(evt, vhost, default_timeout)) ··· 3607 3601 } 3608 3602 } 3609 3603 3610 - if (vhost->reinit) { 3604 + if (vhost->reinit && !ibmvfc_set_host_state(vhost, IBMVFC_INITIALIZING)) { 3611 3605 vhost->reinit = 0; 3606 + scsi_block_requests(vhost->host); 3612 3607 ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_QUERY); 3613 3608 } else { 3614 3609 ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_NONE);
+2 -2
drivers/scsi/ibmvscsi/ibmvfc.h
··· 29 29 #include "viosrp.h" 30 30 31 31 #define IBMVFC_NAME "ibmvfc" 32 - #define IBMVFC_DRIVER_VERSION "1.0.1" 33 - #define IBMVFC_DRIVER_DATE "(July 11, 2008)" 32 + #define IBMVFC_DRIVER_VERSION "1.0.2" 33 + #define IBMVFC_DRIVER_DATE "(August 14, 2008)" 34 34 35 35 #define IBMVFC_DEFAULT_TIMEOUT 15 36 36 #define IBMVFC_INIT_TIMEOUT 30
+1 -1
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 1636 1636 unsigned long desired_io = max_requests * sizeof(union viosrp_iu); 1637 1637 1638 1638 /* add io space for sg data */ 1639 - desired_io += (IBMVSCSI_MAX_SECTORS_DEFAULT * 1639 + desired_io += (IBMVSCSI_MAX_SECTORS_DEFAULT * 512 * 1640 1640 IBMVSCSI_CMDS_PER_LUN_DEFAULT); 1641 1641 1642 1642 return desired_io;
+116 -3
drivers/scsi/megaraid/megaraid_sas.c
··· 10 10 * 2 of the License, or (at your option) any later version. 11 11 * 12 12 * FILE : megaraid_sas.c 13 - * Version : v00.00.03.20-rc1 13 + * Version : v00.00.04.01-rc1 14 14 * 15 15 * Authors: 16 16 * (email-id : megaraidlinux@lsi.com) ··· 71 71 /* ppc IOP */ 72 72 {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1078DE)}, 73 73 /* ppc IOP */ 74 + {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1078GEN2)}, 75 + /* gen2*/ 76 + {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS0079GEN2)}, 77 + /* gen2*/ 74 78 {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_VERDE_ZCR)}, 75 79 /* xscale IOP, vega */ 76 80 {PCI_DEVICE(PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_PERC5)}, ··· 202 198 */ 203 199 writel(status, &regs->outbound_intr_status); 204 200 201 + /* Dummy readl to force pci flush */ 202 + readl(&regs->outbound_intr_status); 203 + 205 204 return 0; 206 205 } 207 206 ··· 300 293 */ 301 294 writel(status, &regs->outbound_doorbell_clear); 302 295 296 + /* Dummy readl to force pci flush */ 297 + readl(&regs->outbound_doorbell_clear); 298 + 303 299 return 0; 304 300 } 305 301 /** ··· 325 315 .disable_intr = megasas_disable_intr_ppc, 326 316 .clear_intr = megasas_clear_intr_ppc, 327 317 .read_fw_status_reg = megasas_read_fw_status_reg_ppc, 318 + }; 319 + 320 + /** 321 + * The following functions are defined for gen2 (deviceid : 0x78 0x79) 322 + * controllers 323 + */ 324 + 325 + /** 326 + * megasas_enable_intr_gen2 - Enables interrupts 327 + * @regs: MFI register set 328 + */ 329 + static inline void 330 + megasas_enable_intr_gen2(struct megasas_register_set __iomem *regs) 331 + { 332 + writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear); 333 + 334 + /* write ~0x00000005 (4 & 1) to the intr mask*/ 335 + writel(~MFI_GEN2_ENABLE_INTERRUPT_MASK, &(regs)->outbound_intr_mask); 336 + 337 + /* Dummy readl to force pci flush */ 338 + readl(&regs->outbound_intr_mask); 339 + } 340 + 341 + /** 342 + * megasas_disable_intr_gen2 - Disables interrupt 343 + * @regs: MFI register set 344 + */ 345 + static inline void 346 + megasas_disable_intr_gen2(struct megasas_register_set __iomem *regs) 347 + { 348 + u32 mask = 0xFFFFFFFF; 349 + writel(mask, &regs->outbound_intr_mask); 350 + /* Dummy readl to force pci flush */ 351 + readl(&regs->outbound_intr_mask); 352 + } 353 + 354 + /** 355 + * megasas_read_fw_status_reg_gen2 - returns the current FW status value 356 + * @regs: MFI register set 357 + */ 358 + static u32 359 + megasas_read_fw_status_reg_gen2(struct megasas_register_set __iomem *regs) 360 + { 361 + return readl(&(regs)->outbound_scratch_pad); 362 + } 363 + 364 + /** 365 + * megasas_clear_interrupt_gen2 - Check & clear interrupt 366 + * @regs: MFI register set 367 + */ 368 + static int 369 + megasas_clear_intr_gen2(struct megasas_register_set __iomem *regs) 370 + { 371 + u32 status; 372 + /* 373 + * Check if it is our interrupt 374 + */ 375 + status = readl(&regs->outbound_intr_status); 376 + 377 + if (!(status & MFI_GEN2_ENABLE_INTERRUPT_MASK)) 378 + return 1; 379 + 380 + /* 381 + * Clear the interrupt by writing back the same value 382 + */ 383 + writel(status, &regs->outbound_doorbell_clear); 384 + 385 + /* Dummy readl to force pci flush */ 386 + readl(&regs->outbound_intr_status); 387 + 388 + return 0; 389 + } 390 + /** 391 + * megasas_fire_cmd_gen2 - Sends command to the FW 392 + * @frame_phys_addr : Physical address of cmd 393 + * @frame_count : Number of frames for the command 394 + * @regs : MFI register set 395 + */ 396 + static inline void 397 + megasas_fire_cmd_gen2(dma_addr_t frame_phys_addr, u32 frame_count, 398 + struct megasas_register_set __iomem *regs) 399 + { 400 + writel((frame_phys_addr | (frame_count<<1))|1, 401 + &(regs)->inbound_queue_port); 402 + } 403 + 404 + static struct megasas_instance_template megasas_instance_template_gen2 = { 405 + 406 + .fire_cmd = megasas_fire_cmd_gen2, 407 + .enable_intr = megasas_enable_intr_gen2, 408 + .disable_intr = megasas_disable_intr_gen2, 409 + .clear_intr = megasas_clear_intr_gen2, 410 + .read_fw_status_reg = megasas_read_fw_status_reg_gen2, 328 411 }; 329 412 330 413 /** ··· 2079 1976 /* 2080 1977 * Map the message registers 2081 1978 */ 2082 - instance->base_addr = pci_resource_start(instance->pdev, 0); 1979 + if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078GEN2) || 1980 + (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0079GEN2)) { 1981 + instance->base_addr = pci_resource_start(instance->pdev, 1); 1982 + } else { 1983 + instance->base_addr = pci_resource_start(instance->pdev, 0); 1984 + } 2083 1985 2084 1986 if (pci_request_regions(instance->pdev, "megasas: LSI")) { 2085 1987 printk(KERN_DEBUG "megasas: IO memory region busy!\n"); ··· 2105 1997 case PCI_DEVICE_ID_LSI_SAS1078R: 2106 1998 case PCI_DEVICE_ID_LSI_SAS1078DE: 2107 1999 instance->instancet = &megasas_instance_template_ppc; 2000 + break; 2001 + case PCI_DEVICE_ID_LSI_SAS1078GEN2: 2002 + case PCI_DEVICE_ID_LSI_SAS0079GEN2: 2003 + instance->instancet = &megasas_instance_template_gen2; 2108 2004 break; 2109 2005 case PCI_DEVICE_ID_LSI_SAS1064R: 2110 2006 case PCI_DEVICE_ID_DELL_PERC5: ··· 2969 2857 { 2970 2858 struct megasas_instance *instance = pci_get_drvdata(pdev); 2971 2859 megasas_flush_cache(instance); 2860 + megasas_shutdown_controller(instance, MR_DCMD_CTRL_SHUTDOWN); 2972 2861 } 2973 2862 2974 2863 /** ··· 3405 3292 return retval; 3406 3293 } 3407 3294 3408 - static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUGO, megasas_sysfs_show_dbg_lvl, 3295 + static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUSR, megasas_sysfs_show_dbg_lvl, 3409 3296 megasas_sysfs_set_dbg_lvl); 3410 3297 3411 3298 static ssize_t
+7 -3
drivers/scsi/megaraid/megaraid_sas.h
··· 18 18 /* 19 19 * MegaRAID SAS Driver meta data 20 20 */ 21 - #define MEGASAS_VERSION "00.00.03.20-rc1" 22 - #define MEGASAS_RELDATE "March 10, 2008" 23 - #define MEGASAS_EXT_VERSION "Mon. March 10 11:02:31 PDT 2008" 21 + #define MEGASAS_VERSION "00.00.04.01" 22 + #define MEGASAS_RELDATE "July 24, 2008" 23 + #define MEGASAS_EXT_VERSION "Thu July 24 11:41:51 PST 2008" 24 24 25 25 /* 26 26 * Device IDs ··· 28 28 #define PCI_DEVICE_ID_LSI_SAS1078R 0x0060 29 29 #define PCI_DEVICE_ID_LSI_SAS1078DE 0x007C 30 30 #define PCI_DEVICE_ID_LSI_VERDE_ZCR 0x0413 31 + #define PCI_DEVICE_ID_LSI_SAS1078GEN2 0x0078 32 + #define PCI_DEVICE_ID_LSI_SAS0079GEN2 0x0079 31 33 32 34 /* 33 35 * ===================================== ··· 582 580 #define MEGASAS_COMPLETION_TIMER_INTERVAL (HZ/10) 583 581 584 582 #define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 583 + #define MFI_REPLY_GEN2_MESSAGE_INTERRUPT 0x00000001 584 + #define MFI_GEN2_ENABLE_INTERRUPT_MASK (0x00000001 | 0x00000004) 585 585 586 586 /* 587 587 * register set for both 1068 and 1078 controllers
+11
drivers/scsi/qla2xxx/qla_attr.c
··· 993 993 { 994 994 fc_port_t *fcport = *(fc_port_t **)rport->dd_data; 995 995 996 + /* 997 + * At this point all fcport's software-states are cleared. Perform any 998 + * final cleanup of firmware resources (PCBs and XCBs). 999 + */ 1000 + if (fcport->loop_id != FC_NO_LOOP_ID) { 1001 + fcport->ha->isp_ops->fabric_logout(fcport->ha, fcport->loop_id, 1002 + fcport->d_id.b.domain, fcport->d_id.b.area, 1003 + fcport->d_id.b.al_pa); 1004 + fcport->loop_id = FC_NO_LOOP_ID; 1005 + } 1006 + 996 1007 qla2x00_abort_fcport_cmds(fcport); 997 1008 scsi_target_unblock(&rport->dev); 998 1009 }
+1
drivers/scsi/qla2xxx/qla_def.h
··· 2237 2237 #define REGISTER_FDMI_NEEDED 26 2238 2238 #define FCPORT_UPDATE_NEEDED 27 2239 2239 #define VP_DPC_NEEDED 28 /* wake up for VP dpc handling */ 2240 + #define UNLOADING 29 2240 2241 2241 2242 uint32_t device_flags; 2242 2243 #define DFLG_LOCAL_DEVICES BIT_0
+6 -2
drivers/scsi/qla2xxx/qla_init.c
··· 976 976 &ha->fw_attributes, &ha->fw_memory_size); 977 977 qla2x00_resize_request_q(ha); 978 978 ha->flags.npiv_supported = 0; 979 - if ((IS_QLA24XX(ha) || IS_QLA25XX(ha)) && 980 - (ha->fw_attributes & BIT_2)) { 979 + if ((IS_QLA24XX(ha) || IS_QLA25XX(ha) || 980 + IS_QLA84XX(ha)) && 981 + (ha->fw_attributes & BIT_2)) { 981 982 ha->flags.npiv_supported = 1; 982 983 if ((!ha->max_npiv_vports) || 983 984 ((ha->max_npiv_vports + 1) % ··· 3252 3251 { 3253 3252 int rval; 3254 3253 uint8_t status = 0; 3254 + scsi_qla_host_t *vha; 3255 3255 3256 3256 if (ha->flags.online) { 3257 3257 ha->flags.online = 0; ··· 3267 3265 if (atomic_read(&ha->loop_state) != LOOP_DOWN) { 3268 3266 atomic_set(&ha->loop_state, LOOP_DOWN); 3269 3267 qla2x00_mark_all_devices_lost(ha, 0); 3268 + list_for_each_entry(vha, &ha->vp_list, vp_list) 3269 + qla2x00_mark_all_devices_lost(vha, 0); 3270 3270 } else { 3271 3271 if (!atomic_read(&ha->loop_down_timer)) 3272 3272 atomic_set(&ha->loop_down_timer,
+7 -7
drivers/scsi/qla2xxx/qla_isr.c
··· 879 879 sp->request_sense_ptr += sense_len; 880 880 sp->request_sense_length -= sense_len; 881 881 if (sp->request_sense_length != 0) 882 - sp->ha->status_srb = sp; 882 + sp->fcport->ha->status_srb = sp; 883 883 884 884 DEBUG5(printk("%s(): Check condition Sense data, scsi(%ld:%d:%d:%d) " 885 - "cmd=%p pid=%ld\n", __func__, sp->ha->host_no, cp->device->channel, 886 - cp->device->id, cp->device->lun, cp, cp->serial_number)); 885 + "cmd=%p pid=%ld\n", __func__, sp->fcport->ha->host_no, 886 + cp->device->channel, cp->device->id, cp->device->lun, cp, 887 + cp->serial_number)); 887 888 if (sense_len) 888 889 DEBUG5(qla2x00_dump_buffer(cp->sense_buffer, 889 890 CMD_ACTUAL_SNSLEN(cp))); ··· 1185 1184 atomic_read(&fcport->state))); 1186 1185 1187 1186 cp->result = DID_BUS_BUSY << 16; 1188 - if (atomic_read(&fcport->state) == FCS_ONLINE) { 1189 - qla2x00_mark_device_lost(ha, fcport, 1, 1); 1190 - } 1187 + if (atomic_read(&fcport->state) == FCS_ONLINE) 1188 + qla2x00_mark_device_lost(fcport->ha, fcport, 1, 1); 1191 1189 break; 1192 1190 1193 1191 case CS_RESET: ··· 1229 1229 1230 1230 /* Check to see if logout occurred. */ 1231 1231 if ((le16_to_cpu(sts->status_flags) & SF_LOGOUT_SENT)) 1232 - qla2x00_mark_device_lost(ha, fcport, 1, 1); 1232 + qla2x00_mark_device_lost(fcport->ha, fcport, 1, 1); 1233 1233 break; 1234 1234 1235 1235 default:
+1 -1
drivers/scsi/qla2xxx/qla_mbx.c
··· 2686 2686 set_bit(VP_IDX_ACQUIRED, &vha->vp_flags); 2687 2687 set_bit(VP_DPC_NEEDED, &ha->dpc_flags); 2688 2688 2689 - wake_up_process(ha->dpc_thread); 2689 + qla2xxx_wake_dpc(ha); 2690 2690 } 2691 2691 } 2692 2692
+12 -6
drivers/scsi/qla2xxx/qla_os.c
··· 780 780 sp = pha->outstanding_cmds[cnt]; 781 781 if (!sp) 782 782 continue; 783 - if (ha->vp_idx != sp->ha->vp_idx) 783 + 784 + if (ha->vp_idx != sp->fcport->ha->vp_idx) 784 785 continue; 785 786 match = 0; 786 787 switch (type) { ··· 1081 1080 sp = ha->outstanding_cmds[cnt]; 1082 1081 if (sp) { 1083 1082 ha->outstanding_cmds[cnt] = NULL; 1084 - sp->flags = 0; 1085 1083 sp->cmd->result = res; 1086 - sp->cmd->host_scribble = (unsigned char *)NULL; 1087 1084 qla2x00_sp_compl(ha, sp); 1088 1085 } 1089 1086 } ··· 1775 1776 static void 1776 1777 qla2x00_remove_one(struct pci_dev *pdev) 1777 1778 { 1778 - scsi_qla_host_t *ha; 1779 + scsi_qla_host_t *ha, *vha, *temp; 1779 1780 1780 1781 ha = pci_get_drvdata(pdev); 1782 + 1783 + list_for_each_entry_safe(vha, temp, &ha->vp_list, vp_list) 1784 + fc_vport_terminate(vha->fc_vport); 1785 + 1786 + set_bit(UNLOADING, &ha->dpc_flags); 1781 1787 1782 1788 qla2x00_dfs_remove(ha); 1783 1789 ··· 2455 2451 void 2456 2452 qla2xxx_wake_dpc(scsi_qla_host_t *ha) 2457 2453 { 2458 - if (ha->dpc_thread) 2459 - wake_up_process(ha->dpc_thread); 2454 + struct task_struct *t = ha->dpc_thread; 2455 + 2456 + if (!test_bit(UNLOADING, &ha->dpc_flags) && t) 2457 + wake_up_process(t); 2460 2458 } 2461 2459 2462 2460 /*
+1 -1
drivers/scsi/qla2xxx/qla_version.h
··· 7 7 /* 8 8 * Driver version 9 9 */ 10 - #define QLA2XXX_VERSION "8.02.01-k6" 10 + #define QLA2XXX_VERSION "8.02.01-k7" 11 11 12 12 #define QLA_DRIVER_MAJOR_VER 8 13 13 #define QLA_DRIVER_MINOR_VER 2
+2 -1
include/scsi/scsi_device.h
··· 6 6 #include <linux/spinlock.h> 7 7 #include <linux/workqueue.h> 8 8 #include <linux/blkdev.h> 9 + #include <scsi/scsi.h> 9 10 #include <asm/atomic.h> 10 11 11 12 struct request_queue; ··· 427 426 428 427 static inline int scsi_device_protection(struct scsi_device *sdev) 429 428 { 430 - return sdev->inquiry[5] & (1<<0); 429 + return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); 431 430 } 432 431 433 432 #define MODULE_ALIAS_SCSI_DEVICE(type) \