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] hpsa: fix redefinition of PCI_DEVICE_ID_CISSF
[SCSI] qla2xxx: Update version number to 8.03.05-k0.
[SCSI] qla2xxx: Properly set the return value in qla2xxx_eh_abort function.
[SCSI] qla2xxx: Correct issue where NPIV-config data was not being allocated for 82xx parts.
[SCSI] qla2xxx: Change MSI initialization from using incorrect request_irq parameter.
[SCSI] qla2xxx: Populate Command Type 6 LUN field properly.
[SCSI] zfcp: Issue FCP command without holding SCSI host_lock
[SCSI] zfcp: Prevent usage w/o holding a reference
[SCSI] zfcp: No ERP escalation on gpn_ft eval
[SCSI] zfcp: Correct false abort data assignment.
[SCSI] zfcp: Fix common FCP request reception
[SCSI] Eliminate error handler overload of the SCSI serial number
[SCSI] pmcraid: disable msix and expand device config entry
[SCSI] bsg: correct fault if queue object removed while dev_t open
[SCSI] osd: checking NULL instead of ERR_PTR()

+43 -62
+8
block/bsg.c
··· 250 250 int ret, rw; 251 251 unsigned int dxfer_len; 252 252 void *dxferp = NULL; 253 + struct bsg_class_device *bcd = &q->bsg_dev; 254 + 255 + /* if the LLD has been removed then the bsg_unregister_queue will 256 + * eventually be called and the class_dev was freed, so we can no 257 + * longer use this request_queue. Return no such address. 258 + */ 259 + if (!bcd->class_dev) 260 + return ERR_PTR(-ENXIO); 253 261 254 262 dprintk("map hdr %llx/%u %llx/%u\n", (unsigned long long) hdr->dout_xferp, 255 263 hdr->dout_xfer_len, (unsigned long long) hdr->din_xferp,
+8 -3
drivers/s390/scsi/zfcp_erp.c
··· 156 156 if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) || 157 157 a_status & ZFCP_STATUS_COMMON_ERP_FAILED) 158 158 return 0; 159 + if (p_status & ZFCP_STATUS_COMMON_NOESC) 160 + return need; 159 161 if (!(a_status & ZFCP_STATUS_COMMON_UNBLOCKED)) 160 162 need = ZFCP_ERP_ACTION_REOPEN_ADAPTER; 161 163 /* fall through */ ··· 190 188 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, 191 189 &zfcp_sdev->status); 192 190 erp_action = &zfcp_sdev->erp_action; 191 + memset(erp_action, 0, sizeof(struct zfcp_erp_action)); 192 + erp_action->port = port; 193 + erp_action->sdev = sdev; 193 194 if (!(atomic_read(&zfcp_sdev->status) & 194 195 ZFCP_STATUS_COMMON_RUNNING)) 195 196 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; ··· 205 200 zfcp_erp_action_dismiss_port(port); 206 201 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status); 207 202 erp_action = &port->erp_action; 203 + memset(erp_action, 0, sizeof(struct zfcp_erp_action)); 204 + erp_action->port = port; 208 205 if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING)) 209 206 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; 210 207 break; ··· 216 209 zfcp_erp_action_dismiss_adapter(adapter); 217 210 atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status); 218 211 erp_action = &adapter->erp_action; 212 + memset(erp_action, 0, sizeof(struct zfcp_erp_action)); 219 213 if (!(atomic_read(&adapter->status) & 220 214 ZFCP_STATUS_COMMON_RUNNING)) 221 215 act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; ··· 226 218 return NULL; 227 219 } 228 220 229 - memset(erp_action, 0, sizeof(struct zfcp_erp_action)); 230 221 erp_action->adapter = adapter; 231 - erp_action->port = port; 232 - erp_action->sdev = sdev; 233 222 erp_action->action = need; 234 223 erp_action->status = act_status; 235 224
+6 -5
drivers/s390/scsi/zfcp_fsf.c
··· 851 851 852 852 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); 853 853 854 - req->data = zfcp_sdev; 854 + req->data = sdev; 855 855 req->handler = zfcp_fsf_abort_fcp_command_handler; 856 856 req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; 857 857 req->qtcb->header.port_handle = zfcp_sdev->port->handle; ··· 2069 2069 struct fcp_resp_with_ext *fcp_rsp; 2070 2070 unsigned long flags; 2071 2071 2072 - zfcp_fsf_fcp_handler_common(req); 2073 - 2074 2072 read_lock_irqsave(&req->adapter->abort_lock, flags); 2075 2073 2076 2074 scpnt = req->data; ··· 2076 2078 read_unlock_irqrestore(&req->adapter->abort_lock, flags); 2077 2079 return; 2078 2080 } 2081 + 2082 + zfcp_fsf_fcp_handler_common(req); 2079 2083 2080 2084 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { 2081 2085 set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED); ··· 2170 2170 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; 2171 2171 struct zfcp_qdio *qdio = adapter->qdio; 2172 2172 struct fsf_qtcb_bottom_io *io; 2173 + unsigned long flags; 2173 2174 2174 2175 if (unlikely(!(atomic_read(&zfcp_sdev->status) & 2175 2176 ZFCP_STATUS_COMMON_UNBLOCKED))) 2176 2177 return -EBUSY; 2177 2178 2178 - spin_lock(&qdio->req_q_lock); 2179 + spin_lock_irqsave(&qdio->req_q_lock, flags); 2179 2180 if (atomic_read(&qdio->req_q_free) <= 0) { 2180 2181 atomic_inc(&qdio->req_q_full); 2181 2182 goto out; ··· 2240 2239 zfcp_fsf_req_free(req); 2241 2240 scsi_cmnd->host_scribble = NULL; 2242 2241 out: 2243 - spin_unlock(&qdio->req_q_lock); 2242 + spin_unlock_irqrestore(&qdio->req_q_lock, flags); 2244 2243 return retval; 2245 2244 } 2246 2245
+2 -5
drivers/s390/scsi/zfcp_scsi.c
··· 76 76 scpnt->scsi_done(scpnt); 77 77 } 78 78 79 - static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, 80 - void (*done) (struct scsi_cmnd *)) 79 + static 80 + int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) 81 81 { 82 82 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); 83 83 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; ··· 87 87 /* reset the status for this request */ 88 88 scpnt->result = 0; 89 89 scpnt->host_scribble = NULL; 90 - scpnt->scsi_done = done; 91 90 92 91 scsi_result = fc_remote_port_chkready(rport); 93 92 if (unlikely(scsi_result)) { ··· 125 126 126 127 return ret; 127 128 } 128 - 129 - static DEF_SCSI_QCMD(zfcp_scsi_queuecommand) 130 129 131 130 static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) 132 131 {
+1 -7
drivers/scsi/hpsa.c
··· 90 90 {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3252}, 91 91 {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3253}, 92 92 {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3254}, 93 - #define PCI_DEVICE_ID_HP_CISSF 0x333f 94 - {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSF, 0x103C, 0x333F}, 95 - {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 96 - PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, 97 - {PCI_VENDOR_ID_COMPAQ, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 93 + {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 98 94 PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, 99 95 {0,} 100 96 }; ··· 109 113 {0x3249103C, "Smart Array P812", &SA5_access}, 110 114 {0x324a103C, "Smart Array P712m", &SA5_access}, 111 115 {0x324b103C, "Smart Array P711m", &SA5_access}, 112 - {0x3233103C, "StorageWorks P1210m", &SA5_access}, 113 - {0x333F103C, "StorageWorks P1210m", &SA5_access}, 114 116 {0x3250103C, "Smart Array", &SA5_access}, 115 117 {0x3250113C, "Smart Array", &SA5_access}, 116 118 {0x3250123C, "Smart Array", &SA5_access},
+2 -2
drivers/scsi/osd/osd_initiator.c
··· 951 951 /* create a bio for continuation segment */ 952 952 bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes, 953 953 GFP_KERNEL); 954 - if (unlikely(!bio)) 955 - return -ENOMEM; 954 + if (IS_ERR(bio)) 955 + return PTR_ERR(bio); 956 956 957 957 bio->bi_rw |= REQ_WRITE; 958 958
+3 -1
drivers/scsi/pmcraid.c
··· 62 62 static unsigned int pmcraid_debug_log; 63 63 static unsigned int pmcraid_disable_aen; 64 64 static unsigned int pmcraid_log_level = IOASC_LOG_LEVEL_MUST; 65 + static unsigned int pmcraid_enable_msix; 65 66 66 67 /* 67 68 * Data structures to support multiple adapters by the LLD. ··· 4692 4691 int rc; 4693 4692 struct pci_dev *pdev = pinstance->pdev; 4694 4693 4695 - if (pci_find_capability(pdev, PCI_CAP_ID_MSIX)) { 4694 + if ((pmcraid_enable_msix) && 4695 + (pci_find_capability(pdev, PCI_CAP_ID_MSIX))) { 4696 4696 int num_hrrq = PMCRAID_NUM_MSIX_VECTORS; 4697 4697 struct msix_entry entries[PMCRAID_NUM_MSIX_VECTORS]; 4698 4698 int i;
+2 -4
drivers/scsi/pmcraid.h
··· 42 42 */ 43 43 #define PMCRAID_DRIVER_NAME "PMC MaxRAID" 44 44 #define PMCRAID_DEVFILE "pmcsas" 45 - #define PMCRAID_DRIVER_VERSION "2.0.3" 45 + #define PMCRAID_DRIVER_VERSION "1.0.3" 46 46 #define PMCRAID_DRIVER_DATE __DATE__ 47 47 48 48 #define PMCRAID_FW_VERSION_1 0x002 ··· 333 333 __u8 lun[PMCRAID_LUN_LEN]; 334 334 } __attribute__((packed, aligned(4))); 335 335 336 - /* extended configuration table sizes are of 64 bytes in size */ 337 - #define PMCRAID_CFGTE_EXT_SIZE 32 336 + /* extended configuration table sizes are also of 32 bytes in size */ 338 337 struct pmcraid_config_table_entry_ext { 339 338 struct pmcraid_config_table_entry cfgte; 340 - __u8 cfgte_ext[PMCRAID_CFGTE_EXT_SIZE]; 341 339 }; 342 340 343 341 /* resource types (config_table_entry.resource_type values) */
-1
drivers/scsi/qla2xxx/qla_def.h
··· 2409 2409 uint32_t enable_target_reset :1; 2410 2410 uint32_t enable_lip_full_login :1; 2411 2411 uint32_t enable_led_scheme :1; 2412 - uint32_t inta_enabled :1; 2413 2412 uint32_t msi_enabled :1; 2414 2413 uint32_t msix_enabled :1; 2415 2414 uint32_t disable_serdes :1;
+1
drivers/scsi/qla2xxx/qla_iocb.c
··· 1061 1061 fcp_cmnd->additional_cdb_len |= 2; 1062 1062 1063 1063 int_to_scsilun(sp->cmd->device->lun, &fcp_cmnd->lun); 1064 + host_to_fcp_swap((uint8_t *)&fcp_cmnd->lun, sizeof(fcp_cmnd->lun)); 1064 1065 memcpy(fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len); 1065 1066 cmd_pkt->fcp_cmnd_dseg_len = cpu_to_le16(fcp_cmnd_len); 1066 1067 cmd_pkt->fcp_cmnd_dseg_address[0] = cpu_to_le32(
+3 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 2491 2491 skip_msi: 2492 2492 2493 2493 ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler, 2494 - IRQF_SHARED, QLA2XXX_DRIVER_NAME, rsp); 2494 + ha->flags.msi_enabled ? 0 : IRQF_SHARED, 2495 + QLA2XXX_DRIVER_NAME, rsp); 2495 2496 if (ret) { 2496 2497 qla_printk(KERN_WARNING, ha, 2497 2498 "Failed to reserve interrupt %d already in use.\n", 2498 2499 ha->pdev->irq); 2499 2500 goto fail; 2500 2501 } 2501 - ha->flags.inta_enabled = 1; 2502 + 2502 2503 clear_risc_ints: 2503 2504 2504 2505 /*
+1
drivers/scsi/qla2xxx/qla_nx.c
··· 2749 2749 goto queuing_error_fcp_cmnd; 2750 2750 2751 2751 int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun); 2752 + host_to_fcp_swap((uint8_t *)&cmd_pkt->lun, sizeof(cmd_pkt->lun)); 2752 2753 2753 2754 /* build FCP_CMND IU */ 2754 2755 memset(ctx->fcp_cmnd, 0, sizeof(struct fcp_cmnd));
+2 -1
drivers/scsi/qla2xxx/qla_os.c
··· 829 829 { 830 830 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 831 831 srb_t *sp; 832 - int ret; 832 + int ret = SUCCESS; 833 833 unsigned int id, lun; 834 834 unsigned long flags; 835 835 int wait = 0; ··· 2064 2064 ha->init_cb_size = sizeof(struct mid_init_cb_81xx); 2065 2065 ha->gid_list_info_size = 8; 2066 2066 ha->optrom_size = OPTROM_SIZE_82XX; 2067 + ha->nvram_npiv_size = QLA_MAX_VPORTS_QLA25XX; 2067 2068 ha->isp_ops = &qla82xx_isp_ops; 2068 2069 ha->flash_conf_off = FARX_ACCESS_FLASH_CONF; 2069 2070 ha->flash_data_off = FARX_ACCESS_FLASH_DATA;
+2 -2
drivers/scsi/qla2xxx/qla_version.h
··· 7 7 /* 8 8 * Driver version 9 9 */ 10 - #define QLA2XXX_VERSION "8.03.04-k0" 10 + #define QLA2XXX_VERSION "8.03.05-k0" 11 11 12 12 #define QLA_DRIVER_MAJOR_VER 8 13 13 #define QLA_DRIVER_MINOR_VER 3 14 - #define QLA_DRIVER_PATCH_VER 4 14 + #define QLA_DRIVER_PATCH_VER 5 15 15 #define QLA_DRIVER_BETA_VER 0
+2 -24
drivers/scsi/scsi_error.c
··· 615 615 return rtn; 616 616 } 617 617 618 - static int __scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) 618 + static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) 619 619 { 620 620 if (!scmd->device->host->hostt->eh_abort_handler) 621 621 return FAILED; ··· 623 623 return scmd->device->host->hostt->eh_abort_handler(scmd); 624 624 } 625 625 626 - /** 627 - * scsi_try_to_abort_cmd - Ask host to abort a running command. 628 - * @scmd: SCSI cmd to abort from Lower Level. 629 - * 630 - * Notes: 631 - * This function will not return until the user's completion function 632 - * has been called. there is no timeout on this operation. if the 633 - * author of the low-level driver wishes this operation to be timed, 634 - * they can provide this facility themselves. helper functions in 635 - * scsi_error.c can be supplied to make this easier to do. 636 - */ 637 - static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) 638 - { 639 - /* 640 - * scsi_done was called just after the command timed out and before 641 - * we had a chance to process it. (db) 642 - */ 643 - if (scmd->serial_number == 0) 644 - return SUCCESS; 645 - return __scsi_try_to_abort_cmd(scmd); 646 - } 647 - 648 626 static void scsi_abort_eh_cmnd(struct scsi_cmnd *scmd) 649 627 { 650 - if (__scsi_try_to_abort_cmd(scmd) != SUCCESS) 628 + if (scsi_try_to_abort_cmd(scmd) != SUCCESS) 651 629 if (scsi_try_bus_device_reset(scmd) != SUCCESS) 652 630 if (scsi_try_target_reset(scmd) != SUCCESS) 653 631 if (scsi_try_bus_reset(scmd) != SUCCESS)
-5
drivers/scsi/scsi_lib.c
··· 1403 1403 1404 1404 INIT_LIST_HEAD(&cmd->eh_entry); 1405 1405 1406 - /* 1407 - * Set the serial numbers back to zero 1408 - */ 1409 - cmd->serial_number = 0; 1410 - 1411 1406 atomic_inc(&cmd->device->iodone_cnt); 1412 1407 if (cmd->result) 1413 1408 atomic_inc(&cmd->device->ioerr_cnt);