Skip to contentSkip to conversation

FAILED: patch "[PATCH] scsi: lpfc: Fix broken Credit Recovery after driver load" failed to apply to 5.4-stable tree

PATCH [email protected] 2 participants 2 messages Apr 15, 2020 – Apr 16, 2020

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 835214f5d5f516a38069bc077c879c7da00d6108 Mon Sep 17 00:00:00 2001
From: James Smart <[email protected]>
Date: Mon, 27 Jan 2020 16:23:03 -0800
Subject: [PATCH] scsi: lpfc: Fix broken Credit Recovery after driver load

When driver is set to enable bb credit recovery, the switch displayed the setting as inactive. If the link bounces, it switches to Active.

During link up processing, the driver currently does a MBX_READ_SPARAM followed by a MBX_CONFIG_LINK. These mbox commands are queued to be executed, one at a time and the completion is processed by the worker thread. Since the MBX_READ_SPARAM is done BEFORE the MBX_CONFIG_LINK, the BB_SC_N bit is never set the the returned values. BB Credit recovery status only gets set after the driver requests the feature in CONFIG_LINK, which is done after the link up. Thus the ordering of READ_SPARAM needs to follow the CONFIG_LINK.

Fix by reordering so that READ_SPARAM is done after CONFIG_LINK. Added a HBA_DEFER_FLOGI flag so that any FLOGI handling waits until after the READ_SPARAM is done so that the proper BB credit value is set in the FLOGI payload.

Fixes 6bfb16208298 ("scsi: lpfc: Fix configuration of BB credit recovery in service parameters")
Cc <[email protected]> # v5.4+
drivers/scsi/lpfc/lpfc.h +1 -0
index 04d73e2be373..3f2cb17c4574 100644
@@ -749,6 +749,7 @@ struct lpfc_hba {
 					 * capability
 					 */
 #define HBA_FLOGI_ISSUED	0x100000 /* FLOGI was issued */
+#define HBA_DEFER_FLOGI		0x800000 /* Defer FLOGI till read_sparm cmpl */
 
 	uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/
 	struct lpfc_dmabuf slim2p;
drivers/scsi/lpfc/lpfc_hbadisc.c +39 -20

90 lines not on this page · raw message

maintainer
#1 lore raw
Quoted 34 lines · On Wed, Apr 15, 2020 at 01:18:47PM +0200, [email protected] wrote:

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 835214f5d5f516a38069bc077c879c7da00d6108 Mon Sep 17 00:00:00 2001
From: James Smart <[email protected]>
Date: Mon, 27 Jan 2020 16:23:03 -0800
Subject: [PATCH] scsi: lpfc: Fix broken Credit Recovery after driver load

When driver is set to enable bb credit recovery, the switch displayed the setting as inactive. If the link bounces, it switches to Active.

During link up processing, the driver currently does a MBX_READ_SPARAM followed by a MBX_CONFIG_LINK. These mbox commands are queued to be executed, one at a time and the completion is processed by the worker thread. Since the MBX_READ_SPARAM is done BEFORE the MBX_CONFIG_LINK, the BB_SC_N bit is never set the the returned values. BB Credit recovery status only gets set after the driver requests the feature in CONFIG_LINK, which is done after the link up. Thus the ordering of READ_SPARAM needs to follow the CONFIG_LINK.

Fix by reordering so that READ_SPARAM is done after CONFIG_LINK. Added a HBA_DEFER_FLOGI flag so that any FLOGI handling waits until after the READ_SPARAM is done so that the proper BB credit value is set in the FLOGI payload.

Quoted 6 lines
Fixes 6bfb16208298 ("scsi: lpfc: Fix configuration of BB credit recovery in service parameters")
Cc <[email protected]> # v5.4+

I've grabbed these additional fixes to address the conflict:

6bfb16208298 ("scsi: lpfc: Fix configuration of BB credit recovery in service parameters") e3ba04c9bad1 ("scsi: lpfc: Fix Fabric hostname registration if system hostname changes") 93a4d6f40198 ("scsi: lpfc: Add registration for CPU Offline/Online events")

Signature · 2 lines
Thanks,
Sasha