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.
Unified · Split
| @@ -325,7 +325,7 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc) · 324 unmodified lines | ||
| 325 | 325 | if (!abrt_task->sc || abrt_task->state == ISCSI_TASK_FREE) |
| 326 | 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 | 329 | continue; |
| 330 | 330 | |
| 331 | 331 | /* Invalidate WRB Posted for this Task */ |
| @@ -311,9 +311,8 @@ static inline struct Scsi_Host *to_shost(struct isci_host *ihost) · 310 unmodified lines | ||
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | #define for_each_isci_host(id, ihost, pdev) \ |
| 314 | − for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ | |
| 315 | − id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ | |
| 316 | − ihost = to_pci_info(pdev)->hosts[++id]) | |
| 314 | + for (id = 0; id < SCI_MAX_CONTROLLERS && \ | |
| 315 | + (ihost = to_pci_info(pdev)->hosts[id]); id++) | |
| 317 | 316 | |
| 318 | 317 | static inline void wait_for_start(struct isci_host *ihost) |
| 319 | 318 | { |
| @@ -615,13 +615,6 @@ static void sci_apc_agent_link_up(struct isci_host *ihost, · 614 unmodified lines | ||
| 615 | 615 | SCIC_SDS_APC_WAIT_LINK_UP_NOTIFICATION); |
| 616 | 616 | } else { |
| 617 | 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 | 618 | port_agent->phy_ready_mask |= 1 << phy_index; |
| 626 | 619 | sci_port_link_up(iport, iphy); |
| 627 | 620 | } |
| @@ -801,7 +801,7 @@ int isci_task_I_T_nexus_reset(struct domain_device *dev) · 800 unmodified lines | ||
| 801 | 801 | /* XXX: need to cleanup any ireqs targeting this |
| 802 | 802 | * domain_device |
| 803 | 803 | */ |
| 804 | − ret = TMF_RESP_FUNC_COMPLETE; | |
| 804 | + ret = -ENODEV; | |
| 805 | 805 | goto out; |
| 806 | 806 | } |
| 807 | 807 | |
| @@ -2996,8 +2996,7 @@ struct qla_hw_data { · 2995 unmodified lines | ||
| 2996 | 2996 | IS_QLA82XX(ha) || IS_QLA83XX(ha) || \ |
| 2997 | 2997 | IS_QLA8044(ha)) |
| 2998 | 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) || \ | |
| 3000 | − IS_QLA83XX(ha)) && (ha)->flags.msix_enabled) | |
| 2999 | +#define IS_NOPOLLING_TYPE(ha) (IS_QLA81XX(ha) && (ha)->flags.msix_enabled) | |
| 3001 | 3000 | #define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
| 3002 | 3001 | #define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha)) |
| 3003 | 3002 | #define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha)) |
| @@ -2880,6 +2880,7 @@ static int · 2879 unmodified lines | ||
| 2880 | 2880 | qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) |
| 2881 | 2881 | { |
| 2882 | 2882 | #define MIN_MSIX_COUNT 2 |
| 2883 | +#define ATIO_VECTOR 2 | |
| 2883 | 2884 | int i, ret; |
| 2884 | 2885 | struct msix_entry *entries; |
| 2885 | 2886 | struct qla_msix_entry *qentry; |
| @@ -2936,34 +2937,47 @@ msix_failed: · 50 unmodified lines | ||
| 2936 | 2937 | } |
| 2937 | 2938 | |
| 2938 | 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 | 2941 | qentry = &ha->msix_entries[i]; |
| 2941 | − if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(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)) { | |
| 2942 | + if (IS_P3P_TYPE(ha)) | |
| 2946 | 2943 | ret = request_irq(qentry->vector, |
| 2947 | 2944 | qla82xx_msix_entries[i].handler, |
| 2948 | 2945 | 0, qla82xx_msix_entries[i].name, rsp); |
| 2949 | − } else { | |
| 2946 | + else | |
| 2950 | 2947 | ret = request_irq(qentry->vector, |
| 2951 | 2948 | msix_entries[i].handler, |
| 2952 | 2949 | 0, msix_entries[i].name, rsp); |
| 2953 | − } | |
| 2954 | − if (ret) { | |
| 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 | − } | |
| 2950 | + if (ret) | |
| 2951 | + goto msix_register_fail; | |
| 2962 | 2952 | qentry->have_irq = 1; |
| 2963 | 2953 | qentry->rsp = rsp; |
| 2964 | 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 | 2981 | /* Enable MSI-X vector for response queue update for queue 0 */ |
| 2968 | 2982 | if (IS_QLA83XX(ha)) { |
| 2969 | 2983 | if (ha->msixbase && ha->mqiobase && |
| @@ -1419,6 +1419,9 @@ static void storvsc_device_destroy(struct scsi_device *sdevice) · 1418 unmodified lines | ||
| 1419 | 1419 | { |
| 1420 | 1420 | struct stor_mem_pools *memp = sdevice->hostdata; |
| 1421 | 1421 | |
| 1422 | + if (!memp) | |
| 1423 | + return; | |
| 1424 | + | |
| 1422 | 1425 | mempool_destroy(memp->request_mempool); |
| 1423 | 1426 | kmem_cache_destroy(memp->request_pool); |
| 1424 | 1427 | kfree(memp); |