]> asedeno.scripts.mit.edu Git - linux.git/commit
scsi: hisi_sas: Fix for setting the PHY linkrate when disconnected
authorJohn Garry <john.garry@huawei.com>
Thu, 11 Apr 2019 12:46:38 +0000 (20:46 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 13 Apr 2019 01:30:12 +0000 (21:30 -0400)
commitc63b88ccff0a0efff1d14aa25439ae3e207a5ccf
tree65986e8ddf7155e166c998267e19a1a266de73d0
parent447f78c0e183892bcdd5664472cfcb8846b9081e
scsi: hisi_sas: Fix for setting the PHY linkrate when disconnected

In commit efdcad62e7b8 ("scsi: hisi_sas: Set PHY linkrate when
disconnected"), we use the sas_phy_data.enable flag to track whether the
PHY was enabled or not, so that we know if we should set the PHY negotiated
linkrate at SAS_LINK_RATE_UNKNOWN or SAS_PHY_DISABLED.

However, it is not proper to use sas_phy_data.enable, since it is only set
when libsas attempts to set the PHY disabled/enabled; hence, it may not
even have an initial value.

As a solution to this problem, introduce hisi_sas_phy.enable to track
whether the PHY is enabled or not, so that we can set the negotiated
linkrate properly when the PHY comes down.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c