Re: [PATCH 0/2] usb: cdns3: USBSSP platform driver support
From: Peter Chen
Date: Wed Mar 04 2026 - 03:33:32 EST
On 26-03-04 08:22:25, Pawel Laszczak wrote:
> [Some people who received this message don't often get email from pawell@xxxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> EXTERNAL EMAIL
>
> >
> >On 26-03-03 07:34:54, Pawel Laszczak wrote:
> >> [Some people who received this message don't often get email from
> >pawell@xxxxxxxxxxx. Learn why this is important at
> >https://urldefense.com/v3/__https://aka.ms/LearnAboutSenderIdentification__;!
> >!EHscmS1ygiU1lA!AMXCokQopzhe7zk6kKPFeLLp-
> >yuh1is6xaU_qe56iXLYV9j5bEV_jUOV23iU07J2VMvUVf89LhR60AKPHeqB$ ]
> >>
> >> EXTERNAL EMAIL
> >>
> >> >
> >> >Hi Pawel,
> >> >
> >> >The Cadence USBSSP (CDNSP) controller was previously only accessible
> >> >through PCI, coupling the gadget driver with the PCI glue layer into a single
> >> >monolithic module (cdnsp-udc-pci). This prevented using the CDNSP IP on
> >> >SoC/platform designs that expose the controller through device tree, eg, CIX
> >> >Sky1 SoC.
> >> >
> >> >In this series, it restructures the driver to decouple the CDNSP gadget from
> >> >PCI, and refactor cdnsp-pci.c into a thin PCI-to-platform wrapper (similar to
> >> >cdns3-pci-wrap.c) that registers a platform device and passes PCI resources
> >> >and platform data to the common platform driver. So, please help test it in
> >> >your platform.
> >> >
> >> >The changes are tested with random configuration combination tests.
> >> >
> >> >============================================================
> >> >ALL TESTS COMPLETE. Summary:
> >> >============================================================
> >> >Starting cdns3 config combination tests...
> >> >Timestamp: 2026年 03月 02日 星期一 09:34:47 CST
> >> >
> >> >PASS: all-builtin (SUPPORT=y CDNS3=y GADGET=y HOST=y CDNSP=y
> >> >CDNSP_G=y CDNSP_H=y)
> >> >PASS: support-y_cdns3-m_gadget-y (SUPPORT=y CDNS3=m GADGET=y
> >> >HOST=y CDNSP=y CDNSP_G=y CDNSP_H=y)
> >> >PASS: support-y_cdns3-m_gadget-n (SUPPORT=y CDNS3=m GADGET=n
> >> >HOST=y CDNSP=y CDNSP_G=y CDNSP_H=y)
> >> >PASS: support-y_cdnsp-m_gadget-y (SUPPORT=y CDNS3=y GADGET=y HOST=y
> >> >CDNSP=m CDNSP_G=y CDNSP_H=y)
> >> >PASS: all-module (SUPPORT=m CDNS3=m GADGET=y HOST=y CDNSP=m
> >> >CDNSP_G=y CDNSP_H=y)
> >> >PASS: no-cdns3 (SUPPORT=y CDNS3=n GADGET=n HOST=n CDNSP=y
> >> >CDNSP_G=y CDNSP_H=y)
> >> >PASS: no-gadget (SUPPORT=y CDNS3=y GADGET=n HOST=y CDNSP=y
> >> >CDNSP_G=n CDNSP_H=y)
> >> >PASS: support-y_both-m_gadget-y (SUPPORT=y CDNS3=m GADGET=y HOST=y
> >> >CDNSP=m CDNSP_G=y CDNSP_H=y)
> >> >PASS: minimal-module (SUPPORT=m CDNS3=m GADGET=n HOST=n CDNSP=m
> >> >CDNSP_G=n CDNSP_H=n)
> >> >
> >> >This patch was developed with assistance from Anthropic Claude Opus 4.6.
> >> >
> >>
> >> I can compile the kernel but when I try to install modules with
> >> make modules_install I get error:
> >>
> >> DEPMOD /lib/modules/7.0.0-rc1-new-pci-plat-support-next-20260227+
> >> depmod: ERROR: Cycle detected: cdns_usb_common -> cdnsp ->
> >cdns_usb_common
> >> depmod: ERROR: Cycle detected: udc_core
> >> depmod: ERROR: Found 2 modules in dependency cycles!
> >> make[2]: *** [scripts/Makefile.modinst:132: depmod] Error 1
> >>
> >> It occurs even with minimal configuration:
> >> CONFIG_USB_CDNS_SUPPORT=m
> >> # CONFIG_USB_CDNS3 is not set
> >> CONFIG_USB_CDNSP=m
> >> CONFIG_USB_CDNSP_GADGET=y
> >>
> >
> >Thanks for testing. It needs to let cdns3(p) platform driver as
> >standalone module to fix it. Would you please try below fix on top
> >of my patch set:
> >
> >diff --git a/drivers/usb/cdns3/Makefile b/drivers/usb/cdns3/Makefile
> >index 0e9b20e799d0..63484f145bb9 100644
> >--- a/drivers/usb/cdns3/Makefile
> >+++ b/drivers/usb/cdns3/Makefile
> >@@ -3,12 +3,14 @@
> > CFLAGS_cdns3-trace.o := -I$(src)
> > CFLAGS_cdnsp-trace.o := -I$(src)
> >
> >-cdns-usb-common-y := core.o drd.o cdns3-plat.o
> >+cdns-usb-common-y := core.o drd.o
> >
> > ifeq ($(CONFIG_USB),m)
> > obj-m += cdns-usb-common.o
> >+obj-m += cdns3-plat.o
> > else
> > obj-$(CONFIG_USB_CDNS_SUPPORT) += cdns-usb-common.o
> >+obj-$(CONFIG_USB_CDNS_SUPPORT) += cdns3-plat.o
> > endif
> >
> > cdns-usb-common-$(CONFIG_USB_CDNS_HOST) += host.o
> >
>
> With this fix, the modules installation works correctly.
>
> I have an additional comment regarding the grouping of USBSSP and CDNS3
> options. Currently, they are not grouped together in menuconfig,
> which looks a bit untidy.
> It might be better to move some of the Kconfig configuration higher up
> to ensure they are properly grouped in the menu.
>
Thanks for testing. Would you please comment below question, it depends
on how I do the v2 patch?
> Regards
> Pawel
>
> >Besides, would you please comment [1], the key point is could we
> >keep one platform driver with one compatible string, and cdns3 or cdnsp
> >platform is decided at runtime?
> >
> >[1]
> >https://urldefense.com/v3/__https://www.spinics.net/lists/kernel/msg6072480.
> >html__;!!EHscmS1ygiU1lA!AMXCokQopzhe7zk6kKPFeLLp-
> >yuh1is6xaU_qe56iXLYV9j5bEV_jUOV23iU07J2VMvUVf89LhR60DCMbBxz$
> >
> >--
> >
> >Best regards,
> >Peter
--
Best regards,
Peter