scsi: lpfc: Fix incorrect logical link speed on trunks when links down
authorJames Smart <jsmart2021@gmail.com>
Wed, 22 May 2019 00:49:04 +0000 (17:49 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Jun 2019 23:46:21 +0000 (19:46 -0400)
commitb8e6f13617db126c8898908e8601f5e4e3b393cf
tree21e21ad0a3fa5f89707cae0cc5dffa7324d8606d
parent04d210c98e11d863ebe38a7e482e40fb90d9ad82
scsi: lpfc: Fix incorrect logical link speed on trunks when links down

Invalid logical speed is displayed for trunk enabled ports when all ports
are down. Also noted that link speed is incorrectly reported for the units
when links are up.

Current code is returning the logical link speed from the last event from
the adapter. In cases where the last link went down, the link speed in the
event was not valid - meaning that although the links where down the field
had a bogus value.

Rework the event handling to qualify the trunk link state before using the
event speed data.

Also correct units on other areas where the logical link speed was taken
from a link event.

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>
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/lpfc/lpfc_init.c