Skip to content

Commit c1553fc

Browse files
Palash Kambarmartinkpetersen
authored andcommitted
scsi: ufs: ufs-qcom: Disable lane clocks during phy hibern8
Currently, the UFS lane clocks remain enabled even after the link enters the Hibern8 state and are only disabled during runtime/system suspend.This patch modifies the behavior to disable the lane clocks during ufs_qcom_setup_clocks(), which is invoked shortly after the link enters Hibern8 via gate work. While hibern8_notify() offers immediate control, toggling clocks on every transition isn't ideal due to varied contexts like clock scaling. Since setup_clocks() manages PHY/controller resources and is invoked soon after Hibern8 entry, it serves as a central and stable point for clock gating. Signed-off-by: Palash Kambar <quic_pkambar@quicinc.com> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Message-ID: <20250909055149.2068737-1-quic_pkambar@quicinc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 0bd0e43 commit c1553fc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/ufs/host/ufs-qcom.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,13 @@ static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on,
11831183
case PRE_CHANGE:
11841184
if (on) {
11851185
ufs_qcom_icc_update_bw(host);
1186+
if (ufs_qcom_is_link_hibern8(hba)) {
1187+
err = ufs_qcom_enable_lane_clks(host);
1188+
if (err) {
1189+
dev_err(hba->dev, "enable lane clks failed, ret=%d\n", err);
1190+
return err;
1191+
}
1192+
}
11861193
} else {
11871194
if (!ufs_qcom_is_link_active(hba)) {
11881195
/* disable device ref_clk */
@@ -1208,6 +1215,9 @@ static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on,
12081215
if (ufshcd_is_hs_mode(&hba->pwr_info))
12091216
ufs_qcom_dev_ref_clk_ctrl(host, true);
12101217
} else {
1218+
if (ufs_qcom_is_link_hibern8(hba))
1219+
ufs_qcom_disable_lane_clks(host);
1220+
12111221
ufs_qcom_icc_set_bw(host, ufs_qcom_bw_table[MODE_MIN][0][0].mem_bw,
12121222
ufs_qcom_bw_table[MODE_MIN][0][0].cfg_bw);
12131223
}

0 commit comments

Comments
 (0)