| From 4dc0c69afa4240c1919b938f329db21f412027ba Mon Sep 17 00:00:00 2001 |
| From: Daniel Wagner <dwagner@suse.de> |
| Date: Tue, 22 Oct 2019 09:21:12 +0200 |
| Subject: [PATCH] scsi: lpfc: Honor module parameter lpfc_use_adisc |
| |
| commit 0fd103ccfe6a06e40e2d9d8c91d96332cc9e1239 upstream. |
| |
| The initial lpfc_desc_set_adisc implementation in commit |
| dea3101e0a5c ("lpfc: add Emulex FC driver version 8.0.28") enabled ADISC if |
| |
| cfg_use_adisc && RSCN_MODE && FCP_2_DEVICE |
| |
| In commit 92d7f7b0cde3 ("[SCSI] lpfc: NPIV: add NPIV support on top of |
| SLI-3") this changed to |
| |
| (cfg_use_adisc && RSC_MODE) || FCP_2_DEVICE |
| |
| and later in commit ffc954936b13 ("[SCSI] lpfc 8.3.13: FC Discovery Fixes |
| and enhancements.") to |
| |
| (cfg_use_adisc && RSC_MODE) || (FCP_2_DEVICE && FCP_TARGET) |
| |
| A customer reports that after a devloss, an ADISC failure is logged. It |
| turns out the ADISC flag is set even the user explicitly set lpfc_use_adisc |
| = 0. |
| |
| [Sat Dec 22 22:55:58 2018] lpfc 0000:82:00.0: 2:(0):0203 Devloss timeout on WWPN 50:01:43:80:12:8e:40:20 NPort x05df00 Data: x82000000 x8 xa |
| [Sat Dec 22 23:08:20 2018] lpfc 0000:82:00.0: 2:(0):2755 ADISC failure DID:05DF00 Status:x9/x70000 |
| |
| [mkp: fixed Hannes' email] |
| |
| Fixes: 92d7f7b0cde3 ("[SCSI] lpfc: NPIV: add NPIV support on top of SLI-3") |
| Cc: Dick Kennedy <dick.kennedy@broadcom.com> |
| Cc: James Smart <james.smart@broadcom.com> |
| Link: https://lore.kernel.org/r/20191022072112.132268-1-dwagner@suse.de |
| Reviewed-by: Hannes Reinecke <hare@suse.de> |
| Reviewed-by: James Smart <james.smart@broadcom.com> |
| Signed-off-by: Daniel Wagner <dwagner@suse.de> |
| Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c |
| index 59252bfca14e..41309ac65693 100644 |
| --- a/drivers/scsi/lpfc/lpfc_nportdisc.c |
| +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c |
| @@ -845,9 +845,9 @@ lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) |
| |
| if (!(vport->fc_flag & FC_PT2PT)) { |
| /* Check config parameter use-adisc or FCP-2 */ |
| - if ((vport->cfg_use_adisc && (vport->fc_flag & FC_RSCN_MODE)) || |
| + if (vport->cfg_use_adisc && ((vport->fc_flag & FC_RSCN_MODE) || |
| ((ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) && |
| - (ndlp->nlp_type & NLP_FCP_TARGET))) { |
| + (ndlp->nlp_type & NLP_FCP_TARGET)))) { |
| spin_lock_irq(shost->host_lock); |
| ndlp->nlp_flag |= NLP_NPR_ADISC; |
| spin_unlock_irq(shost->host_lock); |
| -- |
| 2.7.4 |
| |