mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value
@ 2026-11-02  7:21 Sreeraj S Kurup
  2026-11-15 19:56 ` Manivannan Sadhasivam
  2026-11-19 16:24 ` Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Sreeraj S Kurup @ 2026-11-02  7:21 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, vkoul, neil.armstrong, mani, matthias.bgg,
	angelogioacchino.delregno
  Cc: dri-devel, linux-mediatek, linux-phy, linux-kernel, Sreeraj S Kurup

The mtk_hdmi_pll_drv_setting() function can return -EINVAL when
the requested pixel clock is outside its supported range.

Currently, mtk_hdmi_pll_prepare() ignores this return value and
continues with PLL initialization even when the driver settings
fail.

Check the return value and abort PLL preparation on failure to
avoid powering up the PLL with invalid driver settings.

Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
 drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
index a4bc1268946d..9658781484f1 100644
--- a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
+++ b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
@@ -360,6 +360,7 @@ static int mtk_hdmi_pll_prepare(struct clk_hw *hw)
 {
 	struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw);
 	void __iomem *regs = hdmi_phy->regs;
+	int ret;
 
 	mtk_phy_set_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_TX_POSDIV_EN);
 
@@ -374,7 +375,9 @@ static int mtk_hdmi_pll_prepare(struct clk_hw *hw)
 	mtk_phy_clear_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_FRL_D2_EN);
 	mtk_phy_clear_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_FRL_CK_EN);
 
-	mtk_hdmi_pll_drv_setting(hw);
+	ret = mtk_hdmi_pll_drv_setting(hw);
+	if (ret)
+		return ret;
 
 	mtk_phy_clear_bits(regs + HDMI_1_CFG_10, RG_HDMITX21_BG_PWD);
 	mtk_phy_set_bits(regs + HDMI_1_CFG_6, RG_HDMITX21_BIAS_EN);
-- 
2.55.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value
  2026-11-02  7:21 [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value Sreeraj S Kurup
@ 2026-11-15 19:56 ` Manivannan Sadhasivam
  2026-11-19 16:24 ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2026-11-15 19:56 UTC (permalink / raw)
  To: Sreeraj S Kurup
  Cc: chunkuang.hu, p.zabel, vkoul, neil.armstrong, mani, matthias.bgg,
	angelogioacchino.delregno, dri-devel, linux-mediatek, linux-phy,
	linux-kernel

On 2026-11-02 07:21 +0000, Sreeraj S Kurup wrote:
> The mtk_hdmi_pll_drv_setting() function can return -EINVAL when
> the requested pixel clock is outside its supported range.
> 
> Currently, mtk_hdmi_pll_prepare() ignores this return value and
> continues with PLL initialization even when the driver settings
> fail.
> 
> Check the return value and abort PLL preparation on failure to
> avoid powering up the PLL with invalid driver settings.
> 
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

- Mani


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value
  2026-11-02  7:21 [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value Sreeraj S Kurup
  2026-11-15 19:56 ` Manivannan Sadhasivam
@ 2026-11-19 16:24 ` Vinod Koul
  2026-11-20 14:13   ` Sreeraj S Kurup
  1 sibling, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2026-11-19 16:24 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, neil.armstrong, mani, matthias.bgg,
	angelogioacchino.delregno, Sreeraj S Kurup
  Cc: dri-devel, linux-mediatek, linux-phy, linux-kernel


On Mon, 02 Nov 2026 07:21:39 +0000, Sreeraj S Kurup wrote:
> The mtk_hdmi_pll_drv_setting() function can return -EINVAL when
> the requested pixel clock is outside its supported range.
> 
> Currently, mtk_hdmi_pll_prepare() ignores this return value and
> continues with PLL initialization even when the driver settings
> fail.
> 
> [...]

Applied, thanks!

[1/1] phy: mediatek: mt8195: Check PLL driver setting return value
      commit: 5597a97e4842f3c67689093e9bf1215902babf08

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value
  2026-11-19 16:24 ` Vinod Koul
@ 2026-11-20 14:13   ` Sreeraj S Kurup
  0 siblings, 0 replies; 4+ messages in thread
From: Sreeraj S Kurup @ 2026-11-20 14:13 UTC (permalink / raw)
  To: vkoul
  Cc: angelogioacchino.delregno, chunkuang.hu, dri-devel, linux-kernel,
	linux-mediatek, linux-phy, mani, matthias.bgg, neil.armstrong,
	p.zabel, sreekuttan2156239

Hi,

Thanks for applying the patch!

Best regards,
Sreeraj

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-20 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02  7:21 [PATCH] phy: mediatek: mt8195: Check PLL driver setting return value Sreeraj S Kurup
2026-11-15 19:56 ` Manivannan Sadhasivam
2026-11-19 16:24 ` Vinod Koul
2026-11-20 14:13   ` Sreeraj S Kurup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®