scsi: hisi_sas: Do not modify upper fields of PROG_PHY_LINK_RATE reg
authorLuo Jiaxing <luojiaxing@huawei.com>
Tue, 1 Sep 2020 11:13:05 +0000 (19:13 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 3 Sep 2020 02:49:08 +0000 (22:49 -0400)
commitcaeddc0453b9215669a39ea335f1af1f3f91cc99
tree9cfa92e93125a30e5500efab8f3c8b5ece074759
parent4b3a1f1feda62b0b15536548b6d31ca549de2e3a
scsi: hisi_sas: Do not modify upper fields of PROG_PHY_LINK_RATE reg

When updating PROG_PHY_LINK_RATE to set linkrate for a phy we used a
hard-coded initial value instead of getting the current value from the
register. The assumption was that this register would not be modified, but
in fact it was partially modified in a new version of hardware. The
hard-coded value we used changed the default value of the register to a an
incorrect setting and as a result the SAS controller could not change
linkrate for the phy.

Delete hard-coded value and always read the latest value of register before
updating it.

Link: https://lore.kernel.org/r/1598958790-232272-4-git-send-email-john.garry@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
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_v3_hw.c