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, 16 Jun 2022 22:03:11 -0500
From:   Samuel Holland <samuel@...lland.org>
To:     Jernej Skrabec <jernej.skrabec@...il.com>, mripard@...nel.org,
        wens@...e.org
Cc:     airlied@...ux.ie, daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/sun4i: Add DMA mask and segment size

Hi Jernej,

On 6/16/22 4:32 PM, Jernej Skrabec wrote:
> Kernel occasionally complains that there is mismatch in segment size
> when trying to render HW decoded videos and rendering them directly with
> sun4i DRM driver.
> 
> Fix that by setting DMA mask and segment size.
> 
> Signed-off-by: Jernej Skrabec <jernej.skrabec@...il.com>
> ---
>  drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
> index 275f7e4a03ae..83f4e87f77f6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> @@ -7,6 +7,7 @@
>   */
>  
>  #include <linux/component.h>
> +#include <linux/dma-mapping.h>
>  #include <linux/kfifo.h>
>  #include <linux/module.h>
>  #include <linux/of_graph.h>
> @@ -367,6 +368,9 @@ static int sun4i_drv_probe(struct platform_device *pdev)
>  
>  	INIT_KFIFO(list.fifo);
>  
> +	dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));

Isn't this already the default, from of_dma_configure_id or setup_pdev_dma_masks?

> +	dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));

This looks like a good change. In fact, I think we need a similar change in some
other drivers.

Regards,
Samuel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ