drm/msm/dsi: don't allow enabling 14nm VCO with unprogrammed rate
PATCH 1/1 drm/msm/dsi: don't allow enabling 14nm VCO with unprogrammed rate
If the dispcc uses CLK_OPS_PARENT_ENABLE (e.g. on QCM2290), CCF can try enabling VCO before the rate has been programmed. This can cause clock lockups and/or other boot issues. Program the VCO to the minimal PLL rate if the read rate is 0 Hz.
--- drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +3 -0
@@ -539,6 +539,9 @@ static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw)if (unlikely (pll_14nm->phy->pll_on))return 0 ; +if (dsi_pll_14nm_vco_recalc_rate (hw,VCO_REF_CLK_RATE ) ==0 ) +dsi_pll_14nm_vco_set_rate (hw, pll_14nm->phy->cfg->min_pll_rate,VCO_REF_CLK_RATE ); +dsi_phy_write (base + REG_DSI_14nm_PHY_PLL_VREF_CFG1,0x10 );dsi_phy_write (cmn_base + REG_DSI_14nm_PHY_CMN_PLL_CNTRL,1 );
Signature · 1 line
2.39.2
Quoted 8 lines · Dmitry Baryshkov
If the dispcc uses
CLK_OPS_PARENT_ENABLE(e.g. on QCM2290), CCF can try enabling VCO before the rate has been programmed. This can cause clock lockups and/or other boot issues. Program the VCO to the minimal PLL rate if the read rate is 0 Hz.Cc Konrad Dybcio <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
I think this should also be implemented on other PLL gens.
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw) · line 543
Quoted 13 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +2
-0@@ -539,6 +539,9 @@ static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw)if (unlikely (pll_14nm->phy->pll_on))return 0 ; +if (dsi_pll_14nm_vco_recalc_rate (hw,VCO_REF_CLK_RATE ) ==0 ) +dsi_pll_14nm_vco_set_rate (hw, pll_14nm->phy->cfg->min_pll_rate,VCO_REF_CLK_RATE );
VCO_REF_CLK_RATE ---> phy->cfg->min_pll_rate (VCO_MIN_RATE)?
Konrad
Quoted 4 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +1
-0+dsi_phy_write (base + REG_DSI_14nm_PHY_PLL_VREF_CFG1,0x10 );dsi_phy_write (cmn_base + REG_DSI_14nm_PHY_CMN_PLL_CNTRL,1 );
Quoted 27 lines · Konrad Dybcio
Quoted 8 lines · Dmitry Baryshkov
If the dispcc uses
CLK_OPS_PARENT_ENABLE(e.g. on QCM2290), CCF can try enabling VCO before the rate has been programmed. This can cause clock lockups and/or other boot issues. Program the VCO to the minimal PLL rate if the read rate is 0 Hz.Cc Konrad Dybcio <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
Reported-by Vladimir Zapolskiy <[email protected]>Reported-by Konrad Dybcio <[email protected]>I think this should also be implemented on other PLL gens.
Quoted 11 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +0
-0@@ -539,6 +539,9 @@ static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw)if (unlikely (pll_14nm->phy->pll_on))return 0 ;
Quoted 3 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw) · line 543
Quoted 2 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +2
-0+if (dsi_pll_14nm_vco_recalc_rate (hw,VCO_REF_CLK_RATE ) ==0 ) +dsi_pll_14nm_vco_set_rate (hw, pll_14nm->phy->cfg->min_pll_rate,VCO_REF_CLK_RATE );
VCO_REF_CLK_RATE--->phy->cfg->min_pll_rate(VCO_MIN_RATE)?
No, this is the parent rate, which is VCO_REF_CLK_RATE for all practical purposes.
Quoted 6 lines
Konrad
Quoted 4 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +1
-0+dsi_phy_write (base + REG_DSI_14nm_PHY_PLL_VREF_CFG1,0x10 );dsi_phy_write (cmn_base + REG_DSI_14nm_PHY_CMN_PLL_CNTRL,1 );
Signature · 2 lines
With best wishes Dmitry
Konrad Dybcio
Reviewed-byQuoted 31 lines · Dmitry Baryshkov
Quoted 19 lines · Konrad Dybcio
Quoted 8 lines · Dmitry Baryshkov
If the dispcc uses
CLK_OPS_PARENT_ENABLE(e.g. on QCM2290), CCF can try enabling VCO before the rate has been programmed. This can cause clock lockups and/or other boot issues. Program the VCO to the minimal PLL rate if the read rate is 0 Hz.Cc Konrad Dybcio <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>---
Reported-by Vladimir Zapolskiy <[email protected]>Reported-by Konrad Dybcio <[email protected]>I think this should also be implemented on other PLL gens.
Quoted 3 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c| 3 +++1 file changed, 3 insertions(+)Quoted 10 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw) · line 542
Quoted 9 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +1
-0@@ -539,6 +539,9 @@ static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw) if (unlikely(pll_14nm->phy->pll_on)) return 0; + if (dsi_pll_14nm_vco_recalc_rate(hw, VCO_REF_CLK_RATE) == 0) + dsi_pll_14nm_vco_set_rate(hw, pll_14nm->phy->cfg->min_pll_rate, VCO_REF_CLK_RATE);
VCO_REF_CLK_RATE--->phy->cfg->min_pll_rate(VCO_MIN_RATE)?
Quoted 1 line
No, this is the parent rate, which is
VCO_REF_CLK_RATEfor all practical purposes.
right!
This probably deserves
as the driver previously allowed for erroneous (and inherently racy) behavior
Konrad
Quoted 8 lines
Quoted 7 lines
Konrad
Quoted 4 lines
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +1
-0+ dsi_phy_write(base + REG_DSI_14nm_PHY_PLL_VREF_CFG1, 0x10); dsi_phy_write(cmn_base + REG_DSI_14nm_PHY_CMN_PLL_CNTRL, 1);