* [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove @ 2026-11-24 10:17 Abhash Kumar Jha 2026-11-24 12:53 ` Tomi Valkeinen 0 siblings, 1 reply; 5+ messages in thread From: Abhash Kumar Jha @ 2026-11-24 10:17 UTC (permalink / raw) To: andrzej.hajda, neil.armstrong, rfoss, mripard, tzimmermann, airlied, simona, devarsht, u-kumar1, sjakhade Cc: linux-kernel, dri-devel, Laurent.pinchart, jonas, jernej.skrabec, s-jain1, y-d, tomi.valkeinen, benjamin.robin The driver currently calls phy_init()/phy_exit() but never phy_power_on()/phy_power_off(). Follow the PHY API guide's recommendation to call phy_power_on and phy_power_off along with phy_init and phy_exit respectively to be compatible with different PHYs. Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com> --- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index f47717bd10798..86e850a4752dc 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2369,6 +2369,12 @@ static int cdns_mhdp_probe(struct platform_device *pdev) goto plat_fini; } + ret = phy_power_on(mhdp->phy); + if (ret < 0) { + dev_err(mhdp->dev, "Failed to power on PHY: %d\n", ret); + goto phy_exit; + } + /* Initialize the work for modeset in case of link train failure */ INIT_WORK(&mhdp->modeset_retry_work, cdns_mhdp_modeset_retry_fn); INIT_WORK(&mhdp->hpd_work, cdns_mhdp_hpd_work); @@ -2378,7 +2384,7 @@ static int cdns_mhdp_probe(struct platform_device *pdev) ret = cdns_mhdp_load_firmware(mhdp); if (ret) - goto phy_exit; + goto power_off; if (mhdp->hdcp_supported) cdns_mhdp_hdcp_init(mhdp); @@ -2387,6 +2393,8 @@ static int cdns_mhdp_probe(struct platform_device *pdev) return 0; +power_off: + phy_power_off(mhdp->phy); phy_exit: phy_exit(mhdp->phy); plat_fini: @@ -2424,6 +2432,7 @@ static void cdns_mhdp_remove(struct platform_device *pdev) ERR_PTR(ret)); } + phy_power_off(mhdp->phy); phy_exit(mhdp->phy); if (mhdp->info && mhdp->info->ops && mhdp->info->ops->exit) -- 2.34.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove 2026-11-24 10:17 [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove Abhash Kumar Jha @ 2026-11-24 12:53 ` Tomi Valkeinen 2026-11-24 13:00 ` Benjamin Robin 0 siblings, 1 reply; 5+ messages in thread From: Tomi Valkeinen @ 2026-11-24 12:53 UTC (permalink / raw) To: Abhash Kumar Jha Cc: linux-kernel, dri-devel, Laurent.pinchart, jonas, jernej.skrabec, s-jain1, y-d, benjamin.robin, andrzej.hajda, neil.armstrong, rfoss, mripard, tzimmermann, airlied, simona, devarsht, u-kumar1, sjakhade Hi, On 24/11/2026 12:17, Abhash Kumar Jha wrote: > The driver currently calls phy_init()/phy_exit() but never > phy_power_on()/phy_power_off(). > > Follow the PHY API guide's recommendation to call phy_power_on and > phy_power_off along with phy_init and phy_exit respectively to be > compatible with different PHYs. > > Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com> > --- > drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > index f47717bd10798..86e850a4752dc 100644 > --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > @@ -2369,6 +2369,12 @@ static int cdns_mhdp_probe(struct platform_device *pdev) > goto plat_fini; > } > > + ret = phy_power_on(mhdp->phy); > + if (ret < 0) { > + dev_err(mhdp->dev, "Failed to power on PHY: %d\n", ret); > + goto phy_exit; > + } > + > /* Initialize the work for modeset in case of link train failure */ > INIT_WORK(&mhdp->modeset_retry_work, cdns_mhdp_modeset_retry_fn); > INIT_WORK(&mhdp->hpd_work, cdns_mhdp_hpd_work); > @@ -2378,7 +2384,7 @@ static int cdns_mhdp_probe(struct platform_device *pdev) > > ret = cdns_mhdp_load_firmware(mhdp); > if (ret) > - goto phy_exit; > + goto power_off; > > if (mhdp->hdcp_supported) > cdns_mhdp_hdcp_init(mhdp); > @@ -2387,6 +2393,8 @@ static int cdns_mhdp_probe(struct platform_device *pdev) > > return 0; > > +power_off: > + phy_power_off(mhdp->phy); > phy_exit: > phy_exit(mhdp->phy); > plat_fini: > @@ -2424,6 +2432,7 @@ static void cdns_mhdp_remove(struct platform_device *pdev) > ERR_PTR(ret)); > } > > + phy_power_off(mhdp->phy); > phy_exit(mhdp->phy); > > if (mhdp->info && mhdp->info->ops && mhdp->info->ops->exit) I think this one is fine, so: Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> However, I fear there's something wrong with the torrent driver itself. I didn't study it carefully, but looks like it supports bootloader enabled PHY, and it then sets 'already_configured' field. When that's set, all these calls, and dp_configuration() are ignored. And that field is only cleared on system suspend hook. So it looks quite broken, if the PHY is enabled when the torrent driver probes, the DP driver can't configure it at all. Blanking the display or even unloading/loading the DP driver does not affect it. Could you have a look at that too? Tomi ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove 2026-11-24 12:53 ` Tomi Valkeinen @ 2026-11-24 13:00 ` Benjamin Robin 2026-11-24 13:26 ` Tomi Valkeinen 0 siblings, 1 reply; 5+ messages in thread From: Benjamin Robin @ 2026-11-24 13:00 UTC (permalink / raw) To: Abhash Kumar Jha, Tomi Valkeinen Cc: linux-kernel, dri-devel, Laurent.pinchart, jonas, jernej.skrabec, s-jain1, y-d, andrzej.hajda, neil.armstrong, rfoss, mripard, tzimmermann, airlied, simona, devarsht, u-kumar1, sjakhade On Tuesday, November 24, 2026 at 1:53 PM, Tomi Valkeinen wrote: > Hi, > > On 24/11/2026 12:17, Abhash Kumar Jha wrote: > > The driver currently calls phy_init()/phy_exit() but never > > phy_power_on()/phy_power_off(). > > > > Follow the PHY API guide's recommendation to call phy_power_on and > > phy_power_off along with phy_init and phy_exit respectively to be > > compatible with different PHYs. > > > > Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com> > > --- > > drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > > index f47717bd10798..86e850a4752dc 100644 > > --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c > > @@ -2369,6 +2369,12 @@ static int cdns_mhdp_probe(struct platform_device *pdev) > > goto plat_fini; > > } > > > > + ret = phy_power_on(mhdp->phy); > > + if (ret < 0) { > > + dev_err(mhdp->dev, "Failed to power on PHY: %d\n", ret); > > + goto phy_exit; > > + } > > + > > /* Initialize the work for modeset in case of link train failure */ > > INIT_WORK(&mhdp->modeset_retry_work, cdns_mhdp_modeset_retry_fn); > > INIT_WORK(&mhdp->hpd_work, cdns_mhdp_hpd_work); > > @@ -2378,7 +2384,7 @@ static int cdns_mhdp_probe(struct platform_device *pdev) > > > > ret = cdns_mhdp_load_firmware(mhdp); > > if (ret) > > - goto phy_exit; > > + goto power_off; > > > > if (mhdp->hdcp_supported) > > cdns_mhdp_hdcp_init(mhdp); > > @@ -2387,6 +2393,8 @@ static int cdns_mhdp_probe(struct platform_device *pdev) > > > > return 0; > > > > +power_off: > > + phy_power_off(mhdp->phy); > > phy_exit: > > phy_exit(mhdp->phy); > > plat_fini: > > @@ -2424,6 +2432,7 @@ static void cdns_mhdp_remove(struct platform_device *pdev) > > ERR_PTR(ret)); > > } > > > > + phy_power_off(mhdp->phy); > > phy_exit(mhdp->phy); > > > > if (mhdp->info && mhdp->info->ops && mhdp->info->ops->exit) > > I think this one is fine, so: > > Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> > > However, I fear there's something wrong with the torrent driver itself. > I didn't study it carefully, but looks like it supports bootloader > enabled PHY, and it then sets 'already_configured' field. When that's > set, all these calls, and dp_configuration() are ignored. And that field > is only cleared on system suspend hook. So it looks quite broken, if the > PHY is enabled when the torrent driver probes, the DP driver can't > configure it at all. Blanking the display or even unloading/loading the > DP driver does not affect it. Hello Abhash, I am currently rewriting the torrent driver in order to fix various issues. But I am not sure to fully understand what you mean by > if the PHY is enabled when the torrent driver probes This is not possible. The DP PHY is only available at the end of the probe of the torrent PHY. So maybe I am missing something, could you clarify by what you mean by that. But yes this flag 'already_configured' is quite dangerous since it assume that all the registers are properly configured by the bootloader. -- Benjamin Robin, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove 2026-11-24 13:00 ` Benjamin Robin @ 2026-11-24 13:26 ` Tomi Valkeinen 2026-11-24 14:18 ` Benjamin Robin 0 siblings, 1 reply; 5+ messages in thread From: Tomi Valkeinen @ 2026-11-24 13:26 UTC (permalink / raw) To: Benjamin Robin, Abhash Kumar Jha Cc: linux-kernel, dri-devel, Laurent.pinchart, jonas, jernej.skrabec, s-jain1, y-d, andrzej.hajda, neil.armstrong, rfoss, mripard, tzimmermann, airlied, simona, devarsht, u-kumar1, sjakhade Hi, On 24/11/2026 15:00, Benjamin Robin wrote: > On Tuesday, November 24, 2026 at 1:53 PM, Tomi Valkeinen wrote: >> Hi, >> >> On 24/11/2026 12:17, Abhash Kumar Jha wrote: >>> The driver currently calls phy_init()/phy_exit() but never >>> phy_power_on()/phy_power_off(). >>> >>> Follow the PHY API guide's recommendation to call phy_power_on and >>> phy_power_off along with phy_init and phy_exit respectively to be >>> compatible with different PHYs. >>> >>> Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com> >>> --- >>> drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 11 ++++++++++- >>> 1 file changed, 10 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c >>> index f47717bd10798..86e850a4752dc 100644 >>> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c >>> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c >>> @@ -2369,6 +2369,12 @@ static int cdns_mhdp_probe(struct platform_device *pdev) >>> goto plat_fini; >>> } >>> >>> + ret = phy_power_on(mhdp->phy); >>> + if (ret < 0) { >>> + dev_err(mhdp->dev, "Failed to power on PHY: %d\n", ret); >>> + goto phy_exit; >>> + } >>> + >>> /* Initialize the work for modeset in case of link train failure */ >>> INIT_WORK(&mhdp->modeset_retry_work, cdns_mhdp_modeset_retry_fn); >>> INIT_WORK(&mhdp->hpd_work, cdns_mhdp_hpd_work); >>> @@ -2378,7 +2384,7 @@ static int cdns_mhdp_probe(struct platform_device *pdev) >>> >>> ret = cdns_mhdp_load_firmware(mhdp); >>> if (ret) >>> - goto phy_exit; >>> + goto power_off; >>> >>> if (mhdp->hdcp_supported) >>> cdns_mhdp_hdcp_init(mhdp); >>> @@ -2387,6 +2393,8 @@ static int cdns_mhdp_probe(struct platform_device *pdev) >>> >>> return 0; >>> >>> +power_off: >>> + phy_power_off(mhdp->phy); >>> phy_exit: >>> phy_exit(mhdp->phy); >>> plat_fini: >>> @@ -2424,6 +2432,7 @@ static void cdns_mhdp_remove(struct platform_device *pdev) >>> ERR_PTR(ret)); >>> } >>> >>> + phy_power_off(mhdp->phy); >>> phy_exit(mhdp->phy); >>> >>> if (mhdp->info && mhdp->info->ops && mhdp->info->ops->exit) >> >> I think this one is fine, so: >> >> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> >> >> However, I fear there's something wrong with the torrent driver itself. >> I didn't study it carefully, but looks like it supports bootloader >> enabled PHY, and it then sets 'already_configured' field. When that's >> set, all these calls, and dp_configuration() are ignored. And that field >> is only cleared on system suspend hook. So it looks quite broken, if the >> PHY is enabled when the torrent driver probes, the DP driver can't >> configure it at all. Blanking the display or even unloading/loading the >> DP driver does not affect it. > > Hello Abhash, It wasn't Abhash. > I am currently rewriting the torrent driver in order to fix various issues. > But I am not sure to fully understand what you mean by > >> if the PHY is enabled when the torrent driver probes > > This is not possible. The DP PHY is only available at the end of the probe > of the torrent PHY. So maybe I am missing something, could you clarify by > what you mean by that. But yes this flag 'already_configured' is quite > dangerous since it assume that all the registers are properly configured > by the bootloader. I meant that if the DP PHY hardware is enabled (so was enabled by the bootloader) when the torrent driver probes, 'already_configured' will be set by the driver, and then when the MHDP driver later probes, MHDP driver won't be able to configure the PHY at all. But all I did was a quick read, feel free to correct me =). Tomi ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove 2026-11-24 13:26 ` Tomi Valkeinen @ 2026-11-24 14:18 ` Benjamin Robin 0 siblings, 0 replies; 5+ messages in thread From: Benjamin Robin @ 2026-11-24 14:18 UTC (permalink / raw) To: Abhash Kumar Jha, Tomi Valkeinen Cc: linux-kernel, dri-devel, Laurent.pinchart, jonas, jernej.skrabec, s-jain1, y-d, andrzej.hajda, neil.armstrong, rfoss, mripard, tzimmermann, airlied, simona, devarsht, u-kumar1, sjakhade On Tuesday, November 24, 2026 at 2:26 PM, Tomi Valkeinen wrote: > >> However, I fear there's something wrong with the torrent driver itself. > >> I didn't study it carefully, but looks like it supports bootloader > >> enabled PHY, and it then sets 'already_configured' field. When that's > >> set, all these calls, and dp_configuration() are ignored. And that field > >> is only cleared on system suspend hook. So it looks quite broken, if the > >> PHY is enabled when the torrent driver probes, the DP driver can't > >> configure it at all. Blanking the display or even unloading/loading the > >> DP driver does not affect it. > > > > Hello Abhash, > > It wasn't Abhash. Oups, sorry. Hello Tomi. > > I am currently rewriting the torrent driver in order to fix various issues. > > But I am not sure to fully understand what you mean by > > > >> if the PHY is enabled when the torrent driver probes > > > > This is not possible. The DP PHY is only available at the end of the probe > > of the torrent PHY. So maybe I am missing something, could you clarify by > > what you mean by that. But yes this flag 'already_configured' is quite > > dangerous since it assume that all the registers are properly configured > > by the bootloader. > > I meant that if the DP PHY hardware is enabled (so was enabled by the > bootloader) when the torrent driver probes, 'already_configured' will be > set by the driver, and then when the MHDP driver later probes, MHDP > driver won't be able to configure the PHY at all. > > But all I did was a quick read, feel free to correct me =). No, you're right. I'm not sure why, but I was convinced otherwise. I’ll add this to the list of points to be corrected. -- Benjamin Robin, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-24 14:18 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-11-24 10:17 [PATCH] drm/bridge: cdns-mhdp8546: Power on/off the PHY in probe/remove Abhash Kumar Jha 2026-11-24 12:53 ` Tomi Valkeinen 2026-11-24 13:00 ` Benjamin Robin 2026-11-24 13:26 ` Tomi Valkeinen 2026-11-24 14:18 ` Benjamin Robin
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®