]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
scsi: lpfc: Fix broken Credit Recovery after driver load
authorJames Smart <jsmart2021@gmail.com>
Tue, 28 Jan 2020 00:23:03 +0000 (16:23 -0800)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 7 Apr 2020 15:40:16 +0000 (10:40 -0500)
commit77d5805eafdb5c42bdfe78f058ad9c40ee1278b4
treeff038dfb0ee8c29269e9ab998251e52ca289a8ce
parent6b5806410b8f06050e9e64f6fbdaf2949c29f6f8
scsi: lpfc: Fix broken Credit Recovery after driver load

BugLink: https://bugs.launchpad.net/bugs/1855303
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: <stable@vger.kernel.org> # v5.4+
Link: https://lore.kernel.org/r/20200128002312.16346-4-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 835214f5d5f516a38069bc077c879c7da00d6108 linux-next)
Signed-off-by: Jeff Lane <jeffrey.lane@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_hbadisc.c