| Date | Wed, 4 Mar 2020 16:13:16 +0100 | From | Pavel Machek <> | Subject | Re: [PATCH 4.19 04/87] drm/msm: Set dma maximum segment size for mdss |
| |
Hi!
> Turning on CONFIG_DMA_API_DEBUG_SG results in the following error: > > [ 12.078665] msm ae00000.mdss: DMA-API: mapping sg segment longer than device claims to support [len=3526656] [max=65536] > [ 12.089870] WARNING: CPU: 6 PID: 334 at > /mnt/host/source/src/third_party/kernel/v4.19/kernel/dma/debug.c:1301 > debug_dma_map_sg+0x1dc/0x318
This one leaks resources in the (very improbable) case of error; it needs to goto cleanup instead of simply returning.
> +++ b/drivers/gpu/drm/msm/msm_drv.c > @@ -492,6 +492,14 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) > if (ret) > goto err_msm_uninit; > > + if (!dev->dma_parms) { > + dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms), > + GFP_KERNEL); > + if (!dev->dma_parms) > + return -ENOMEM; > + } > + dma_set_max_seg_size(dev, DMA_BIT_MASK(32)); > + > msm_gem_shrinker_init(ddev); >
Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html [unhandled content-type:application/pgp-signature] |