Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ben Dooks" <ben.dooks@codethink.co.uk>
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v2] usb: dwc3: imx8mp: make dwc3_imx_glue_ops static and rename to imx8mp
Date: Tue, 23 Jun 2026 10:21:39 +0000	[thread overview]
Message-ID: <20260623102139.8BE021F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260623101043.748359-1-ben.dooks@codethink.co.uk>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The `dwc3->glue_ops` pointer is assigned after `of_platform_populate()` returns, creating a race condition where role switches can occur before the `pre_set_role` callback is registered.
--

commit b965a813ee62bb063a7c9f8c07f1ddfe408ebc85
Author: Ben Dooks <ben.dooks@codethink.co.uk>

usb: dwc3: imx8mp: make dwc3_imx_glue_ops static and rename to imx8mp

This commit renames dwc3_imx_glue_ops to dwc3_imx8mp_glue_ops and makes
it static to fix a sparse warning about an undeclared symbol.

> diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
> index 1cf96540b66e4..de8c17bc940d2 100644
> --- a/drivers/usb/dwc3/dwc3-imx8mp.c
> +++ b/drivers/usb/dwc3/dwc3-imx8mp.c
[ ... ]
> @@ -266,7 +266,7 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
>  		goto put_dwc3;
>  	}
>  
> -	dwc3->glue_ops = &dwc3_imx_glue_ops;
> +	dwc3->glue_ops = &dwc3_imx8mp_glue_ops;

[Severity: High]
This isn't a bug introduced by this patch, but is it possible for a role
switch to occur before glue_ops is registered?

In dwc3_imx8mp_probe(), of_platform_populate() runs earlier and probes the
dwc3 core, which registers its USB role switch. If a concurrent Type-C or
extcon event triggers a role switch before dwc3->glue_ops is assigned here,
dwc3_imx8mp_pre_set_role() won't be called.

Does this leave pm_runtime autosuspend enabled for the host role, potentially
causing the XHCI controller to clear RUN_STOP and disable wakeups so it
becomes unresponsive to device insertions?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260623101043.748359-1-ben.dooks@codethink.co.uk?part=1

  reply	other threads:[~2026-06-23 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 10:10 [PATCH v2] usb: dwc3: imx8mp: make dwc3_imx_glue_ops static and rename to imx8mp Ben Dooks
2026-06-23 10:21 ` sashiko-bot [this message]
2026-06-23 11:41 ` Greg Kroah-Hartman

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=20260623102139.8BE021F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=ben.dooks@codethink.co.uk \
    --cc=imx@lists.linux.dev \
    --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