[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201404221552.00501.arnd@arndb.de>
Date: Tue, 22 Apr 2014 15:52:00 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Ley Foon Tan <lftan@...era.com>
Cc: linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, lftan.linux@...il.com,
cltang@...esourcery.com
Subject: Re: [PATCH 14/28] nios2: DMA mapping API
On Friday 18 April 2014, Ley Foon Tan wrote:
> +static inline int dma_supported(struct device *dev, u64 mask)
> +{
> + /* we fall back to GFP_DMA when the mask isn't all 1s,
> + * so we can't guarantee allocations that must be
> + * within a tighter range than GFP_DMA.
> + */
> + if (mask < 0x00ffffff)
> + return 0;
> +
> + return 1;
> +}
> +void *dma_alloc_coherent(struct device *dev, size_t size,
> + dma_addr_t *dma_handle, gfp_t gfp)
> +{
> + void *ret;
> +
> + /* ignore region specifiers */
> + gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
> +
> + /* optimized page clearing */
> + gfp |= __GFP_ZERO;
> +
> + if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
> + gfp |= GFP_DMA;
What is the significance of ZONE_DMA on this architecture?
Do you actually have DMA masters with a 0x00ffffff mask?
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists