ufs: phy: Defer phy_init if phy is not probed

From ufs_qcom_init, we call phy_init() to initialize
phy driver for ufs. But sometimes, the phy driver
haven't got probed yet when we call phy_init.
This causes kernel panic during phy_init_clks.

So, before proceeding for phy clock initialization,
first check if the phy handle is available or not.
Defer the probe if it is not available.

Change-Id: Iadbc4f10719de2a1150fa00a9b5ec125db429464
Signed-off-by: Ram Kumar Dwivedi <quic_rdwivedi@quicinc.com>
This commit is contained in:
Ram Kumar Dwivedi 2024-08-20 12:10:58 +05:30
parent 7644b64ccc
commit f8780b598c

View file

@ -240,6 +240,12 @@ int ufs_qcom_phy_init_clks(struct ufs_qcom_phy *phy_common)
{
int err;
if (!phy_common) {
pr_err("%s: Defering the probe: Failed to get the required phy handle!!\n",
__func__);
return -EPROBE_DEFER;
}
if (of_device_is_compatible(phy_common->dev->of_node,
"qcom,msm8996-ufs-phy-qmp-14nm"))
goto skip_txrx_clk;