[RFC PATCH 0/5] drivers: usb: dwc3: sync code with Linux v6.16-rc1

Jerome Forissier jerome.forissier at linaro.org
Tue Nov 25 10:41:46 CET 2025


Hi Marek,

On 11/23/25 21:39, Marek Vasut wrote:
> On 11/21/25 4:37 PM, Jerome Forissier wrote:
>> The DWC3 USB driver was forked from the Linux kernel v3.19-rc1 eleven
>> years ago by commit 85d5e7075f33 ("usb: dwc3: add dwc3 folder from linux
>> kernel to u-boot"). Since then, not many kernel changes have been ported
>> back into to U-Boot. This series is an attempt at synchronizing the code
>> with a somewhat current kernel (namely, v6.16.rc7 which was the latest
>> released when this effort was started).
>>
>> - The first three commits ("usb: dwc3: re-import from kernel v6.16-rc7",
>>    "usb: host: re-import xhci-ext-caps.h from kernel", usb: gadget:
>>    re-import epautoconf.c from kernel v6.16-rc7" and "usb: udc: re-import
>>    udc-core.c from kernel v6.16-rc7") replace files with their counterpart
>>    from the kernel, unmodified.
>> - The last commit ("usb: fix build after resync of DWC3 with kernel
>>    v6.16-rc7") makes the necessary changes to adapt to U-Boot and fix the
>>    build.
>>
>> Note that this is mostly compile-tested only. The CI pipeline on
>> source.denx.de was used as a OK/NOK indicator [0]. Only one config was
>> actually tested on real hardware: xilinx_zynqmp_kria_defconfig. With the
>> help of a custom build script [1] and with an additional patch [2], I
>> could boot the Kria KV260 board and make it detect a USB SSD plugged into
>> one of its USB 3.0 ports. It certainly doesn't mean all platforms using
>> the DWC3 driver are still OK, but at least there is some hope. If this
>> breaks your platform I'd like to know, and if you can send a fix it's
>> even better.
>>
>> I realize this is a big change and I did it this way essentially to get
>> going and be able to post this RFC. But I am not saying this is the way
>> the re-sync has to be done. Feedback is welcome.
> 
> Thank you for doing this.
> 
> Do you plan to sync this further to 6.18 ?

I suppose it would not be too hard. I can do it once we agree on the
method.

> 
> I will also ask the usual question -- would it be possible to cherry-pick this from old Linux until current state commit-by-commit ?

I don't think it's practical, see below.

> I can imagine the process would be:
> - Identify which Linux kernel commit was used as a starting point for the U-Boot DWC3 driver

u-boot (master)$ git log --oneline --no-merges drivers/usb/dwc3 | tail -1
85d5e7075f33 usb: dwc3: add dwc3 folder from linux kernel to u-boot

u-boot (master)$ git show --shortstat 85d5e7075f3
commit 85d5e7075f33e97079886027104591ff53d6363b
Author: Kishon Vijay Abraham I <kishon at ti.com>
Date:   Mon Feb 23 18:39:50 2015 +0530

	usb: dwc3: add dwc3 folder from linux kernel to u-boot

	Added dwc3 folder from linux kernel 3.19-rc1 (97bf6af1f9)
	to u-boot. This will be adapted to work with u-boot in the
	following patches.

	Signed-off-by: Kishon Vijay Abraham I <kishon at ti.com>
	Reviewed-by: Lukasz Majewski <l.majewski at samsung.com>

 21 files changed, 9679 insertions(+)

> - Undo all changes from the U-Boot DWC3 driver applied since

OK, that one is relatively easy.

> - Cherry-pick new Linux kernel patches

linux (master)$ git describe
v6.18-rc7

linux (master)$ git log --oneline --no-merges v3.19-rc1..HEAD drivers/usb/dwc3 | wc -l
1347

That's a lot of commits. What exactly do we gain by doing this? Some
of the commits are not applicable to u-boot or need adaptations
(unsupported platforms, power management, debug/tracing, interrupts,
and probably other things I don't remember).

> - Check what might be missing

Essentially, many of the u-boot commits in:

u-boot (master)$ git log --oneline --no-merges 85d5e7075f3..HEAD drivers/usb/dwc3 | wc -l
216

I compared the linux and u-boot commit log and only 13 of these 216
commits have the exact same subject as a Linux commit after v3.19-rc1.
So that's probably 13 cherry-picks and 203 commits that are more or
less u-boot specific.

Also note that the DWC3 driver has dependencies on:

drivers/usb/host/xhci-ext-caps.h
drivers/usb/gadget/epautoconf.c
drivers/usb/gadget/udc/udc-core.c

...which also need to be synced so that's a few more commits to
cherry-pick actually.

All things being considered, I think it is better to minimize the
number of commits. Sync with linux then fix. We can probably squash
the first three commits in my series so that only one commit is broken
build-wise. This way there is little impact on bisectability.

In any case we also need more testing on real boards.

Thanks,
-- 
Jerome


More information about the U-Boot mailing list