Skip to content

Commit e268d70

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Three fixes, all in drivers. The ufs and qedi fixes are minor; the lpfc one is a bit bigger because it involves adding a heuristic to detect and deal with common but not standards compliant behaviour" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Fix divide by zero in ufshcd_map_queues() scsi: lpfc: Fix pt2pt NVMe PRLI reject LOGO loop scsi: qedi: Fix ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp()
2 parents 7747807 + 10af115 commit e268d70

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

drivers/scsi/lpfc/lpfc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ struct lpfc_vport {
592592
#define FC_VPORT_LOGO_RCVD 0x200 /* LOGO received on vport */
593593
#define FC_RSCN_DISCOVERY 0x400 /* Auth all devices after RSCN */
594594
#define FC_LOGO_RCVD_DID_CHNG 0x800 /* FDISC on phys port detect DID chng*/
595+
#define FC_PT2PT_NO_NVME 0x1000 /* Don't send NVME PRLI */
595596
#define FC_SCSI_SCAN_TMO 0x4000 /* scsi scan timer running */
596597
#define FC_ABORT_DISCOVERY 0x8000 /* we want to abort discovery */
597598
#define FC_NDISC_ACTIVE 0x10000 /* NPort discovery active */

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,9 @@ lpfc_issue_lip(struct Scsi_Host *shost)
13151315
pmboxq->u.mb.mbxCommand = MBX_DOWN_LINK;
13161316
pmboxq->u.mb.mbxOwner = OWN_HOST;
13171317

1318+
if ((vport->fc_flag & FC_PT2PT) && (vport->fc_flag & FC_PT2PT_NO_NVME))
1319+
vport->fc_flag &= ~FC_PT2PT_NO_NVME;
1320+
13181321
mbxstatus = lpfc_sli_issue_mbox_wait(phba, pmboxq, LPFC_MBOX_TMO * 2);
13191322

13201323
if ((mbxstatus == MBX_SUCCESS) &&

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,8 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
10721072

10731073
/* FLOGI failed, so there is no fabric */
10741074
spin_lock_irq(shost->host_lock);
1075-
vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP);
1075+
vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP |
1076+
FC_PT2PT_NO_NVME);
10761077
spin_unlock_irq(shost->host_lock);
10771078

10781079
/* If private loop, then allow max outstanding els to be
@@ -4607,6 +4608,23 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
46074608
/* Added for Vendor specifc support
46084609
* Just keep retrying for these Rsn / Exp codes
46094610
*/
4611+
if ((vport->fc_flag & FC_PT2PT) &&
4612+
cmd == ELS_CMD_NVMEPRLI) {
4613+
switch (stat.un.b.lsRjtRsnCode) {
4614+
case LSRJT_UNABLE_TPC:
4615+
case LSRJT_INVALID_CMD:
4616+
case LSRJT_LOGICAL_ERR:
4617+
case LSRJT_CMD_UNSUPPORTED:
4618+
lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS,
4619+
"0168 NVME PRLI LS_RJT "
4620+
"reason %x port doesn't "
4621+
"support NVME, disabling NVME\n",
4622+
stat.un.b.lsRjtRsnCode);
4623+
retry = 0;
4624+
vport->fc_flag |= FC_PT2PT_NO_NVME;
4625+
goto out_retry;
4626+
}
4627+
}
46104628
switch (stat.un.b.lsRjtRsnCode) {
46114629
case LSRJT_UNABLE_TPC:
46124630
/* The driver has a VALID PLOGI but the rport has

drivers/scsi/lpfc/lpfc_nportdisc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,8 +1961,9 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport,
19611961
* is configured try it.
19621962
*/
19631963
ndlp->nlp_fc4_type |= NLP_FC4_FCP;
1964-
if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
1965-
(vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) {
1964+
if ((!(vport->fc_flag & FC_PT2PT_NO_NVME)) &&
1965+
(vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH ||
1966+
vport->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) {
19661967
ndlp->nlp_fc4_type |= NLP_FC4_NVME;
19671968
/* We need to update the localport also */
19681969
lpfc_nvme_update_localport(vport);

drivers/scsi/qedi/qedi_fw.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,10 @@ static void qedi_process_cmd_cleanup_resp(struct qedi_ctx *qedi,
771771
qedi_cmd->list_tmf_work = NULL;
772772
}
773773
}
774+
spin_unlock_bh(&qedi_conn->tmf_work_lock);
774775

775-
if (!found) {
776-
spin_unlock_bh(&qedi_conn->tmf_work_lock);
776+
if (!found)
777777
goto check_cleanup_reqs;
778-
}
779778

780779
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_SCSI_TM,
781780
"TMF work, cqe->tid=0x%x, tmf flags=0x%x, cid=0x%x\n",
@@ -806,7 +805,6 @@ static void qedi_process_cmd_cleanup_resp(struct qedi_ctx *qedi,
806805
qedi_cmd->state = CLEANUP_RECV;
807806
unlock:
808807
spin_unlock_bh(&conn->session->back_lock);
809-
spin_unlock_bh(&qedi_conn->tmf_work_lock);
810808
wake_up_interruptible(&qedi_conn->wait_queue);
811809
return;
812810

drivers/scsi/ufs/ufshcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ static int ufshcd_map_queues(struct Scsi_Host *shost)
26812681
break;
26822682
case HCTX_TYPE_READ:
26832683
map->nr_queues = 0;
2684-
break;
2684+
continue;
26852685
default:
26862686
WARN_ON_ONCE(true);
26872687
}

0 commit comments

Comments
 (0)