Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Joey Lu" <a0987203069@gmail.com>
Cc: conor+dt@kernel.org, linux-phy@lists.infradead.org,
	vkoul@kernel.org, devicetree@vger.kernel.org,
	neil.armstrong@linaro.org, olteanv@gmail.com, robh@kernel.org
Subject: Re: [PATCH v3 3/3] phy: nuvoton: phy-ma35d1-usb2: extend to dual-port with OTG support
Date: Wed, 08 Jul 2026 10:49:16 +0000	[thread overview]
Message-ID: <20260708104917.29EEB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708103606.1462960-4-a0987203069@gmail.com>

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] Kconfig Dependency / Build and Probe Regression
- [High] Missing Wait for Clock Stability on Already-Operating PHY (Suspend/Resume Regression)
- [Medium] Uninitialized variable usage due to ignored regmap_read return value
- [Low] Undocumented Functional Changes in Hardware Configuration
--

--- Patch [3]: [PATCH v3 3/3] phy: nuvoton: phy-ma35d1-usb2: extend to dual-port with OTG support ---
Note: The format of this report is altered due to recitation restrictions. I am providing a free-form summary of the findings without quoting the original patch code.

commit 0f7c9811782335bab86ecc4c08f7f6a17839e8c3
Author: Joey Lu <a0987203069@gmail.com>
Subject: phy: nuvoton: phy-ma35d1-usb2: extend to dual-port with OTG support

Summary: This commit extends the existing MA35D1 USB 2.0 PHY driver to manage
both PHY0 and PHY1. It updates the initialization logic to support host-mode
clock stability polling and registers a read-only USB role switch for PHY0.

[Severity: High]
In ma35_role_switch_init(), the driver fails the probe if the role switch
registration returns an error. Does this break the driver when the role
switch framework is disabled?

If CONFIG_USB_ROLE_SWITCH is not enabled, the register function returns
-ENODEV, causing ma35_role_switch_init() to treat it as a fatal error and
unconditionally fail the PHY probe. 

Furthermore, shouldn't the driver declare a Kconfig dependency on
USB_ROLE_SWITCH or handle the -ENODEV return case gracefully?

[Severity: High]
In ma35_usb_phy_init(), the driver returns early if the suspend bit is
already set. Does this skip waiting for clock stability during system resume?

On system suspend, the suspend bit remains set. During resume, the PHY
crystal might have been stopped and requires time to restabilize. Returning
early skips the host/device clock stability polling. 

The original code explicitly handled this by checking for clock stability
even when the suspend bit was already set. Could this lead to controller
hangs when the controller proceeds before the PHY clocks are stable?

[Severity: Medium]
In ma35_role_sw_get(), the return value of regmap_read() is ignored before
evaluating the val variable. Can this expose uninitialized kernel stack
memory?

If the syscon read fails, val will contain uninitialized memory, which is
then evaluated and returned to userspace via the role sysfs attribute.

This is a pre-existing issue, but the same pattern of ignoring the
regmap_read() return value also appears in ma35_usb_phy_init(). Should the
return values be checked in both locations?

[Severity: Low]
In ma35_usb_phy_probe(), new logic is introduced to parse nuvoton,rcalcode
and nuvoton,oc-active-high from the device tree and apply them to the
resistor trim and over-current polarity registers.

Could the commit message be updated to document these functional hardware
configuration changes? They are currently completely omitted from the
commit history.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260708103606.1462960-1-a0987203069@gmail.com?part=3

      reply	other threads:[~2026-07-08 10:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 10:36 [PATCH v3 0/3] phy: nuvoton: extend MA35D1 USB2 PHY driver for dual-port OTG support Joey Lu
2026-07-08 10:36 ` [PATCH v3 1/3] dt-bindings: phy: nuvoton,ma35d1-usb2-phy: extend for dual-port and OTG Joey Lu
2026-07-08 10:49   ` sashiko-bot
2026-07-10  8:54   ` Krzysztof Kozlowski
2026-07-08 10:36 ` [PATCH v3 2/3] arm64: dts: nuvoton: ma35d1: add USB controllers and dual-port PHY node Joey Lu
2026-07-08 10:48   ` sashiko-bot
2026-07-08 10:36 ` [PATCH v3 3/3] phy: nuvoton: phy-ma35d1-usb2: extend to dual-port with OTG support Joey Lu
2026-07-08 10: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=20260708104917.29EEB1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=a0987203069@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --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