From 5d35fec3456048f5b912d806e276810fa27141a4 Mon Sep 17 00:00:00 2001 From: luojiaxing Date: Fri, 17 Aug 2018 14:08:39 +0800 Subject: [PATCH] scsi: hisi_sas: Feed back linkrate(max/min) value after modified each time at directly attached situation At directly attached situation,user modify the sysfs interface of maximum_linkrate and minimum_linkrate to renegotiate the linkrate between sas controller and sas/sata disk. The value of both files mentioned above should have change to user setting after renegotiate is over,but it remain unchanged. To fix this bug, maximum_linkrate and minimum_linkrate will be directly feed back to upper layer by synchronize those value to hisi_hab->phy[phy_no]->sas_phy->phy when receive the request of renegotiate This bug is introduced by the patch <757db2dae2c7>"scsi:hisi_sas:introduce hisi_sas_phy_set_linkrate()" and now have been fixed. Signed-off-by: luojiaxing Signed-off-by: john Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 278b7b098b2d..9d6f39641260 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -933,6 +933,10 @@ static void hisi_sas_phy_set_linkrate(struct hisi_hba *hisi_hba, int phy_no, _r.maximum_linkrate = max; _r.minimum_linkrate = min; + /* Feed back modified linkrate value pass from upper layer */ + sas_phy->phy->maximum_linkrate = max; + sas_phy->phy->minimum_linkrate = min; + hisi_hba->hw->phy_disable(hisi_hba, phy_no); msleep(100); hisi_hba->hw->phy_set_linkrate(hisi_hba, phy_no, &_r); -- GitLab