diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2017-02-03 16:18:03 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2017-02-03 16:18:03 -0500 |
commit | ad3efdb72cd921ec52ac94e82595a5d2e7a7b054 (patch) | |
tree | 82046c4821f443614dfd5e507f0edcda95e21f63 | |
parent | 6f3e71c0c3f2479e05682e2e563b75decab36591 (diff) | |
parent | f2e767bb5d6ee0d988cb7d4e54b0b21175802b6b (diff) |
Merge remote-tracking branch 'mkp-scsi/4.10/scsi-fixes' into fixes
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_scsih.c | 15 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 75f3fce1c867..268103182d34 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | |||
@@ -4657,6 +4657,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) | |||
4657 | struct MPT3SAS_DEVICE *sas_device_priv_data; | 4657 | struct MPT3SAS_DEVICE *sas_device_priv_data; |
4658 | u32 response_code = 0; | 4658 | u32 response_code = 0; |
4659 | unsigned long flags; | 4659 | unsigned long flags; |
4660 | unsigned int sector_sz; | ||
4660 | 4661 | ||
4661 | mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply); | 4662 | mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply); |
4662 | scmd = _scsih_scsi_lookup_get_clear(ioc, smid); | 4663 | scmd = _scsih_scsi_lookup_get_clear(ioc, smid); |
@@ -4715,6 +4716,20 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) | |||
4715 | } | 4716 | } |
4716 | 4717 | ||
4717 | xfer_cnt = le32_to_cpu(mpi_reply->TransferCount); | 4718 | xfer_cnt = le32_to_cpu(mpi_reply->TransferCount); |
4719 | |||
4720 | /* In case of bogus fw or device, we could end up having | ||
4721 | * unaligned partial completion. We can force alignment here, | ||
4722 | * then scsi-ml does not need to handle this misbehavior. | ||
4723 | */ | ||
4724 | sector_sz = scmd->device->sector_size; | ||
4725 | if (unlikely(scmd->request->cmd_type == REQ_TYPE_FS && sector_sz && | ||
4726 | xfer_cnt % sector_sz)) { | ||
4727 | sdev_printk(KERN_INFO, scmd->device, | ||
4728 | "unaligned partial completion avoided (xfer_cnt=%u, sector_sz=%u)\n", | ||
4729 | xfer_cnt, sector_sz); | ||
4730 | xfer_cnt = round_down(xfer_cnt, sector_sz); | ||
4731 | } | ||
4732 | |||
4718 | scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_cnt); | 4733 | scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_cnt); |
4719 | if (ioc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) | 4734 | if (ioc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) |
4720 | log_info = le32_to_cpu(mpi_reply->IOCLogInfo); | 4735 | log_info = le32_to_cpu(mpi_reply->IOCLogInfo); |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 54e1223b66d7..28ffafe473e9 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -3238,7 +3238,7 @@ qla2x00_free_irqs(scsi_qla_host_t *vha) | |||
3238 | * from a probe failure context. | 3238 | * from a probe failure context. |
3239 | */ | 3239 | */ |
3240 | if (!ha->rsp_q_map || !ha->rsp_q_map[0]) | 3240 | if (!ha->rsp_q_map || !ha->rsp_q_map[0]) |
3241 | return; | 3241 | goto free_irqs; |
3242 | rsp = ha->rsp_q_map[0]; | 3242 | rsp = ha->rsp_q_map[0]; |
3243 | 3243 | ||
3244 | if (ha->flags.msix_enabled) { | 3244 | if (ha->flags.msix_enabled) { |
@@ -3258,6 +3258,7 @@ qla2x00_free_irqs(scsi_qla_host_t *vha) | |||
3258 | free_irq(pci_irq_vector(ha->pdev, 0), rsp); | 3258 | free_irq(pci_irq_vector(ha->pdev, 0), rsp); |
3259 | } | 3259 | } |
3260 | 3260 | ||
3261 | free_irqs: | ||
3261 | pci_free_irq_vectors(ha->pdev); | 3262 | pci_free_irq_vectors(ha->pdev); |
3262 | } | 3263 | } |
3263 | 3264 | ||
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index ad4edc13ebcf..1cd3c48a6350 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1616,7 +1616,7 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) | |||
1616 | /* Don't abort commands in adapter during EEH | 1616 | /* Don't abort commands in adapter during EEH |
1617 | * recovery as it's not accessible/responding. | 1617 | * recovery as it's not accessible/responding. |
1618 | */ | 1618 | */ |
1619 | if (!ha->flags.eeh_busy) { | 1619 | if (GET_CMD_SP(sp) && !ha->flags.eeh_busy) { |
1620 | /* Get a reference to the sp and drop the lock. | 1620 | /* Get a reference to the sp and drop the lock. |
1621 | * The reference ensures this sp->done() call | 1621 | * The reference ensures this sp->done() call |
1622 | * - and not the call in qla2xxx_eh_abort() - | 1622 | * - and not the call in qla2xxx_eh_abort() - |