lkml.org 
[lkml]   [2019]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drm/vmwgfx: fix a warning due to missing dma_parms
On Thu, May 23, 2019 at 10:37:19PM -0400, Qian Cai wrote:
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index bf6c3500d363..5c567b81174f 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -747,6 +747,13 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
> if (unlikely(ret != 0))
> goto out_err0;
>
> + dev->dev->dma_parms = kzalloc(sizeof(*dev->dev->dma_parms),
> + GFP_KERNEL);
> + if (!dev->dev->dma_parms)
> + goto out_err0;

What bus does this device come from? I though vmgfx was a (virtualized)
PCI device, in which case this should be provided by the PCI core.
Or are we calling DMA mapping routines on arbitrary other struct device,
in which case that is the real bug and we should switch the PCI device
instead.

> + dma_set_max_seg_size(dev->dev, *dev->dev->dma_mask);

That looks odd. If you want to support an unlimited segment size
just pass UINT_MAX here.

\
 
 \ /
  Last update: 2019-05-24 08:20    [W:0.044 / U:1.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site