From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCHv2 1/2] usb: bcma: add regulator support
Date: Mon, 21 Sep 2026 21:51:40 +0000 [thread overview]
Message-ID: <20260921215141.5B3451F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260921214133.16519-2-rosenp@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] usb: bcma: teardown ordering violation in bcma_hcd_remove()
--
commit cdbc43989b0d2d3446fd86aaaa77bbc9306cb391
Author: Rosen Penev <rosenp@gmail.com>
usb: bcma: add regulator support
This patch adds support for the standard regulator interface to provide
VBUS supply to the USB cores. It reference-counts the enable/disable
requests, allowing both controllers to drive one GPIO without conflicts.
> diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c
> index 519386255886c..0d5a220b69880 100644
> --- a/drivers/usb/host/bcma-hcd.c
> +++ b/drivers/usb/host/bcma-hcd.c
[ ... ]
> @@ -442,6 +464,8 @@ static void bcma_hcd_remove(struct bcma_device *dev)
> struct platform_device *ohci_dev = usb_dev->ohci_dev;
> struct platform_device *ehci_dev = usb_dev->ehci_dev;
>
> + regulator_disable(usb_dev->regulator);
> +
[Severity: High]
Does disabling the regulator before unregistering the platform devices cause
a teardown ordering violation?
In bcma_hcd_probe(), the initialization order is followed: the regulator
is enabled first, and then the child platform devices (ohci_dev and ehci_dev)
are registered.
During driver teardown in bcma_hcd_remove(), this order must be reversed to
ensure that dependent drivers are unbound while the hardware remains powered.
When platform_device_unregister() runs, it invokes the child drivers' remove
routines (e.g., ehci_platform_remove()), which perform register accesses to
cleanly halt the controllers. Since the regulator (which may power the PHY
or controller logic) has already been disabled here, will these register
accesses target unpowered hardware and trigger synchronous bus errors?
Should the regulator be disabled after the child devices are unregistered?
> if (ohci_dev)
> platform_device_unregister(ohci_dev);
> if (ehci_dev)
> platform_device_unregister(ehci_dev);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921214133.16519-2-rosenp@gmail.com?part=1
next prev parent reply other threads:[~2026-09-21 21:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 21:41 [PATCHv2 0/2] usb: bcma: control VBUS via a regulator Rosen Penev
2026-09-21 21:41 ` [PATCHv2 1/2] usb: bcma: add regulator support Rosen Penev
2026-09-21 21:51 ` sashiko-bot [this message]
2026-09-21 21:59 ` Rafał Miłecki
2026-09-21 22:06 ` Rosen Penev
2026-09-21 21:41 ` [PATCHv2 2/2] ARM: dts: broadcom: model USB VBUS power with regulator-fixed Rosen Penev
2026-09-21 21:56 ` sashiko-bot
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=20260921215141.5B3451F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=rosenp@gmail.com \
--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