Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ronald Claveau" <linux-kernel-dev@aliel.fr>
Cc: devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-phy@lists.infradead.org, dri-devel@lists.freedesktop.org,
	robh@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org,
	vkoul@kernel.org, olteanv@gmail.com
Subject: Re: [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY
Date: Tue, 01 Dec 2026 20:30:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-244204@kernel.org> (raw)
In-Reply-To: <20261201-meson-drm-create-hdmitx-phy-v6-9-5ccdf57a6cf5@aliel.fr>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/meson: dw-hdmi: devm_phy_optional_get() masks unbound aux
  PHY as legacy
- [Low] drm/meson: dw-hdmi: unmet COMMON_CLK dependency for
  PHY_MESON_HDMI_TX
--

commit 4a5d79bfd8030c336301e39697e95c82dc0bc195
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY

This commit converts the Meson DW-HDMI driver to manage the HDMI TX PHY
through the generic PHY framework, with a legacy fallback for device
trees without a phys property, and adjusts suspend/resume ordering.

> diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig
> index 6645665f60380..a91cf851314a6 100644
> --- a/drivers/gpu/drm/meson/Kconfig
> +++ b/drivers/gpu/drm/meson/Kconfig
> @@ -20,6 +20,7 @@ config DRM_MESON_DW_HDMI
>  	depends on PM
>  	default y if DRM_MESON
>  	select DRM_DW_HDMI
> +	select PHY_MESON_HDMI_TX
>  	imply DRM_DW_HDMI_I2S_AUDIO

[Severity: Low]
Can selecting PHY_MESON_HDMI_TX here cause an unmet direct dependency
warning on COMMON_CLK?

drivers/phy/amlogic/Kconfig:
    config PHY_MESON_HDMI_TX
    	tristate "Meson HDMI TX PHY driver"
    	depends on ARCH_MESON || COMPILE_TEST
    	depends on OF && COMMON_CLK

Neither DRM_MESON nor DRM_MESON_DW_HDMI depends on COMMON_CLK, so a
COMPILE_TEST=y build with COMMON_CLK=n and DRM_MESON_DW_HDMI enabled
selects PHY_MESON_HDMI_TX without its COMMON_CLK dependency satisfied.

> diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
> index 20a821936b3af..ec21d13775b70 100644
> --- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
[ ... ]
> @@ -746,7 +663,26 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
>  		return ret;
>  	}
>  
> -	meson_dw_hdmi_init(meson_dw_hdmi);
> +	meson_dw_hdmi->phy = devm_phy_optional_get(dev, NULL);
> +	if (IS_ERR(meson_dw_hdmi->phy))
> +		return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
> +				     "failed to get HDMI PHY\n");
> +
> +	if (!meson_dw_hdmi->phy) {
> +		/* DEPRECATED: DT without "phys" */
> +		dev_warn(dev, "missing \"phys\", using legacy HDMI PHY\n");
> +		meson_dw_hdmi->phy = meson_hdmi_phy_create_legacy(dev, priv->hhi,
> +						meson_dw_hdmi->data->phy_soc);
> +		if (IS_ERR(meson_dw_hdmi->phy))
> +			return dev_err_probe(dev, PTR_ERR(meson_dw_hdmi->phy),
> +					     "failed to create legacy HDMI PHY\n");
> +
> +		meson_dw_hdmi->legacy_phy = true;
> +	}

[Severity: Medium]
Can devm_phy_optional_get() return NULL even when the DT has a "phys"
property, causing meson_dw_hdmi_bind() to fall back to
meson_hdmi_phy_create_legacy() instead of deferring probe?

meson_gx_hhi_sysctrl_probe() registers the OF PHY provider with
of_phy_simple_xlate before creating the auxiliary device:

drivers/soc/amlogic/meson-gx-hhi-sysctrl.c:meson_gx_hhi_sysctrl_probe() {
    ...
	phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
	if (IS_ERR(phy_provider))
		return dev_err_probe(dev, PTR_ERR(phy_provider),
				     "failed to register PHY provider\n");

	auxdev = devm_auxiliary_device_create(dev, phy_aux_name, NULL);
    ...
}

If meson_dw_hdmi_bind() runs after the provider is registered on the HHI
node but before meson_hdmi_phy_aux_driver binds to the auxiliary device
and creates the struct phy (for example when phy-meson-hdmi-tx is a
module or with asynchronous probing), of_phy_provider_lookup() succeeds
and calls of_phy_simple_xlate(), which returns -ENODEV because no device
in phy_class matches args->np yet.  devm_phy_optional_get() turns that
-ENODEV into NULL, so meson_dw_hdmi_bind() logs a false missing "phys"
warning and creates a duplicate legacy PHY on the same HHI registers
without a device link to the auxiliary PHY device.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson-drm-create-hdmitx-phy-v6-0-5ccdf57a6cf5@aliel.fr?part=9

  reply	other threads:[~2026-12-01 20:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 20:12 [PATCH v6 00/13] phy/drm: amlogic: Extract Meson HDMI TX PHY into a dedicated driver Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 01/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Fix compatible matching in conditionals Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 02/13] dt-bindings: soc: amlogic: meson-gx-hhi-sysctrl: Add #phy-cells Ronald Claveau via B4 Relay
2026-12-01 20:27   ` sashiko-bot
2026-12-01 20:12 ` [PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver Ronald Claveau via B4 Relay
2026-12-01 20:24   ` sashiko-bot
2026-12-01 20:12 ` [PATCH v6 04/13] phy: amlogic: rename Meson8 HDMI TX PHY driver to be SoC-generic Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 05/13] phy: amlogic: meson-hdmi-tx: Add GXBB, GXL, GXM and G12A support Ronald Claveau via B4 Relay
2026-12-01 20:25   ` sashiko-bot
2026-12-01 20:12 ` [PATCH v6 06/13] dt-bindings: display: amlogic,meson-dw-hdmi: Add phys Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 07/13] pmdomain: amlogic: meson-ee-pwrc: power up memories for boot-enabled domains Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 08/13] drm/meson: dw-hdmi: Drop manual HHI clock and memory PD setup Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 09/13] drm/meson: dw-hdmi: Use the generic PHY framework for the HDMI TX PHY Ronald Claveau via B4 Relay
2026-12-01 20:30   ` sashiko-bot [this message]
2026-12-01 20:12 ` [PATCH v6 10/13] arm64: dts: amlogic: g12: Use the HHI system controller as HDMI PHY provider Ronald Claveau via B4 Relay
2026-12-01 20:12 ` [PATCH v6 11/13] arm64: dts: amlogic: meson-gx: Add #phy-cells to the HHI system controller Ronald Claveau via B4 Relay
2026-12-01 20:13 ` [PATCH v6 12/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXBB Ronald Claveau via B4 Relay
2026-12-01 20:32   ` sashiko-bot
2026-12-01 20:13 ` [PATCH v6 13/13] arm64: dts: amlogic: Add HDMI TX PHY node for GXL Ronald Claveau via B4 Relay
2026-12-01 20:23   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-244204@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel-dev@aliel.fr \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox