[PATCH v6 03/13] soc: amlogic: Add Meson GX HHI system controller driver

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Dec 1 12:24:30 PST 2026


Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] soc: amlogic: meson_gx_hhi_sysctrl_probe() registers PHY
  provider before PHY
- [High] soc: amlogic: meson_gx_hhi_sysctrl_probe() hijacks child PHY
  node lookups
--

commit 5d78a854bc7adf16d895a668b567c24c0ad39b45
Author: Ronald Claveau <linux-kernel-dev at aliel.fr>

soc: amlogic: Add Meson GX HHI system controller driver

This commit adds a driver for the Amlogic Meson GX HHI system controller
that registers a PHY provider and creates an auxiliary device for the
HDMI TX PHY driver.

> diff --git a/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c b/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c
> new file mode 100644
> index 0000000000000..d4ef41e422a27
> --- /dev/null
> +++ b/drivers/soc/amlogic/meson-gx-hhi-sysctrl.c

[ ... ]

> +static int meson_gx_hhi_sysctrl_probe(struct platform_device *pdev)
> +{
> +	struct phy_provider *phy_provider;
> +	struct auxiliary_device *auxdev;
> +	const char *phy_aux_name;
> +	struct device *dev = &pdev->dev;
> +
> +	phy_aux_name = device_get_match_data(dev);
> +	if (!phy_aux_name)
> +		return dev_err_probe(dev, -ENODEV, "missing PHY match data\n");
> +
> +	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");

[Severity: High]
Does registering the HHI MFD node with devm_of_phy_provider_register()
intercept lookups for child PHY nodes under the HHI node?

devm_of_phy_provider_register() passes NULL for the children node, which
causes __of_phy_provider_register() to set phy_provider->children to
dev->of_node, and of_phy_provider_lookup() matches any direct child of
phy_provider->children:

drivers/phy/phy-core.c:of_phy_provider_lookup() {
	...
		for_each_child_of_node_scoped(phy_provider->children, child)
			if (child == node)
				return phy_provider;
	...
}

On G12A, G12B and SM1 SoCs, the HHI node contains the mipi_analog_dphy
child PHY node (compatible "amlogic,g12a-mipi-dphy-analog").  If
phy_meson_axg_mipi_dphy_probe() calls devm_phy_get(dev, "analog") before
phy_g12a_mipi_dphy_analog_probe() has created that PHY,
of_phy_provider_lookup() returns the HHI phy_provider instead of deferring
and of_phy_simple_xlate() returns -ENODEV, causing the MIPI D-PHY probe to
fail permanently.  Even after the child PHY driver probes,
of_phy_provider_lookup() matches the HHI provider first and pins the wrong
module owner.

> +
> +	auxdev = devm_auxiliary_device_create(dev, phy_aux_name, NULL);

[Severity: High]
Does registering phy_provider before the auxiliary HDMI TX PHY driver binds
break probe deferral for HDMI TX PHY consumers?

_of_phy_get_with_args() only returns -EPROBE_DEFER while
of_phy_provider_lookup() finds no provider for the node.  Once
devm_of_phy_provider_register() succeeds here, any consumer requesting the
PHY before the auxiliary driver has bound and called devm_phy_create()
reaches of_phy_simple_xlate(), which fails class_find_device_by_of_node()
and returns -ENODEV instead of -EPROBE_DEFER.  This happens whenever
CONFIG_MESON_GX_HHI_SYSCTRL=y and the HDMI TX PHY driver is built as a
module or probes later, causing devm_phy_get() callers to fail permanently
and devm_phy_optional_get() callers to treat the PHY as absent.  In
addition, phy_provider->owner is set to this module rather than the PHY
driver module, and devres teardown on unbind destroys auxdev and its struct
phy before unregistering phy_provider.

Since auxiliary_device_create() already copies dev->of_node to
auxdev->dev.of_node, could the auxiliary PHY driver register the PHY
provider itself after calling devm_phy_create()?

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



More information about the linux-amlogic mailing list