mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
powerpc: Only do dynamic DMA zone limits on platforms that need it
Scott's patch 1c98025c6c
"Dynamic DMA zone limits" changed
dma_direct_alloc_coherent() to start using dev->coherent_dma_mask.
That seems fair enough, but it exposes the fact that some of the drivers
we care about on IBM platforms aren't setting the coherent mask.
The proper fix is to have drivers set the coherent mask and also have
the platform code honor it.
For now, just restrict the dynamic DMA zone limits to the platforms that
need it.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
parent
86be175a73
commit
e89dafb5ca
1 changed files with 8 additions and 0 deletions
|
@ -53,9 +53,16 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
|
||||||
#else
|
#else
|
||||||
struct page *page;
|
struct page *page;
|
||||||
int node = dev_to_node(dev);
|
int node = dev_to_node(dev);
|
||||||
|
#ifdef CONFIG_FSL_SOC
|
||||||
u64 pfn = get_pfn_limit(dev);
|
u64 pfn = get_pfn_limit(dev);
|
||||||
int zone;
|
int zone;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This code should be OK on other platforms, but we have drivers that
|
||||||
|
* don't set coherent_dma_mask. As a workaround we just ifdef it. This
|
||||||
|
* whole routine needs some serious cleanup.
|
||||||
|
*/
|
||||||
|
|
||||||
zone = dma_pfn_limit_to_zone(pfn);
|
zone = dma_pfn_limit_to_zone(pfn);
|
||||||
if (zone < 0) {
|
if (zone < 0) {
|
||||||
dev_err(dev, "%s: No suitable zone for pfn %#llx\n",
|
dev_err(dev, "%s: No suitable zone for pfn %#llx\n",
|
||||||
|
@ -73,6 +80,7 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
#endif /* CONFIG_FSL_SOC */
|
||||||
|
|
||||||
/* ignore region specifiers */
|
/* ignore region specifiers */
|
||||||
flag &= ~(__GFP_HIGHMEM);
|
flag &= ~(__GFP_HIGHMEM);
|
||||||
|
|
Loading…
Reference in a new issue