lpfc: Correct MDS diag and nvmet configuration
Subsystems (3)
PATCH 1/1 lpfc: Correct MDS diag and nvmet configuration
A recent change added some MDS processing in the lpfc_drain_txq routine that relies on the fcp_wq being allocated. For nvmet operation the fcp_wq is not allocated because it can only be an nvme-target. When the original MDS support was added LS_MDS_LOOPBACK was defined wrong, (0x16) it should have been 0x10 (decimal value used for hex setting). This incorrect value allowed MDS_LOOPBACK to be set simultaneously with LS_NPIV_FAB_SUPPORTED, causing the driver to crash when it accesses the non-existent fcp_wq.
Correct the bad value setting for LS_MDS_LOOPBACK.
--- drivers/scsi/lpfc/lpfc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc.h +1 -1
@@ -672,7 +672,7 @@ struct lpfc_hba {#define LS_NPIV_FAB_SUPPORTED 0x2/* Fabric supports NPIV */ #define LS_IGNORE_ERATT 0x4/* intr handler should ignore ERATT */ #define LS_MDS_LINK_DOWN 0x8/* MDS Diagnostics Link Down */ -#define LS_MDS_LOOPBACK 0x16/* MDS Diagnostics Link Up (Loopback) */ +#define LS_MDS_LOOPBACK 0x10/* MDS Diagnostics Link Up (Loopback) */ uint32_t hba_flag;/* hba generic flags */ #define HBA_ERATT_HANDLED 0x1/* This flag is set when eratt handled */
Signature · 1 line
2.13.1
Quoted 24 lines · James Smart
A recent change added some MDS processing in the
lpfc_drain_txqroutine that relies on thefcp_wqbeing allocated. For nvmet operation thefcp_wqis not allocated because it can only be an nvme-target. When the original MDS support was addedLS_MDS_LOOPBACKwas defined wrong, (0x16) it should have been0x10(decimal value used for hex setting). This incorrect value allowedMDS_LOOPBACKto be set simultaneously withLS_NPIV_FAB_SUPPORTED, causing the driver to crash when it accesses the non-existentfcp_wq.Correct the bad value setting for
LS_MDS_LOOPBACK.Fixes ae9e28f36a6c ("lpfc: Add MDS Diagnostic support.")Cc <[email protected]> # 4.12Signed-off-by Dick Kennedy <[email protected]>Signed-off-by James Smart <[email protected]>--- drivers/scsi/lpfc/lpfc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/lpfc/lpfc.h +0
-0
drivers/scsi/lpfc/lpfc.h struct lpfc_hba { · line 678
Quoted 8 lines
drivers/scsi/lpfc/lpfc.h +1
-1@@ -672,7 +672,7 @@ struct lpfc_hba {#define LS_NPIV_FAB_SUPPORTED 0x2/* Fabric supports NPIV */ #define LS_IGNORE_ERATT 0x4/* intr handler should ignore ERATT */ #define LS_MDS_LINK_DOWN 0x8/* MDS Diagnostics Link Down */ -#define LS_MDS_LOOPBACK 0x16/* MDS Diagnostics Link Up (Loopback) */ +#define LS_MDS_LOOPBACK 0x10/* MDS Diagnostics Link Up (Loopback) */ uint32_t hba_flag;/* hba generic flags */ #define HBA_ERATT_HANDLED 0x1/* This flag is set when eratt handled */
Fixes driver crash when lpfc_enable_nvmet used.
Martin K. Petersen
AppliedJames,
Quoted 10 lines
A recent change added some MDS processing in the
lpfc_drain_txqroutine that relies on thefcp_wqbeing allocated. For nvmet operation thefcp_wqis not allocated because it can only be an nvme-target. When the original MDS support was addedLS_MDS_LOOPBACKwas defined wrong, (0x16) it should have been0x10(decimal value used for hex setting). This incorrect value allowedMDS_LOOPBACKto be set simultaneously withLS_NPIV_FAB_SUPPORTED, causing the driver to crash when it accesses the non-existentfcp_wq.Correct the bad value setting for
LS_MDS_LOOPBACK.
Applied to 4.19/scsi-fixes, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering