From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Peter Chen (CIX)" <peter.chen@kernel.org>
Cc: Arnd Bergmann <arnd@kernel.org>,
Pawel Laszczak <pawell@cadence.com>,
Arnd Bergmann <arnd@arndb.de>, Roger Quadros <rogerq@kernel.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: cdns3: attempt to fix Kconfig dependencies
Date: Fri, 3 Apr 2026 14:03:29 +0200 [thread overview]
Message-ID: <2026040337-acutely-cinnamon-e751@gregkh> (raw)
In-Reply-To: <ac+LEWMCQpLSnfoD@nchen-desktop>
On Fri, Apr 03, 2026 at 05:40:33PM +0800, Peter Chen (CIX) wrote:
> On 26-04-03 10:54:44, Greg Kroah-Hartman wrote:
> > On Fri, Apr 03, 2026 at 03:50:45PM +0800, Peter Chen (CIX) wrote:
> > > On 26-04-02 16:09:55, Arnd Bergmann wrote:
> > > > From: Arnd Bergmann <arnd@arndb.de>
> > > >
> > > > The way that dependencies between host and gadget mode, as well as cdns3
> > > > and cdnsp were handled was rather fragile before commit 6076388ca1ed
> > > > ("usb: cdns3: Add USBSSP platform driver support").
> > > >
> > > > After those changes, I get randconfig build failures:
> > > >
> > > > arm-linux-gnueabi-ld: drivers/usb/cdns3/cdnsp-gadget.o: in function `__cdnsp_gadget_init':
> > > > cdnsp-gadget.c:(.text+0x12da): undefined reference to `cdns_drd_gadget_on'
> > > > arm-linux-gnueabi-ld: drivers/usb/cdns3/cdnsp-gadget.o: in function `cdnsp_gadget_pullup':
> > > > cdnsp-gadget.c:(.text+0x3030): undefined reference to `cdns_clear_vbus'
> > > > arm-linux-gnueabi-ld: cdnsp-gadget.c:(.text+0x3138): undefined reference to `cdns_set_vbus'
> > > > arm-linux-gnueabi-ld: drivers/usb/cdns3/cdnsp-gadget.o: in function `cdnsp_gadget_exit':
> > > > cdnsp-gadget.c:(.text+0xe0): undefined reference to `cdns_drd_gadget_off'
> > > >
> > > > and I see additional configurations that are broken. The main problem
> > > > here is that the 'common' module links against both host and gadget
> > > > support if they are enabled, but there are insufficient protections
> > > > agains it being built-in if only one of them is built-in and the other
> > > > is in a loadable module, causing link failures.
> > > >
> > > > The use of IS_REACHABLE() in gadget-export.h works around a similar
> > > > problem if one of cdns3 and cdnsp is built-in but the other one is
> > > > =m. This one is worse because instead of a clear link failure, the
> > > > logic just makes it not work at all despite support being enabled.
> > > >
> > > > To improve this mess, throw out both the Makefile hacks and the
> > > > IS_REACHABLE() hack and replace these with regular Kconfig dependencies
> > > > that ensure each driver is only enabled when its dependencies are there,
> > > > as we do in most other drivers. The main downside here is that there is no
> > > > good way to have built-in gadget support on cdn3 along with USB=m. Fixing
> > > > this part proper would require cleaning up the code to turn the 'common'
> > > > parts into a library module that only gets called by the other drivers
> > > > but does not interact with either host or gadget support itself.
> > > >
> > > > Another problem that is not solved by this patch is the way that
> > > > platform specific glue logic in this driver relies on having
> > > > a soc specific device as the parent of a generic child, instead of
> > > > the specific driver just calling into a common helper module.
> > > > This may be impossible to fix without breaking the DT bindings.
> > > >
> > > > Fixes: 6076388ca1ed ("usb: cdns3: Add USBSSP platform driver support")
> > >
> > > Hi Arnd,
> > >
> > > Thanks for fixing it, I am sorry for taking your effort debug it.
> > >
> > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > > ---
> > > > TBH, I would be more comfortable with reverting 6076388ca1ed altogether
> > > > and asking for a new version with the proper fixups included along
> > > > with more testing for the next merge window.
> > >
> > > It depends on Greg, I am okay for both ways. If Greg reverts the patch,
> > > I will do below improvements and adapts for most of your changes for v3
> > > patch.
> >
> > I'll be glad to revert if you want me to, just let me know.
> >
>
> Thanks, Greg. Please revert below two patches in your usb-next branch:
>
> 6076388ca1ed usb: cdns3: Add USBSSP platform driver support
> fb14e7f7cbb4 dt-bindings: usb: cdns,usb3: document USBSSP controller support
Ick, doesn't revert cleanly, I'm going to also have to drop commit
7b7f2dd91382 ("usb: cdnsp: Add support for device-only configuration")
Will go do that now....
greg k-h
prev parent reply other threads:[~2026-04-03 12:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 14:09 [PATCH] usb: cdns3: attempt to fix Kconfig dependencies Arnd Bergmann
2026-04-02 15:21 ` Arnd Bergmann
2026-04-03 7:50 ` Peter Chen (CIX)
2026-04-03 8:39 ` Arnd Bergmann
2026-04-03 9:26 ` Peter Chen (CIX)
2026-04-03 18:50 ` Arnd Bergmann
2026-04-06 1:30 ` Peter Chen (CIX)
2026-04-13 16:45 ` Arnd Bergmann
2026-04-16 11:43 ` Peter Chen (CIX)
2026-04-16 13:19 ` Arnd Bergmann
2026-04-17 9:45 ` Peter Chen (CIX)
2026-04-03 8:54 ` Greg Kroah-Hartman
2026-04-03 9:40 ` Peter Chen (CIX)
2026-04-03 12:03 ` Greg Kroah-Hartman [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=2026040337-acutely-cinnamon-e751@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pawell@cadence.com \
--cc=peter.chen@kernel.org \
--cc=rogerq@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.