diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-11-02 14:15:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-11-02 14:15:52 -0400 |
commit | f83e148a410006397f01e96570e73038a3a261fa (patch) | |
tree | cb836de25c9a2adea2ffe096bdec85f405b059bf | |
parent | 8194c28efd96127cd1948ca48f3fe374e04cbf46 (diff) | |
parent | d3566abb1a1e7772116e4d50fb6a58d19c9802e5 (diff) |
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"Nine changes, eight in drivers [ufs, target, lpfc x 2, qla2xxx x 4]
and one core change in sd that fixes an I/O failure on DIF type 3
devices"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: qla2xxx: stop timer in shutdown path
scsi: sd: define variable dif as unsigned int instead of bool
scsi: target: cxgbit: Fix cxgbit_fw4_ack()
scsi: qla2xxx: Fix partial flash write of MBI
scsi: qla2xxx: Initialized mailbox to prevent driver load failure
scsi: lpfc: Honor module parameter lpfc_use_adisc
scsi: ufs-bsg: Wake the device before sending raw upiu commands
scsi: lpfc: Check queue pointer before use
scsi: qla2xxx: fixup incorrect usage of host_byte
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nportdisc.c | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 7 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_bsg.c | 6 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 4 | ||||
-rw-r--r-- | drivers/scsi/sd.c | 3 | ||||
-rw-r--r-- | drivers/scsi/ufs/ufs_bsg.c | 4 | ||||
-rw-r--r-- | drivers/target/iscsi/cxgbit/cxgbit_cm.c | 3 |
9 files changed, 23 insertions, 13 deletions
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index f4b879d25fe9..fc6e4546d738 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c | |||
@@ -851,9 +851,9 @@ lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
851 | 851 | ||
852 | if (!(vport->fc_flag & FC_PT2PT)) { | 852 | if (!(vport->fc_flag & FC_PT2PT)) { |
853 | /* Check config parameter use-adisc or FCP-2 */ | 853 | /* Check config parameter use-adisc or FCP-2 */ |
854 | if ((vport->cfg_use_adisc && (vport->fc_flag & FC_RSCN_MODE)) || | 854 | if (vport->cfg_use_adisc && ((vport->fc_flag & FC_RSCN_MODE) || |
855 | ((ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) && | 855 | ((ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) && |
856 | (ndlp->nlp_type & NLP_FCP_TARGET))) { | 856 | (ndlp->nlp_type & NLP_FCP_TARGET)))) { |
857 | spin_lock_irq(shost->host_lock); | 857 | spin_lock_irq(shost->host_lock); |
858 | ndlp->nlp_flag |= NLP_NPR_ADISC; | 858 | ndlp->nlp_flag |= NLP_NPR_ADISC; |
859 | spin_unlock_irq(shost->host_lock); | 859 | spin_unlock_irq(shost->host_lock); |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index a0c6945b8139..614f78dddafe 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -7866,7 +7866,7 @@ lpfc_sli4_process_missed_mbox_completions(struct lpfc_hba *phba) | |||
7866 | if (sli4_hba->hdwq) { | 7866 | if (sli4_hba->hdwq) { |
7867 | for (eqidx = 0; eqidx < phba->cfg_irq_chann; eqidx++) { | 7867 | for (eqidx = 0; eqidx < phba->cfg_irq_chann; eqidx++) { |
7868 | eq = phba->sli4_hba.hba_eq_hdl[eqidx].eq; | 7868 | eq = phba->sli4_hba.hba_eq_hdl[eqidx].eq; |
7869 | if (eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { | 7869 | if (eq && eq->queue_id == sli4_hba->mbx_cq->assoc_qid) { |
7870 | fpeq = eq; | 7870 | fpeq = eq; |
7871 | break; | 7871 | break; |
7872 | } | 7872 | } |
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 30bafd9d21e9..7259bce85e0e 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -440,9 +440,6 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, | |||
440 | valid = 0; | 440 | valid = 0; |
441 | if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) | 441 | if (ha->optrom_size == OPTROM_SIZE_2300 && start == 0) |
442 | valid = 1; | 442 | valid = 1; |
443 | else if (start == (ha->flt_region_boot * 4) || | ||
444 | start == (ha->flt_region_fw * 4)) | ||
445 | valid = 1; | ||
446 | else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) | 443 | else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) |
447 | valid = 1; | 444 | valid = 1; |
448 | if (!valid) { | 445 | if (!valid) { |
@@ -489,8 +486,10 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, | |||
489 | "Writing flash region -- 0x%x/0x%x.\n", | 486 | "Writing flash region -- 0x%x/0x%x.\n", |
490 | ha->optrom_region_start, ha->optrom_region_size); | 487 | ha->optrom_region_start, ha->optrom_region_size); |
491 | 488 | ||
492 | ha->isp_ops->write_optrom(vha, ha->optrom_buffer, | 489 | rval = ha->isp_ops->write_optrom(vha, ha->optrom_buffer, |
493 | ha->optrom_region_start, ha->optrom_region_size); | 490 | ha->optrom_region_start, ha->optrom_region_size); |
491 | if (rval) | ||
492 | rval = -EIO; | ||
494 | break; | 493 | break; |
495 | default: | 494 | default: |
496 | rval = -EINVAL; | 495 | rval = -EINVAL; |
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 28d587a89ba6..99f0a1a08143 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
@@ -253,7 +253,7 @@ qla2x00_process_els(struct bsg_job *bsg_job) | |||
253 | srb_t *sp; | 253 | srb_t *sp; |
254 | const char *type; | 254 | const char *type; |
255 | int req_sg_cnt, rsp_sg_cnt; | 255 | int req_sg_cnt, rsp_sg_cnt; |
256 | int rval = (DRIVER_ERROR << 16); | 256 | int rval = (DID_ERROR << 16); |
257 | uint16_t nextlid = 0; | 257 | uint16_t nextlid = 0; |
258 | 258 | ||
259 | if (bsg_request->msgcode == FC_BSG_RPT_ELS) { | 259 | if (bsg_request->msgcode == FC_BSG_RPT_ELS) { |
@@ -432,7 +432,7 @@ qla2x00_process_ct(struct bsg_job *bsg_job) | |||
432 | struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); | 432 | struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); |
433 | scsi_qla_host_t *vha = shost_priv(host); | 433 | scsi_qla_host_t *vha = shost_priv(host); |
434 | struct qla_hw_data *ha = vha->hw; | 434 | struct qla_hw_data *ha = vha->hw; |
435 | int rval = (DRIVER_ERROR << 16); | 435 | int rval = (DID_ERROR << 16); |
436 | int req_sg_cnt, rsp_sg_cnt; | 436 | int req_sg_cnt, rsp_sg_cnt; |
437 | uint16_t loop_id; | 437 | uint16_t loop_id; |
438 | struct fc_port *fcport; | 438 | struct fc_port *fcport; |
@@ -1950,7 +1950,7 @@ qlafx00_mgmt_cmd(struct bsg_job *bsg_job) | |||
1950 | struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); | 1950 | struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); |
1951 | scsi_qla_host_t *vha = shost_priv(host); | 1951 | scsi_qla_host_t *vha = shost_priv(host); |
1952 | struct qla_hw_data *ha = vha->hw; | 1952 | struct qla_hw_data *ha = vha->hw; |
1953 | int rval = (DRIVER_ERROR << 16); | 1953 | int rval = (DID_ERROR << 16); |
1954 | struct qla_mt_iocb_rqst_fx00 *piocb_rqst; | 1954 | struct qla_mt_iocb_rqst_fx00 *piocb_rqst; |
1955 | srb_t *sp; | 1955 | srb_t *sp; |
1956 | int req_sg_cnt = 0, rsp_sg_cnt = 0; | 1956 | int req_sg_cnt = 0, rsp_sg_cnt = 0; |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 1cc6913f76c4..4a1f21c11758 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -702,6 +702,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) | |||
702 | mcp->mb[2] = LSW(risc_addr); | 702 | mcp->mb[2] = LSW(risc_addr); |
703 | mcp->mb[3] = 0; | 703 | mcp->mb[3] = 0; |
704 | mcp->mb[4] = 0; | 704 | mcp->mb[4] = 0; |
705 | mcp->mb[11] = 0; | ||
705 | ha->flags.using_lr_setting = 0; | 706 | ha->flags.using_lr_setting = 0; |
706 | if (IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha) || | 707 | if (IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha) || |
707 | IS_QLA27XX(ha) || IS_QLA28XX(ha)) { | 708 | IS_QLA27XX(ha) || IS_QLA28XX(ha)) { |
@@ -746,7 +747,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) | |||
746 | if (ha->flags.exchoffld_enabled) | 747 | if (ha->flags.exchoffld_enabled) |
747 | mcp->mb[4] |= ENABLE_EXCHANGE_OFFLD; | 748 | mcp->mb[4] |= ENABLE_EXCHANGE_OFFLD; |
748 | 749 | ||
749 | mcp->out_mb |= MBX_4|MBX_3|MBX_2|MBX_1; | 750 | mcp->out_mb |= MBX_4 | MBX_3 | MBX_2 | MBX_1 | MBX_11; |
750 | mcp->in_mb |= MBX_3 | MBX_2 | MBX_1; | 751 | mcp->in_mb |= MBX_3 | MBX_2 | MBX_1; |
751 | } else { | 752 | } else { |
752 | mcp->mb[1] = LSW(risc_addr); | 753 | mcp->mb[1] = LSW(risc_addr); |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index bcb1e8598888..337162ac3a77 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -3535,6 +3535,10 @@ qla2x00_shutdown(struct pci_dev *pdev) | |||
3535 | qla2x00_try_to_stop_firmware(vha); | 3535 | qla2x00_try_to_stop_firmware(vha); |
3536 | } | 3536 | } |
3537 | 3537 | ||
3538 | /* Disable timer */ | ||
3539 | if (vha->timer_active) | ||
3540 | qla2x00_stop_timer(vha); | ||
3541 | |||
3538 | /* Turn adapter off line */ | 3542 | /* Turn adapter off line */ |
3539 | vha->flags.online = 0; | 3543 | vha->flags.online = 0; |
3540 | 3544 | ||
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 03163ac5fe95..ebb40160539f 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1166,11 +1166,12 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd) | |||
1166 | sector_t lba = sectors_to_logical(sdp, blk_rq_pos(rq)); | 1166 | sector_t lba = sectors_to_logical(sdp, blk_rq_pos(rq)); |
1167 | sector_t threshold; | 1167 | sector_t threshold; |
1168 | unsigned int nr_blocks = sectors_to_logical(sdp, blk_rq_sectors(rq)); | 1168 | unsigned int nr_blocks = sectors_to_logical(sdp, blk_rq_sectors(rq)); |
1169 | bool dif, dix; | ||
1170 | unsigned int mask = logical_to_sectors(sdp, 1) - 1; | 1169 | unsigned int mask = logical_to_sectors(sdp, 1) - 1; |
1171 | bool write = rq_data_dir(rq) == WRITE; | 1170 | bool write = rq_data_dir(rq) == WRITE; |
1172 | unsigned char protect, fua; | 1171 | unsigned char protect, fua; |
1173 | blk_status_t ret; | 1172 | blk_status_t ret; |
1173 | unsigned int dif; | ||
1174 | bool dix; | ||
1174 | 1175 | ||
1175 | ret = scsi_init_io(cmd); | 1176 | ret = scsi_init_io(cmd); |
1176 | if (ret != BLK_STS_OK) | 1177 | if (ret != BLK_STS_OK) |
diff --git a/drivers/scsi/ufs/ufs_bsg.c b/drivers/scsi/ufs/ufs_bsg.c index a9344eb4e047..dc2f6d2b46ed 100644 --- a/drivers/scsi/ufs/ufs_bsg.c +++ b/drivers/scsi/ufs/ufs_bsg.c | |||
@@ -98,6 +98,8 @@ static int ufs_bsg_request(struct bsg_job *job) | |||
98 | 98 | ||
99 | bsg_reply->reply_payload_rcv_len = 0; | 99 | bsg_reply->reply_payload_rcv_len = 0; |
100 | 100 | ||
101 | pm_runtime_get_sync(hba->dev); | ||
102 | |||
101 | msgcode = bsg_request->msgcode; | 103 | msgcode = bsg_request->msgcode; |
102 | switch (msgcode) { | 104 | switch (msgcode) { |
103 | case UPIU_TRANSACTION_QUERY_REQ: | 105 | case UPIU_TRANSACTION_QUERY_REQ: |
@@ -135,6 +137,8 @@ static int ufs_bsg_request(struct bsg_job *job) | |||
135 | break; | 137 | break; |
136 | } | 138 | } |
137 | 139 | ||
140 | pm_runtime_put_sync(hba->dev); | ||
141 | |||
138 | if (!desc_buff) | 142 | if (!desc_buff) |
139 | goto out; | 143 | goto out; |
140 | 144 | ||
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c index c70caf4ea490..a2b5c796bbc4 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c | |||
@@ -1831,7 +1831,7 @@ static void cxgbit_fw4_ack(struct cxgbit_sock *csk, struct sk_buff *skb) | |||
1831 | 1831 | ||
1832 | while (credits) { | 1832 | while (credits) { |
1833 | struct sk_buff *p = cxgbit_sock_peek_wr(csk); | 1833 | struct sk_buff *p = cxgbit_sock_peek_wr(csk); |
1834 | const u32 csum = (__force u32)p->csum; | 1834 | u32 csum; |
1835 | 1835 | ||
1836 | if (unlikely(!p)) { | 1836 | if (unlikely(!p)) { |
1837 | pr_err("csk 0x%p,%u, cr %u,%u+%u, empty.\n", | 1837 | pr_err("csk 0x%p,%u, cr %u,%u+%u, empty.\n", |
@@ -1840,6 +1840,7 @@ static void cxgbit_fw4_ack(struct cxgbit_sock *csk, struct sk_buff *skb) | |||
1840 | break; | 1840 | break; |
1841 | } | 1841 | } |
1842 | 1842 | ||
1843 | csum = (__force u32)p->csum; | ||
1843 | if (unlikely(credits < csum)) { | 1844 | if (unlikely(credits < csum)) { |
1844 | pr_warn("csk 0x%p,%u, cr %u,%u+%u, < %u.\n", | 1845 | pr_warn("csk 0x%p,%u, cr %u,%u+%u, < %u.\n", |
1845 | csk, csk->tid, | 1846 | csk, csk->tid, |