Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0006ce29 authored by Xiaofei Tan's avatar Xiaofei Tan Committed by Martin K. Petersen
Browse files

scsi: hisi_sas: fix the issue of setting linkrate register



It is not right to set the register PROG_PHY_LINK_RATE while PHY is still
enabled. So if we want to change PHY linkrate, we need to disable PHY before
setting the register PROG_PHY_LINK_RATE, and then start-up PHY. This patch
is to fix this issue.

Signed-off-by: default avatarXiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent eba8c20c
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -881,10 +881,11 @@ static void phy_set_linkrate_v1_hw(struct hisi_hba *hisi_hba, int phy_no,
	prog_phy_link_rate &= ~0xff;
	prog_phy_link_rate &= ~0xff;
	prog_phy_link_rate |= rate_mask;
	prog_phy_link_rate |= rate_mask;


	disable_phy_v1_hw(hisi_hba, phy_no);
	msleep(100);
	hisi_sas_phy_write32(hisi_hba, phy_no, PROG_PHY_LINK_RATE,
	hisi_sas_phy_write32(hisi_hba, phy_no, PROG_PHY_LINK_RATE,
			prog_phy_link_rate);
			prog_phy_link_rate);

	start_phy_v1_hw(hisi_hba, phy_no);
	phy_hard_reset_v1_hw(hisi_hba, phy_no);
}
}


static int get_wideport_bitmap_v1_hw(struct hisi_hba *hisi_hba, int port_id)
static int get_wideport_bitmap_v1_hw(struct hisi_hba *hisi_hba, int port_id)
+3 −2
Original line number Original line Diff line number Diff line
@@ -1611,10 +1611,11 @@ static void phy_set_linkrate_v2_hw(struct hisi_hba *hisi_hba, int phy_no,
	prog_phy_link_rate &= ~0xff;
	prog_phy_link_rate &= ~0xff;
	prog_phy_link_rate |= rate_mask;
	prog_phy_link_rate |= rate_mask;


	disable_phy_v2_hw(hisi_hba, phy_no);
	msleep(100);
	hisi_sas_phy_write32(hisi_hba, phy_no, PROG_PHY_LINK_RATE,
	hisi_sas_phy_write32(hisi_hba, phy_no, PROG_PHY_LINK_RATE,
			prog_phy_link_rate);
			prog_phy_link_rate);

	start_phy_v2_hw(hisi_hba, phy_no);
	phy_hard_reset_v2_hw(hisi_hba, phy_no);
}
}


static int get_wideport_bitmap_v2_hw(struct hisi_hba *hisi_hba, int port_id)
static int get_wideport_bitmap_v2_hw(struct hisi_hba *hisi_hba, int port_id)
+3 −2
Original line number Original line Diff line number Diff line
@@ -1862,10 +1862,11 @@ static void phy_set_linkrate_v3_hw(struct hisi_hba *hisi_hba, int phy_no,
	prog_phy_link_rate &= ~0xff;
	prog_phy_link_rate &= ~0xff;
	prog_phy_link_rate |= rate_mask;
	prog_phy_link_rate |= rate_mask;


	disable_phy_v3_hw(hisi_hba, phy_no);
	msleep(100);
	hisi_sas_phy_write32(hisi_hba, phy_no, PROG_PHY_LINK_RATE,
	hisi_sas_phy_write32(hisi_hba, phy_no, PROG_PHY_LINK_RATE,
			prog_phy_link_rate);
			prog_phy_link_rate);

	start_phy_v3_hw(hisi_hba, phy_no);
	phy_hard_reset_v3_hw(hisi_hba, phy_no);
}
}


static void interrupt_disable_v3_hw(struct hisi_hba *hisi_hba)
static void interrupt_disable_v3_hw(struct hisi_hba *hisi_hba)