diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-15 15:41:53 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-15 15:41:53 -0400 |
| commit | 3b4df68d0697129c172e66fd925cf32192044f9a (patch) | |
| tree | 9616a0aa2f0f54cec53d6639912d2ad0ccc4fcc6 | |
| parent | a4ecdf82f8ea49f7d3a072121dcbd0bf3a7cb93a (diff) | |
| parent | b12bb60d6c350b348a4e1460cd68f97ccae9822e (diff) | |
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 six fixes. Two are instant crash/null deref types
(storvsc and isci). The two qla2xxx are initialisation problems that
cause MSI-X failures and card misdetection, the isci erroneous macro
is actually illegal C that's causing a miscompile with certain gcc
versions and the be2iscsi bad if expression is a static checker fix"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
[SCSI] storvsc: NULL pointer dereference fix
[SCSI] qla2xxx: Poll during initialization for ISP25xx and ISP83xx
[SCSI] isci: correct erroneous for_each_isci_host macro
[SCSI] isci: fix reset timeout handling
[SCSI] be2iscsi: fix bad if expression
[SCSI] qla2xxx: Fix multiqueue MSI-X registration.
| -rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/isci/host.h | 5 | ||||
| -rw-r--r-- | drivers/scsi/isci/port_config.c | 7 | ||||
| -rw-r--r-- | drivers/scsi/isci/task.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 3 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 46 | ||||
| -rw-r--r-- | drivers/scsi/storvsc_drv.c | 3 |
7 files changed, 38 insertions, 30 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 1f375051483a..5642a9b250c2 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
| @@ -325,7 +325,7 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc) | |||
| 325 | if (!abrt_task->sc || abrt_task->state == ISCSI_TASK_FREE) | 325 | if (!abrt_task->sc || abrt_task->state == ISCSI_TASK_FREE) |
| 326 | continue; | 326 | continue; |
| 327 | 327 | ||
| 328 | if (abrt_task->sc->device->lun != abrt_task->sc->device->lun) | 328 | if (sc->device->lun != abrt_task->sc->device->lun) |
| 329 | continue; | 329 | continue; |
| 330 | 330 | ||
| 331 | /* Invalidate WRB Posted for this Task */ | 331 | /* Invalidate WRB Posted for this Task */ |
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index 4911310a38f5..22a9bb1abae1 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h | |||
| @@ -311,9 +311,8 @@ static inline struct Scsi_Host *to_shost(struct isci_host *ihost) | |||
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | #define for_each_isci_host(id, ihost, pdev) \ | 313 | #define for_each_isci_host(id, ihost, pdev) \ |
| 314 | for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ | 314 | for (id = 0; id < SCI_MAX_CONTROLLERS && \ |
| 315 | id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ | 315 | (ihost = to_pci_info(pdev)->hosts[id]); id++) |
| 316 | ihost = to_pci_info(pdev)->hosts[++id]) | ||
| 317 | 316 | ||
| 318 | static inline void wait_for_start(struct isci_host *ihost) | 317 | static inline void wait_for_start(struct isci_host *ihost) |
| 319 | { | 318 | { |
diff --git a/drivers/scsi/isci/port_config.c b/drivers/scsi/isci/port_config.c index 85c77f6b802b..ac879745ef80 100644 --- a/drivers/scsi/isci/port_config.c +++ b/drivers/scsi/isci/port_config.c | |||
| @@ -615,13 +615,6 @@ static void sci_apc_agent_link_up(struct isci_host *ihost, | |||
| 615 | SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION); | 615 | SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION); |
| 616 | } else { | 616 | } else { |
| 617 | /* the phy is already the part of the port */ | 617 | /* the phy is already the part of the port */ |
| 618 | u32 port_state = iport->sm.current_state_id; | ||
| 619 | |||
| 620 | /* if the PORT'S state is resetting then the link up is from | ||
| 621 | * port hard reset in this case, we need to tell the port | ||
| 622 | * that link up is recieved | ||
| 623 | */ | ||
| 624 | BUG_ON(port_state != SCI_PORT_RESETTING); | ||
| 625 | port_agent->phy_ready_mask |= 1 << phy_index; | 618 | port_agent->phy_ready_mask |= 1 << phy_index; |
| 626 | sci_port_link_up(iport, iphy); | 619 | sci_port_link_up(iport, iphy); |
| 627 | } | 620 | } |
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index 0d30ca849e8f..5d6fda72d659 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
| @@ -801,7 +801,7 @@ int isci_task_I_T_nexus_reset(struct domain_device *dev) | |||
| 801 | /* XXX: need to cleanup any ireqs targeting this | 801 | /* XXX: need to cleanup any ireqs targeting this |
| 802 | * domain_device | 802 | * domain_device |
| 803 | */ | 803 | */ |
| 804 | ret = TMF_RESP_FUNC_COMPLETE; | 804 | ret = -ENODEV; |
| 805 | goto out; | 805 | goto out; |
| 806 | } | 806 | } |
| 807 | 807 | ||
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index e1fe95ef23e1..266724b6b899 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
| @@ -2996,8 +2996,7 @@ struct qla_hw_data { | |||
| 2996 | IS_QLA82XX(ha) || IS_QLA83XX(ha) || \ | 2996 | IS_QLA82XX(ha) || IS_QLA83XX(ha) || \ |
| 2997 | IS_QLA8044(ha)) | 2997 | IS_QLA8044(ha)) |
| 2998 | #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) | 2998 | #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
| 2999 | #define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha) || \ | 2999 | #define IS_NOPOLLING_TYPE(ha) (IS_QLA81XX(ha) && (ha)->flags.msix_enabled) |
| 3000 | IS_QLA83XX(ha)) && (ha)->flags.msix_enabled) | ||
| 3001 | #define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) | 3000 | #define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
| 3002 | #define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) | 3001 | #define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
| 3003 | #define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha)) | 3002 | #define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha)) |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 9bc86b9e86b1..0a1dcb43d18b 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
| @@ -2880,6 +2880,7 @@ static int | |||
| 2880 | qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) | 2880 | qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) |
| 2881 | { | 2881 | { |
| 2882 | #define MIN_MSIX_COUNT 2 | 2882 | #define MIN_MSIX_COUNT 2 |
| 2883 | #define ATIO_VECTOR 2 | ||
| 2883 | int i, ret; | 2884 | int i, ret; |
| 2884 | struct msix_entry *entries; | 2885 | struct msix_entry *entries; |
| 2885 | struct qla_msix_entry *qentry; | 2886 | struct qla_msix_entry *qentry; |
| @@ -2936,34 +2937,47 @@ msix_failed: | |||
| 2936 | } | 2937 | } |
| 2937 | 2938 | ||
| 2938 | /* Enable MSI-X vectors for the base queue */ | 2939 | /* Enable MSI-X vectors for the base queue */ |
| 2939 | for (i = 0; i < ha->msix_count; i++) { | 2940 | for (i = 0; i < 2; i++) { |
| 2940 | qentry = &ha->msix_entries[i]; | 2941 | qentry = &ha->msix_entries[i]; |
| 2941 | if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { | 2942 | if (IS_P3P_TYPE(ha)) |
| 2942 | ret = request_irq(qentry->vector, | ||
| 2943 | qla83xx_msix_entries[i].handler, | ||
| 2944 | 0, qla83xx_msix_entries[i].name, rsp); | ||
| 2945 | } else if (IS_P3P_TYPE(ha)) { | ||
| 2946 | ret = request_irq(qentry->vector, | 2943 | ret = request_irq(qentry->vector, |
| 2947 | qla82xx_msix_entries[i].handler, | 2944 | qla82xx_msix_entries[i].handler, |
| 2948 | 0, qla82xx_msix_entries[i].name, rsp); | 2945 | 0, qla82xx_msix_entries[i].name, rsp); |
| 2949 | } else { | 2946 | else |
| 2950 | ret = request_irq(qentry->vector, | 2947 | ret = request_irq(qentry->vector, |
| 2951 | msix_entries[i].handler, | 2948 | msix_entries[i].handler, |
| 2952 | 0, msix_entries[i].name, rsp); | 2949 | 0, msix_entries[i].name, rsp); |
| 2953 | } | 2950 | if (ret) |
| 2954 | if (ret) { | 2951 | goto msix_register_fail; |
| 2955 | ql_log(ql_log_fatal, vha, 0x00cb, | ||
| 2956 | "MSI-X: unable to register handler -- %x/%d.\n", | ||
| 2957 | qentry->vector, ret); | ||
| 2958 | qla24xx_disable_msix(ha); | ||
| 2959 | ha->mqenable = 0; | ||
| 2960 | goto msix_out; | ||
| 2961 | } | ||
| 2962 | qentry->have_irq = 1; | 2952 | qentry->have_irq = 1; |
| 2963 | qentry->rsp = rsp; | 2953 | qentry->rsp = rsp; |
| 2964 | rsp->msix = qentry; | 2954 | rsp->msix = qentry; |
| 2965 | } | 2955 | } |
| 2966 | 2956 | ||
| 2957 | /* | ||
| 2958 | * If target mode is enable, also request the vector for the ATIO | ||
| 2959 | * queue. | ||
| 2960 | */ | ||
| 2961 | if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { | ||
| 2962 | qentry = &ha->msix_entries[ATIO_VECTOR]; | ||
| 2963 | ret = request_irq(qentry->vector, | ||
| 2964 | qla83xx_msix_entries[ATIO_VECTOR].handler, | ||
| 2965 | 0, qla83xx_msix_entries[ATIO_VECTOR].name, rsp); | ||
| 2966 | qentry->have_irq = 1; | ||
| 2967 | qentry->rsp = rsp; | ||
| 2968 | rsp->msix = qentry; | ||
| 2969 | } | ||
| 2970 | |||
| 2971 | msix_register_fail: | ||
| 2972 | if (ret) { | ||
| 2973 | ql_log(ql_log_fatal, vha, 0x00cb, | ||
| 2974 | "MSI-X: unable to register handler -- %x/%d.\n", | ||
| 2975 | qentry->vector, ret); | ||
| 2976 | qla24xx_disable_msix(ha); | ||
| 2977 | ha->mqenable = 0; | ||
| 2978 | goto msix_out; | ||
| 2979 | } | ||
| 2980 | |||
| 2967 | /* Enable MSI-X vector for response queue update for queue 0 */ | 2981 | /* Enable MSI-X vector for response queue update for queue 0 */ |
| 2968 | if (IS_QLA83XX(ha)) { | 2982 | if (IS_QLA83XX(ha)) { |
| 2969 | if (ha->msixbase && ha->mqiobase && | 2983 | if (ha->msixbase && ha->mqiobase && |
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 17d740427240..9969fa1ef7c4 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c | |||
| @@ -1419,6 +1419,9 @@ static void storvsc_device_destroy(struct scsi_device *sdevice) | |||
| 1419 | { | 1419 | { |
| 1420 | struct stor_mem_pools *memp = sdevice->hostdata; | 1420 | struct stor_mem_pools *memp = sdevice->hostdata; |
| 1421 | 1421 | ||
| 1422 | if (!memp) | ||
| 1423 | return; | ||
| 1424 | |||
| 1422 | mempool_destroy(memp->request_mempool); | 1425 | mempool_destroy(memp->request_mempool); |
| 1423 | kmem_cache_destroy(memp->request_pool); | 1426 | kmem_cache_destroy(memp->request_pool); |
