[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190930082310.GA1750@infradead.org>
Date: Mon, 30 Sep 2019 01:23:10 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Nicolas Boichat <drinkcat@...omium.org>
Cc: Shik Chen <shik@...omium.org>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
Tomasz Figa <tfiga@...omium.org>, notify@...nel.org,
Keiichi Watanabe <keiichiw@...omium.org>,
Ricky Liang <jcliang@...omium.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
lkml <linux-kernel@...r.kernel.org>,
kieran.bingham@...asonboard.com, Vlastimil Babka <vbabka@...e.cz>,
Christoph Lameter <cl@...ux.com>,
Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH] media: uvcvideo: Use streaming DMA APIs to transfer
buffers
On Sat, Sep 28, 2019 at 11:33:16AM +0800, Nicolas Boichat wrote:
> > +static gfp_t uvc_alloc_gfp_flags(struct device *dev)
> > +{
> > + u64 mask = dma_get_mask(dev);
> > +
> > + if (dev->bus_dma_mask)
> > + mask &= dev->bus_dma_mask;
> > +
> > + if (mask < DMA_BIT_MASK(32) && IS_ENABLED(CONFIG_ZONE_DMA))
> > + return GFP_DMA;
> > +
> > + if (mask < DMA_BIT_MASK(64)) {
> > + if (IS_ENABLED(CONFIG_ZONE_DMA32))
> > + return GFP_DMA32;
>
> We're hitting issues with this on 64-bit ARM platform, where
> ZONE_DMA32 is enabled (default), the kmalloc allocation with GFP_DMA32
> fails.
>
> There is no slab cache for GFP_DMA32, so those calls are expected to
> fail, AFAICT there are no other (working) kmalloc(..., .. | GFP_DMA32)
> users in the kernel, so I don't think we want to add a cache. If this
> helps, some discussion here why the cache wasn't added:
> https://lore.kernel.org/patchwork/patch/1009563/#1198622
And drivers really have no business looking at the dma mask. I have
a plan for dma_alloc_pages API that could replace that cruft, but
until then please use GFP_KERNEL and let the dma subsystem bounce
buffer if needed.
Powered by blists - more mailing lists