From: Tom Rini <trini@konsulko.com>
To: Stefan Eichenberger <eichest@gmail.com>
Cc: Marek Vasut <marek.vasut@mailbox.org>,
u-boot@lists.u-boot-project.org, francesco.dolcini@toradex.com,
ilias.apalodimas@linaro.org, sbabic@nabladev.com,
festevam@gmail.com, uboot-imx@nxp.com,
marek.vasut+usb@mailbox.org, alice.guo@nxp.com,
antoine.gouby@toradex.com, stefan.eichenberger@toradex.com,
emanuele.ghidoli@toradex.com, franz.schnyder@toradex.com,
balaji.selvanathan@oss.qualcomm.com,
gurumoorthy.santhakumar@oss.qualcomm.com,
mkorpershoek@kernel.org, xypron.glpk@gmx.de,
casey.connolly@linaro.org, hayashi.kunihiko@socionext.com,
sean.anderson@linux.dev, sjg@chromium.org,
ernest.vanhoecke@toradex.com
Subject: Re: [PATCH v1 1/6] usb: dwc3: core: only provide legacy gadget IRQ handler when USB_DWC3_GADGET
Date: Wed, 26 Aug 2026 10:11:02 -0600 [thread overview]
Message-ID: <20260826161102.GO523975@bill-the-cat> (raw)
In-Reply-To: <ao6SdYSOzJGKtgIa@eichest-laptop>
[-- Attachment #1: Type: text/plain, Size: 3175 bytes --]
On Wed, Aug 26, 2026 at 09:15:01AM +0200, Stefan Eichenberger wrote:
> On Tue, Aug 25, 2026 at 01:33:27AM +0200, Marek Vasut wrote:
> > On 8/24/26 8:29 PM, Stefan Eichenberger wrote:
> > > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > >
> > > Building a board with USB_DWC3=y (DWC3 used purely as an XHCI host
> > > controller), USB_DWC3_GADGET unset, and DM_USB_GADGET disabled (e.g.
> > > to use CONFIG_CI_UDC for a separate ChipIdea gadget/OTG controller)
> > > fails to link:
> > >
> > > drivers/usb/gadget/ci_udc.o: in function `dm_usb_gadget_handle_interrupts':
> > > drivers/usb/gadget/ci_udc.c:983: multiple definition of `dm_usb_gadget_handle_interrupts';
> > > drivers/usb/dwc3/core.o:drivers/usb/dwc3/core.c:1034: first defined here
> > > drivers/usb/dwc3/core.o: in function `dm_usb_gadget_handle_interrupts':
> > > drivers/usb/dwc3/core.c:1044: undefined reference to `dwc3_gadget_uboot_handle_interrupt'
> > >
> > > Add "&& CONFIG_IS_ENABLED(USB_DWC3_GADGET)" to the guard so this code
> > > is only compiled when the DWC3 gadget driver it depends on is actually
> > > present, matching the Makefile dependency. Boards that combine DWC3
> > > (host) with a separate legacy gadget driver like CI_UDC, with
> > > DM_USB_GADGET disabled, now link correctly. Boards that already use
> > > DWC3 in gadget mode without DM_USB_GADGET are unaffected since
> > > USB_DWC3_GADGET is set for them.
> > >
> > > Fixes: 4d1589808970 ("usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget")
> > > Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > > ---
> > > drivers/usb/dwc3/core.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> > > index be198041f08..9bff5149c5f 100644
> > > --- a/drivers/usb/dwc3/core.c
> > > +++ b/drivers/usb/dwc3/core.c
> > > @@ -1016,7 +1016,7 @@ MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
> > > MODULE_LICENSE("GPL v2");
> > > MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
> > > -#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
> > > +#if !CONFIG_IS_ENABLED(DM_USB_GADGET) && CONFIG_IS_ENABLED(USB_DWC3_GADGET)
> > > __weak int dwc3_uboot_interrupt_status(struct udevice *dev)
> > Simply enable DM_USB_GADGET , then the drivers/usb/gadget/udc/udc-uclass.c
> > dm_usb_gadget_handle_interrupts() is used which correctly invokes the
> > per-controller IRQ handler. DWC3_GADGET should likely depend on
> > DM_USB_GADGET.
>
> Unfortunately, CI_UDC is not a DM driver yet and it depends on
> !DM_USB_GADGET that's why I can't enable DM_USB_GADGET in that specific
> case. I think NXP is working on changing that driver to DM (at least
> they did that in their BSP). So my hope was to have this as intermediate
> solution. Also in our case we use the DWC3 controller in host mode only,
> so we don't need DWC3_GADGET at all.
So the NXP downstream tree has a DM_USB_GADGET driver that needs to be
upstreamed, to solve this? We're quite a ways past where enhancing the
non-DM side things is the normal workflow.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-08-26 16:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 18:29 [PATCH v1 0/6] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
2026-08-24 18:29 ` [PATCH v1 1/6] usb: dwc3: core: only provide legacy gadget IRQ handler when USB_DWC3_GADGET Stefan Eichenberger
2026-08-24 23:33 ` Marek Vasut
2026-08-26 7:15 ` Stefan Eichenberger
2026-08-26 12:27 ` Marek Vasut
2026-08-26 16:11 ` Tom Rini [this message]
2026-08-27 8:41 ` Stefan Eichenberger
2026-08-24 18:29 ` [PATCH v1 2/6] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array Stefan Eichenberger
2026-08-24 23:40 ` Marek Vasut
2026-08-26 7:18 ` Stefan Eichenberger
2026-08-26 12:28 ` Marek Vasut
2026-08-24 18:29 ` [PATCH v1 3/6] usb: skip host-only devices when picking the ehci gadget controller Stefan Eichenberger
2026-08-24 23:45 ` Marek Vasut
2026-08-26 7:16 ` Stefan Eichenberger
2026-08-26 12:28 ` Marek Vasut
2026-08-24 18:29 ` [PATCH v1 4/6] configs: verdin-imx95: enable CI_UDC usb gadget driver Stefan Eichenberger
2026-08-24 18:29 ` [PATCH v1 5/6] toradex: verdin-imx95: enable DWC3 USB controller support Stefan Eichenberger
2026-08-24 18:29 ` [PATCH v1 6/6] toradex: smarc-imx95: " Stefan Eichenberger
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=20260826161102.GO523975@bill-the-cat \
--to=trini@konsulko.com \
--cc=alice.guo@nxp.com \
--cc=antoine.gouby@toradex.com \
--cc=balaji.selvanathan@oss.qualcomm.com \
--cc=casey.connolly@linaro.org \
--cc=eichest@gmail.com \
--cc=emanuele.ghidoli@toradex.com \
--cc=ernest.vanhoecke@toradex.com \
--cc=festevam@gmail.com \
--cc=francesco.dolcini@toradex.com \
--cc=franz.schnyder@toradex.com \
--cc=gurumoorthy.santhakumar@oss.qualcomm.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=ilias.apalodimas@linaro.org \
--cc=marek.vasut+usb@mailbox.org \
--cc=marek.vasut@mailbox.org \
--cc=mkorpershoek@kernel.org \
--cc=sbabic@nabladev.com \
--cc=sean.anderson@linux.dev \
--cc=sjg@chromium.org \
--cc=stefan.eichenberger@toradex.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=uboot-imx@nxp.com \
--cc=xypron.glpk@gmx.de \
/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