[PATCH v4 19/64] usb: dwc3: import from kernel v4.16
Ilias Apalodimas
ilias.apalodimas at linaro.org
Wed Jul 1 11:26:51 CEST 2026
Hi Marek,
[...]
> >>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> >>> index 07832509584f..e94bf91cc58a 100644
> >>> --- a/drivers/usb/dwc3/core.c
> >>> +++ b/drivers/usb/dwc3/core.c
> >>> @@ -100,6 +100,8 @@ static void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode)
> >>> reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG));
> >>> reg |= DWC3_GCTL_PRTCAPDIR(mode);
> >>> dwc3_writel(dwc->regs, DWC3_GCTL, reg);
> >>> +
> >>> + dwc->current_dr_role = mode;
> >>> }
> >>>
> >>> static void __dwc3_set_mode(struct work_struct *work)
> >>> @@ -133,8 +135,6 @@ static void __dwc3_set_mode(struct work_struct *work)
> >>>
> >>> dwc3_set_prtcap(dwc, dwc->desired_dr_role);
> >>>
> >>> - dwc->current_dr_role = dwc->desired_dr_role;
> >>> -
> >>> spin_unlock_irqrestore(&dwc->lock, flags);
> >>>
> >>> switch (dwc->desired_dr_role) {
> >>> @@ -147,6 +147,7 @@ static void __dwc3_set_mode(struct work_struct *work)
> >>> otg_set_vbus(dwc->usb2_phy->otg, true);
> >>> phy_set_mode(dwc->usb2_generic_phy, PHY_MODE_USB_HOST);
> >>> phy_set_mode(dwc->usb3_generic_phy, PHY_MODE_USB_HOST);
> >>> + phy_calibrate(dwc->usb2_generic_phy);
> >>
> >> Does this actually compile ? I don't think U-Boot code base contains
> >> phy_calibrate() function ?
> >
> > No, I don't expect it does. By the way, it's mentioned in the commit message.
> Can this be made bisectable ?
I personally don't think it's worth the effort even if it's doable. We
had a similar discussion when we did the Makefile bumps from 4.x to
6.x on a community call and we agreed that the period is way too long
for cherry-picked bisectable commits (and the makefike gap started at
~4.16). Besides, if we try and do this bisectable, we'll end up with
patches that contain the cherry-pick + some fixups per patch. We are
not bumping the dwc3 support that wasn't updated for 6 months. This is
literally 12 years of missing updates.
The first iteration of the patches had the fixes bundled in 5 patches.
With this approach we can at least track the commits that got
backported + a final patch to bring back the U-Boot code we had on top
of 3.19-rc1 and any fixes that are required. So before we move this
any further, do you have a preferred way to do this? I'm afraid that
expecting 12 years of commits and ~1459 patches (with the u-boot
changed on top) to be bisectable is not realistic.
Thanks
/Ilias
More information about the U-Boot
mailing list