From ebe2af6cd8a623140ae7a87470e808959b186dd6 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 23 Mar 2026 13:53:08 -0600 Subject: [PATCH 1/4] usb: gadget: Correct dependencies for USB_RENESAS_USBHS The USB_RENESAS_USBHS functionality can only work with DM_USB_GADGET enabled, so express this dependency in Kconfig. Signed-off-by: Tom Rini Reviewed-by: Marek Vasut --- drivers/usb/gadget/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 18582962249..5390878254a 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -119,6 +119,7 @@ config USB_GADGET_DWC2_OTG config USB_RENESAS_USBHS bool "Renesas R-Car USB2.0 HS controller (gadget mode)" + depends on DM_USB_GADGET select USB_GADGET_DUALSPEED help The Renesas R-Car USB 2.0 high-speed gadget controller From 93f96c7d8da78f652f2b5142390f47eb872438f7 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 23 Mar 2026 08:32:02 -0600 Subject: [PATCH 2/4] reset: Correct dependencies for RESET_RZG2L_USBPHY_CTRL As exposed by "make randconfig", we have an issue with the dependencies for RESET_RZG2L_USBPHY_CTRL. As this functionally depends on REGULATOR_RZG2L_USBPHY, express this dependency directly in Kconfig as well. Signed-off-by: Tom Rini Reviewed-by: Marek Vasut --- drivers/reset/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 66911199c8b..ebf484d9df4 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -239,8 +239,7 @@ config RESET_AT91 config RESET_RZG2L_USBPHY_CTRL bool "Enable support for Renesas RZ/G2L USB 2.0 PHY control" - depends on DM_RESET - select REGULATOR_RZG2L_USBPHY + depends on DM_RESET && REGULATOR_RZG2L_USBPHY help Enable support for controlling USB 2.0 PHY resets on the Renesas RZ/G2L SoC. This is required for USB 2.0 functionality to work on this From 5040410102239a6afd85665c7cfd35bd3f82352c Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 23 Mar 2026 08:38:36 -0600 Subject: [PATCH 3/4] usb: Correct dependencies around USB_EMUL The symbol USB_EMUL is how sandbox has access to USB. It's implementation however enforces a few other requirements. It must have SCSI enabled, and in turn that means it must have BLK enabled. Finally, we should not be using SANDBOX itself as a symbol to decide what to build or not build here, as SANDBOX is selected for COMPILE_TEST builds as well and so may not have enabled the sandbox specific USB support. Signed-off-by: Tom Rini Reviewed-by: Marek Vasut --- drivers/usb/emul/Kconfig | 1 + drivers/usb/host/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/emul/Kconfig b/drivers/usb/emul/Kconfig index 279f6c6d740..6305f2496c3 100644 --- a/drivers/usb/emul/Kconfig +++ b/drivers/usb/emul/Kconfig @@ -2,6 +2,7 @@ config USB_EMUL bool "Support for USB device emulation" depends on SANDBOX select DM_USB + select SCSI select USB_HOST help Since sandbox does not have access to a real USB bus, it is possible diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index ef4ce62a680..9cac53f07c7 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -5,7 +5,7 @@ ifdef CONFIG_$(PHASE_)DM_USB obj-y += usb-uclass.o -obj-$(CONFIG_SANDBOX) += usb-sandbox.o +obj-$(CONFIG_USB_EMUL) += usb-sandbox.o endif ifdef CONFIG_$(PHASE_)USB_STORAGE From cc8195b13b12cde3192978df64fd8bfac0f591f4 Mon Sep 17 00:00:00 2001 From: Balaji Selvanathan Date: Thu, 7 May 2026 20:50:35 +0530 Subject: [PATCH 4/4] usb: dwc3: Fix crash on fastboot exit due to incorrect memory free The dwc3_free_one_event_buffer() function incorrectly called free() on event buffer structures allocated with devm_kzalloc(). This caused heap corruption and a synchronous abort when exiting fastboot mode via "fastboot continue". Device-managed memory is automatically freed when the device is removed, so manual deallocation causes the heap allocator to access corrupted metadata. Fixes: 884b10e86a05 ("usb: dwc3: core: fix memory leaks in event buffer cleanup") Signed-off-by: Balaji Selvanathan Reviewed-by: Marek Vasut --- drivers/usb/dwc3/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 0dee14c8b59..be198041f08 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -208,7 +208,6 @@ static void dwc3_free_one_event_buffer(struct dwc3 *dwc, struct dwc3_event_buffer *evt) { dma_free_coherent(evt->buf); - free(evt); } /**