lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Jun 2022 12:18:30 +0300
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org
Subject: Re: [PATCH] media: uvcvideo: Fix spurious DMA max segment size
 warnings

Hi Takashi,

(CC'ing Greg and the linux-usb mailing list)

Thank you for the patch.

On Thu, Jun 09, 2022 at 10:22:46AM +0200, Takashi Iwai wrote:
> 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@...e.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);
> +

uvc_stream_to_dmadev() returns the pointer to the HCD's struct device,
which is shared between all drivers on the bus. Is it really fine for a
USB device driver to change the maximum segment size of the HCD device
directly ?

>  	return 0;
>  }
>  

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ