]> git.baikalelectronics.ru Git - kernel.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)
commitaa28b98a3a8c0af487c907a095c4278a72810749
tree65986e8ddf7155e166c998267e19a1a266de73d0
parent312be388ace7e16804a0136dfaa007b56c8df26b
scsi: hisi_sas: Fix for setting the PHY linkrate when disconnected

In commit 5ddfbd79e584 ("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