[PATCH 2/2] phy: mediatek: xsphy: add optional repeater support for USB2 ports

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Aug 26 05:49:49 PDT 2026


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing PHY operation delegation for `.power_on` and `.power_off`.
--

commit 8dbeea901dbdb1f9b33b21bd4a5f16b9ad7a5a78
Author: Julien Massot <julien.massot at collabora.com>

    phy: mediatek: xsphy: add optional repeater support for USB2 ports
    
    USB2 PHY port sub-nodes may carry an optional phys property referencing
    an external eUSB2 repeater.
    
    Fetch the repeater during probe using devm_of_phy_optional_get(),
    initialize and exit it alongside the USB2 PHY, and propagate USB mode
    changes to it.

> diff --git a/drivers/phy/mediatek/phy-mtk-xsphy.c b/drivers/phy/mediatek/phy-mtk-xsphy.c
> index cc1d66954212a..7bc3d6794d7b9 100644
> --- a/drivers/phy/mediatek/phy-mtk-xsphy.c
> +++ b/drivers/phy/mediatek/phy-mtk-xsphy.c

[ ... ]

> @@ -438,7 +444,11 @@ static int mtk_phy_exit(struct phy *phy)
>  {
>  	struct xsphy_instance *inst = phy_get_drvdata(phy);
>  
> +	if (inst->type == PHY_TYPE_USB2)
> +		phy_exit(inst->repeater);
> +
>  	clk_disable_unprepare(inst->ref_clk);
> +
>  	return 0;
>  }

[Severity: Medium]
If an external repeater PHY relies on the PHY framework's phy_power_on()
(e.g., to enable core-managed regulators, resume runtime PM, or invoke its
own .power_on callback), will it silently remain unpowered and inactive
because mtk_phy_power_on() does not call phy_power_on(inst->repeater)?

For example, mtk_phy_power_on() currently only powers the internal instance:

static int mtk_phy_power_on(struct phy *phy)
{
	...
	if (inst->type == PHY_TYPE_USB2) {
		u2_phy_instance_power_on(xsphy, inst);
		u2_phy_slew_rate_calibrate(xsphy, inst);
	}
	...
}

Similarly, could the missing call to phy_power_off(inst->repeater) in
mtk_phy_power_off() cause imbalanced power tracking or resource leaks in
the repeater PHY?

static int mtk_phy_power_off(struct phy *phy)
{
	...
	if (inst->type == PHY_TYPE_USB2)
		u2_phy_instance_power_off(xsphy, inst);
	...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260826-mtk-usb2-repeater-usb2-v1-0-e8e48e2fd6d8@collabora.com?part=2



More information about the linux-phy mailing list