浏览代码

Merge tag 'u-boot-dfu-20240606' of https://source.denx.de/u-boot/custodians/u-boot-dfu

u-boot-dfu-20240606

- dwc3 fix crash when ep0 stalls or gadget is stopped
- Kconfig build fix for DFU_SF (SPI flash DFU driver)
Tom Rini 10 月之前
父节点
当前提交
1ebd659cf0
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 0
      drivers/dfu/Kconfig
  2. 2 2
      drivers/usb/dwc3/gadget.c

+ 1 - 0
drivers/dfu/Kconfig

@@ -68,6 +68,7 @@ config DFU_RAM
 
 config DFU_SF
 	bool "SPI flash back end for DFU"
+	depends on SPI_FLASH || DM_SPI_FLASH
 	help
 	  This option enables using DFU to read and write to SPI flash based
 	  storage.

+ 2 - 2
drivers/usb/dwc3/gadget.c

@@ -249,7 +249,7 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
 
 	list_del(&req->list);
 	req->trb = NULL;
-	if (req->request.length)
+	if (req->request.dma && req->request.length)
 		dwc3_flush_cache((uintptr_t)req->request.dma, req->request.length);
 
 	if (req->request.status == -EINPROGRESS)
@@ -257,7 +257,7 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
 
 	if (dwc->ep0_bounced && dep->number == 0)
 		dwc->ep0_bounced = false;
-	else
+	else if (req->request.dma)
 		usb_gadget_unmap_request(&dwc->gadget, &req->request,
 				req->direction);