From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org,
linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 2/2] clk: en7523: Add support for selecting the Serdes port in SCU
Date: Tue, 15 Sep 2026 13:02:48 +0000 [thread overview]
Message-ID: <20260915130248.B34591F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915125226.20579-3-ansuelsmth@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] clk: en7523: en7581_serdes_phy_set_mode() rejects USB Host PHY modes
--
commit e4c0888a17c4cf69587dbf3077fe8a5e2ed19ae7
Author: Christian Marangi <ansuelsmth@gmail.com>
clk: en7523: Add support for selecting the Serdes port in SCU
In the SCU register for clock and reset, there are also some register to
select the Serdes port mode. The Airoha AN7581 SoC have 4 different Serdes
that can switch between PCIe, USB or Ethernet mode.
> diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
> index 5c45aacb6409e..24fdec2e6198c 100644
> --- a/drivers/clk/clk-en7523.c
> +++ b/drivers/clk/clk-en7523.c
[ ... ]
> @@ -847,12 +878,179 @@ static int en7581_reset_register(struct device *dev, void __iomem *base,
[ ... ]
> + case AIROHA_SCU_SERDES_USB1:
> + reg = REG_NP_SCU_SSR3;
> + mask = REG_SSUSB_HSGMII_SEL_MASK;
> +
> + if (mode != PHY_MODE_ETHERNET && mode != PHY_MODE_USB_DEVICE &&
> + mode != PHY_MODE_USB_DEVICE_SS)
> + return -EINVAL;
[Severity: High]
Does this validation check in en7581_serdes_phy_set_mode() in
drivers/clk/clk-en7523.c incorrectly reject standard USB Host PHY modes for
the USB1 Serdes port?
When a USB controller driver (such as dwc3) is configured in Host mode, it
typically calls phy_set_mode() with PHY_MODE_USB_HOST or PHY_MODE_USB_HOST_SS
during initialization.
Returning -EINVAL here prevents the PHY multiplexer from switching to USB
mode, leaving the Serdes pins disconnected from the USB controller and
breaking USB Host functionality.
Should PHY_MODE_USB_HOST and PHY_MODE_USB_HOST_SS also be allowed here?
> +
> + if (mode == PHY_MODE_ETHERNET)
> + sel = REG_SSUSB_HSGMII_SEL_HSGMII;
> + else
> + sel = REG_SSUSB_HSGMII_SEL_USB;
> +
> + break;
> + case AIROHA_SCU_SERDES_USB2:
> + reg = REG_NP_SCU_SSTR;
> + mask = REG_USB_PCIE_SEL_MASK;
> +
> + if (mode != PHY_MODE_PCIE && mode != PHY_MODE_USB_DEVICE &&
> + mode != PHY_MODE_USB_DEVICE_SS)
> + return -EINVAL;
[Severity: High]
Similarly, does this logic incorrectly reject standard USB Host PHY modes
for the USB2 Serdes port?
If a USB controller initializes in Host or OTG mode, it will request
PHY_MODE_USB_HOST or PHY_MODE_USB_HOST_SS. Without explicitly allowing these
modes, USB Host operations might be completely non-functional on this SoC.
> +
> + if (mode == PHY_MODE_PCIE)
> + sel = REG_USB_PCIE_SEL_PCIE;
> + else
> + sel = REG_USB_PCIE_SEL_USB;
> +
> + break;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260915125226.20579-1-ansuelsmth@gmail.com?part=2
next prev parent reply other threads:[~2026-09-15 13:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 12:52 [PATCH v2 0/2] clk: en7523: Add support for selecting SCU serdes Christian Marangi
2026-09-15 12:52 ` [PATCH v2 1/2] dt-bindings: clock: airoha: Add PHY binding for Serdes port Christian Marangi
2026-09-15 12:52 ` [PATCH v2 2/2] clk: en7523: Add support for selecting the Serdes port in SCU Christian Marangi
2026-09-15 13:02 ` sashiko-bot [this message]
2026-09-21 15:34 ` [PATCH v2 0/2] clk: en7523: Add support for selecting SCU serdes Brian Masney
2026-10-06 11:23 ` Christian Marangi (Ansuel)
2026-10-07 13:06 ` Brian Masney
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=20260915130248.B34591F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ansuelsmth@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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