public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: uvcvideo: Fix spurious DMA max segment size warnings
@ 2022-06-09  8:22 Takashi Iwai
  2022-06-09  9:18 ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2022-06-09  8:22 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel

As default, the DMA max segment size is set to 64k, and uvcvideo may
overflow that size easily, resulting in a warning like:

  DMA-API: xhci_hcd 0000:00:14.0: mapping sg segment longer than device claims to support [len=98304] [max=65536]

Explicitly set up the DMA max segment size for avoiding spurious kernel
warnings.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/media/usb/uvc/uvc_video.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 1b4cc934109e..25aa6e6a6906 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -2160,6 +2160,8 @@ int uvc_video_init(struct uvc_streaming *stream)
 	for_each_uvc_urb(uvc_urb, stream)
 		INIT_WORK(&uvc_urb->work, uvc_video_copy_data_work);
 
+	dma_set_max_seg_size(uvc_stream_to_dmadev(stream), UINT_MAX);
+
 	return 0;
 }
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-10 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-09  8:22 [PATCH] media: uvcvideo: Fix spurious DMA max segment size warnings Takashi Iwai
2022-06-09  9:18 ` Laurent Pinchart
2022-06-10  8:57   ` Greg Kroah-Hartman
2022-06-10 11:13     ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox