[PATCH] usb: dwc3: set the dma max_seg_size

Ricardo Ribalda posted 1 patch 2 years, 1 month ago
There is a newer version of this series
drivers/usb/dwc3/core.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] usb: dwc3: set the dma max_seg_size
Posted by Ricardo Ribalda 2 years, 1 month ago
Allow devices to have dma operations beyond 4K, and avoid warnings such
as:

DMA-API: dwc3 a600000.usb: mapping sg segment longer than device claims to support [len=86016] [max=65536]

Reported-by: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Found while running 
yavta -f YUYV -s 1280x720 -c  /dev/video0

with:

CONFIG_DMA_API_DEBUG=y
---
 drivers/usb/dwc3/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 343d2570189f..65f73dd8ef47 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1918,6 +1918,8 @@ static int dwc3_probe(struct platform_device *pdev)
 
 	pm_runtime_put(dev);
 
+	dma_set_max_seg_size(dev, UINT_MAX);
+
 	return 0;
 
 err_exit_debugfs:

---
base-commit: 611da07b89fdd53f140d7b33013f255bf0ed8f34
change-id: 20231026-dwc3-fac74fcb3b2a

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>
Re: [PATCH] usb: dwc3: set the dma max_seg_size
Posted by Greg Kroah-Hartman 2 years, 1 month ago
On Thu, Oct 26, 2023 at 12:28:36PM +0000, Ricardo Ribalda wrote:
> Allow devices to have dma operations beyond 4K, and avoid warnings such
> as:
> 
> DMA-API: dwc3 a600000.usb: mapping sg segment longer than device claims to support [len=86016] [max=65536]
> 
> Reported-by: Zubin Mithra <zsm@chromium.org>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> Found while running 
> yavta -f YUYV -s 1280x720 -c  /dev/video0
> 
> with:
> 
> CONFIG_DMA_API_DEBUG=y
> ---
>  drivers/usb/dwc3/core.c | 2 ++
>  1 file changed, 2 insertions(+)

What commit id does this fix?

thanks,

greg k-h