lkml.org 
[lkml]   [2014]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: For the problem when using swiotlb
On Fri, Nov 21, 2014 at 09:35:10AM +0000, Catalin Marinas wrote:
> @@ -88,11 +89,24 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
> {
> if (!dev->dma_mask || !dma_supported(dev, mask))
> return -EIO;
> + /* if asking for bigger dma mask, limit it to the bus dma ranges */
> + if (mask > *dev->dma_mask)
> + mask &= of_dma_get_range_mask(dev);
> *dev->dma_mask = mask;
>
> return 0;
> }

I wonder whether mask &= of_dma_get_range_mask(dev) limiting should
actually be done before actually checking dma_supported(). That's
because a device may try to set a 64-bit mask but being connected to a
more limiting bus, we should check the dma_supported() on the resulting
mask.

--
Catalin


\
 
 \ /
  Last update: 2014-11-21 12:01    [W:0.097 / U:14.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site