Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Julien Massot" <julien.massot@collabora.com>
Cc: conor+dt@kernel.org, neil.armstrong@linaro.org,
	olteanv@gmail.com, robh@kernel.org, devicetree@vger.kernel.org,
	linux-phy@lists.infradead.org, vkoul@kernel.org
Subject: Re: [PATCH 2/2] phy: mediatek: xsphy: add optional repeater support for USB2 ports
Date: Wed, 26 Aug 2026 12:49:49 +0000	[thread overview]
Message-ID: <20260826124950.5D9041F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260826-mtk-usb2-repeater-usb2-v1-2-e8e48e2fd6d8@collabora.com>

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@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

      reply	other threads:[~2026-08-26 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 12:38 [PATCH 0/2] phy: mediatek: xsphy: add eUSB2 repeater support for USB2 ports Julien Massot
2026-08-26 12:38 ` [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add optional repeater phys property Julien Massot
2026-08-26 16:02   ` Conor Dooley
2026-08-26 12:38 ` [PATCH 2/2] phy: mediatek: xsphy: add optional repeater support for USB2 ports Julien Massot
2026-08-26 12:49   ` sashiko-bot [this message]

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=20260826124950.5D9041F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=julien.massot@collabora.com \
    --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