Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"This is a set of ten bug fixes (and two consisting of copyright year
update and version number change) pretty much all of which involve
either a crash or a hang except the removal of the random sleep from
the qla2xxx driver (which is a coding error so bad, we want it gone
before anyone has a chance to copy it)."

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
[SCSI] lpfc: fix potential NULL pointer dereference in lpfc_sli4_rq_put()
[SCSI] libsas: fix handling vacant phy in sas_set_ex_phy()
[SCSI] ibmvscsi: Fix slave_configure deadlock
[SCSI] qla2xxx: Update the driver version to 8.04.00.13-k.
[SCSI] qla2xxx: Remove debug code that msleeps for random duration.
[SCSI] qla2xxx: Update copyright dates information in LICENSE.qla2xxx file.
[SCSI] qla2xxx: Fix crash during firmware dump procedure.
[SCSI] Revert "qla2xxx: Add setting of driver version string for vendor application."
[SCSI] ipr: dlpar failed when adding an adapter back
[SCSI] ipr: fix addition of abort command to HRRQ free queue
[SCSI] st: Take additional queue ref in st_probe
[SCSI] libsas: use right function to alloc smp response
[SCSI] ipr: ipr_test_msi() fails when running with msi-x enabled adapter

+38 -80
+1 -1
Documentation/scsi/LICENSE.qla2xxx
··· 1 - Copyright (c) 2003-2012 QLogic Corporation 1 + Copyright (c) 2003-2013 QLogic Corporation 2 2 QLogic Linux FC-FCoE Driver 3 3 4 4 This program includes a device driver for Linux 3.x.
+1 -1
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 1899 1899 sdev->allow_restart = 1; 1900 1900 blk_queue_rq_timeout(sdev->request_queue, 120 * HZ); 1901 1901 } 1902 - scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun); 1903 1902 spin_unlock_irqrestore(shost->host_lock, lock_flags); 1903 + scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun); 1904 1904 return 0; 1905 1905 } 1906 1906
+10 -3
drivers/scsi/ipr.c
··· 5148 5148 ipr_trace; 5149 5149 } 5150 5150 5151 - list_add_tail(&ipr_cmd->queue, &hrrq->hrrq_free_q); 5151 + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); 5152 5152 if (!ipr_is_naca_model(res)) 5153 5153 res->needs_sync_complete = 1; 5154 5154 ··· 9349 9349 int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg); 9350 9350 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 9351 9351 9352 - rc = request_irq(pdev->irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg); 9352 + if (ioa_cfg->intr_flag == IPR_USE_MSIX) 9353 + rc = request_irq(ioa_cfg->vectors_info[0].vec, ipr_test_intr, 0, IPR_NAME, ioa_cfg); 9354 + else 9355 + rc = request_irq(pdev->irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg); 9353 9356 if (rc) { 9354 9357 dev_err(&pdev->dev, "Can not assign irq %d\n", pdev->irq); 9355 9358 return rc; ··· 9374 9371 9375 9372 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 9376 9373 9377 - free_irq(pdev->irq, ioa_cfg); 9374 + if (ioa_cfg->intr_flag == IPR_USE_MSIX) 9375 + free_irq(ioa_cfg->vectors_info[0].vec, ioa_cfg); 9376 + else 9377 + free_irq(pdev->irq, ioa_cfg); 9378 9378 9379 9379 LEAVE; 9380 9380 ··· 9728 9722 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); 9729 9723 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); 9730 9724 flush_work(&ioa_cfg->work_q); 9725 + INIT_LIST_HEAD(&ioa_cfg->used_res_q); 9731 9726 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); 9732 9727 9733 9728 spin_lock(&ipr_driver_lock);
+13 -1
drivers/scsi/libsas/sas_expander.c
··· 235 235 linkrate = phy->linkrate; 236 236 memcpy(sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); 237 237 238 + /* Handle vacant phy - rest of dr data is not valid so skip it */ 239 + if (phy->phy_state == PHY_VACANT) { 240 + memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); 241 + phy->attached_dev_type = NO_DEVICE; 242 + if (!test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) { 243 + phy->phy_id = phy_id; 244 + goto skip; 245 + } else 246 + goto out; 247 + } 248 + 238 249 phy->attached_dev_type = to_dev_type(dr); 239 250 if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) 240 251 goto out; ··· 283 272 phy->phy->maximum_linkrate = dr->pmax_linkrate; 284 273 phy->phy->negotiated_linkrate = phy->linkrate; 285 274 275 + skip: 286 276 if (new_phy) 287 277 if (sas_phy_add(phy->phy)) { 288 278 sas_phy_free(phy->phy); ··· 400 388 if (!disc_req) 401 389 return -ENOMEM; 402 390 403 - disc_resp = alloc_smp_req(DISCOVER_RESP_SIZE); 391 + disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE); 404 392 if (!disc_resp) { 405 393 kfree(disc_req); 406 394 return -ENOMEM;
+2 -1
drivers/scsi/lpfc/lpfc_sli.c
··· 438 438 struct lpfc_rqe *temp_hrqe; 439 439 struct lpfc_rqe *temp_drqe; 440 440 struct lpfc_register doorbell; 441 - int put_index = hq->host_index; 441 + int put_index; 442 442 443 443 /* sanity check on queue memory */ 444 444 if (unlikely(!hq) || unlikely(!dq)) 445 445 return -ENOMEM; 446 + put_index = hq->host_index; 446 447 temp_hrqe = hq->qe[hq->host_index].rqe; 447 448 temp_drqe = dq->qe[dq->host_index].rqe; 448 449
-5
drivers/scsi/qla2xxx/qla_attr.c
··· 1938 1938 "Timer for the VP[%d] has stopped\n", vha->vp_idx); 1939 1939 } 1940 1940 1941 - /* No pending activities shall be there on the vha now */ 1942 - if (ql2xextended_error_logging & ql_dbg_user) 1943 - msleep(random32()%10); /* Just to see if something falls on 1944 - * the net we have placed below */ 1945 - 1946 1941 BUG_ON(atomic_read(&vha->vref_count)); 1947 1942 1948 1943 qla2x00_free_fcports(vha);
+2 -1
drivers/scsi/qla2xxx/qla_dbg.c
··· 15 15 * | Mailbox commands | 0x115b | 0x111a-0x111b | 16 16 * | | | 0x112c-0x112e | 17 17 * | | | 0x113a | 18 + * | | | 0x1155-0x1158 | 18 19 * | Device Discovery | 0x2087 | 0x2020-0x2022, | 19 20 * | | | 0x2016 | 20 21 * | Queue Command and IO tracing | 0x3031 | 0x3006-0x300b | ··· 402 401 void *ring; 403 402 } aq, *aqp; 404 403 405 - if (!ha->tgt.atio_q_length) 404 + if (!ha->tgt.atio_ring) 406 405 return ptr; 407 406 408 407 num_queues = 1;
-1
drivers/scsi/qla2xxx/qla_def.h
··· 863 863 #define MBX_1 BIT_1 864 864 #define MBX_0 BIT_0 865 865 866 - #define RNID_TYPE_SET_VERSION 0x9 867 866 #define RNID_TYPE_ASIC_TEMP 0xC 868 867 869 868 /*
-3
drivers/scsi/qla2xxx/qla_gbl.h
··· 358 358 qla2x00_disable_fce_trace(scsi_qla_host_t *, uint64_t *, uint64_t *); 359 359 360 360 extern int 361 - qla2x00_set_driver_version(scsi_qla_host_t *, char *); 362 - 363 - extern int 364 361 qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint8_t *, 365 362 uint16_t, uint16_t, uint16_t, uint16_t); 366 363
+1 -3
drivers/scsi/qla2xxx/qla_init.c
··· 619 619 if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) 620 620 qla24xx_read_fcp_prio_cfg(vha); 621 621 622 - qla2x00_set_driver_version(vha, QLA2XXX_VERSION); 623 - 624 622 return (rval); 625 623 } 626 624 ··· 1397 1399 mq_size += ha->max_rsp_queues * 1398 1400 (rsp->length * sizeof(response_t)); 1399 1401 } 1400 - if (ha->tgt.atio_q_length) 1402 + if (ha->tgt.atio_ring) 1401 1403 mq_size += ha->tgt.atio_q_length * sizeof(request_t); 1402 1404 /* Allocate memory for Fibre Channel Event Buffer. */ 1403 1405 if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha))
-58
drivers/scsi/qla2xxx/qla_mbx.c
··· 3866 3866 return rval; 3867 3867 } 3868 3868 3869 - int 3870 - qla2x00_set_driver_version(scsi_qla_host_t *vha, char *version) 3871 - { 3872 - int rval; 3873 - mbx_cmd_t mc; 3874 - mbx_cmd_t *mcp = &mc; 3875 - int len; 3876 - uint16_t dwlen; 3877 - uint8_t *str; 3878 - dma_addr_t str_dma; 3879 - struct qla_hw_data *ha = vha->hw; 3880 - 3881 - if (!IS_FWI2_CAPABLE(ha) || IS_QLA82XX(ha)) 3882 - return QLA_FUNCTION_FAILED; 3883 - 3884 - ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1155, 3885 - "Entered %s.\n", __func__); 3886 - 3887 - str = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &str_dma); 3888 - if (!str) { 3889 - ql_log(ql_log_warn, vha, 0x1156, 3890 - "Failed to allocate driver version param.\n"); 3891 - return QLA_MEMORY_ALLOC_FAILED; 3892 - } 3893 - 3894 - memcpy(str, "\x7\x3\x11\x0", 4); 3895 - dwlen = str[0]; 3896 - len = dwlen * sizeof(uint32_t) - 4; 3897 - memset(str + 4, 0, len); 3898 - if (len > strlen(version)) 3899 - len = strlen(version); 3900 - memcpy(str + 4, version, len); 3901 - 3902 - mcp->mb[0] = MBC_SET_RNID_PARAMS; 3903 - mcp->mb[1] = RNID_TYPE_SET_VERSION << 8 | dwlen; 3904 - mcp->mb[2] = MSW(LSD(str_dma)); 3905 - mcp->mb[3] = LSW(LSD(str_dma)); 3906 - mcp->mb[6] = MSW(MSD(str_dma)); 3907 - mcp->mb[7] = LSW(MSD(str_dma)); 3908 - mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; 3909 - mcp->in_mb = MBX_0; 3910 - mcp->tov = MBX_TOV_SECONDS; 3911 - mcp->flags = 0; 3912 - rval = qla2x00_mailbox_command(vha, mcp); 3913 - 3914 - if (rval != QLA_SUCCESS) { 3915 - ql_dbg(ql_dbg_mbx, vha, 0x1157, 3916 - "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); 3917 - } else { 3918 - ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1158, 3919 - "Done %s.\n", __func__); 3920 - } 3921 - 3922 - dma_pool_free(ha->s_dma_pool, str, str_dma); 3923 - 3924 - return rval; 3925 - } 3926 - 3927 3869 static int 3928 3870 qla2x00_read_asic_temperature(scsi_qla_host_t *vha, uint16_t *temp) 3929 3871 {
+1 -1
drivers/scsi/qla2xxx/qla_version.h
··· 7 7 /* 8 8 * Driver version 9 9 */ 10 - #define QLA2XXX_VERSION "8.04.00.08-k" 10 + #define QLA2XXX_VERSION "8.04.00.13-k" 11 11 12 12 #define QLA_DRIVER_MAJOR_VER 8 13 13 #define QLA_DRIVER_MINOR_VER 4
+7 -1
drivers/scsi/st.c
··· 4112 4112 tpnt->disk = disk; 4113 4113 disk->private_data = &tpnt->driver; 4114 4114 disk->queue = SDp->request_queue; 4115 + /* SCSI tape doesn't register this gendisk via add_disk(). Manually 4116 + * take queue reference that release_disk() expects. */ 4117 + if (!blk_get_queue(disk->queue)) 4118 + goto out_put_disk; 4115 4119 tpnt->driver = &st_template; 4116 4120 4117 4121 tpnt->device = SDp; ··· 4189 4185 idr_preload_end(); 4190 4186 if (error < 0) { 4191 4187 pr_warn("st: idr allocation failed: %d\n", error); 4192 - goto out_put_disk; 4188 + goto out_put_queue; 4193 4189 } 4194 4190 tpnt->index = error; 4195 4191 sprintf(disk->disk_name, "st%d", tpnt->index); ··· 4215 4211 spin_lock(&st_index_lock); 4216 4212 idr_remove(&st_index_idr, tpnt->index); 4217 4213 spin_unlock(&st_index_lock); 4214 + out_put_queue: 4215 + blk_put_queue(disk->queue); 4218 4216 out_put_disk: 4219 4217 put_disk(disk); 4220 4218 kfree(tpnt);