scsi: lpfc: Correct speeds on SFP swap
authorJames Smart <jsmart2021@gmail.com>
Tue, 23 Oct 2018 20:41:01 +0000 (13:41 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 7 Nov 2018 01:42:50 +0000 (20:42 -0500)
commitcd71348ad75705aab857c098a74e99700e173b77
treebd47db89038eccef64912af8901e4a61f10a37df
parentc47b6f2d54d40c053f6a15d52489eb9e1a319da2
scsi: lpfc: Correct speeds on SFP swap

Supported speeds is not updated when SFP is removed or replaced

Supported speed is obtained from lmt field in READ_CONFIG mailbox
response. Driver updates supported speeds only once from PCI probe
path. After that it is never updated. So, supported speeds remains the
same till reboot or driver reload.

When SFP is removed or inserted, driver gets SLI-Port Event ACQE.  If
SFP is removed, lmt wil have value 0. If a different SFP is inserted,
lmt will have value according to its supported speeds.  So, afterr
SLI-Port Event ACQE handling path, send READ_CONFIG mailbox and update
supported speeds. If READ_CONFIG fails, set supported speeds to
unknown and log.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c