powerpc/dma: Always configure ZONE_DMA32 correctly
PATCH 1/3 powerpc/dma: Always configure ZONE_DMA32 correctly
We do this for consistency and also in order to support the use of a consistent mask smaller than the dma mask in subsequent patches.
--- arch/powerpc/kernel/dma-swiotlb.c | 3 --- arch/powerpc/mm/mem.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-)
arch/powerpc/kernel/dma-swiotlb.c +0 -3
@@ -110,9 +110,6 @@ void __init swiotlb_detect_4g(void) {if ((memblock_end_of_DRAM () -1 ) >0xffffffff ) { ppc_swiotlb_enable =1 ; -#ifdef CONFIG_ZONE_DMA32 -limit_zone_pfn (ZONE_DMA32 , (1ULL <<32 ) >>PAGE_SHIFT ); -#endif } }
arch/powerpc/mm/mem.c +6 -0
@@ -307,6 +307,12 @@ void __init paging_init(void)printk (KERN_DEBUG "Memory hole size: %ldMB\n" , (long int )((top_of_ram - total_ram) >>20 )); +#ifdef CONFIG_ZONE_DMA32 +/* Default limit for ZONE_DMA32, platform might limit it +* further due to PCI bridge addressing limitations +*/ +limit_zone_pfn (ZONE_DMA32 , (1ULL <<32 ) >>PAGE_SHIFT ); +#endif #ifdef CONFIG_HIGHMEM top_zone =ZONE_HIGHMEM ;limit_zone_pfn (ZONE_NORMAL , lowmem_end_addr >>PAGE_SHIFT );
Quoted 28 lines · Benjamin Herrenschmidt
We do this for consistency and also in order to support the use of a consistent mask smaller than the dma mask in subsequent patches.
Signed-off-by Benjamin Herrenschmidt <[email protected]>--- arch/powerpc/kernel/dma-swiotlb.c | 3 --- arch/powerpc/mm/mem.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-)arch/powerpc/kernel/dma-swiotlb.c +0
-3@@ -110,9 +110,6 @@ void __init swiotlb_detect_4g(void) {if ((memblock_end_of_DRAM () -1 ) >0xffffffff ) { ppc_swiotlb_enable =1 ; -#ifdef CONFIG_ZONE_DMA32 -limit_zone_pfn (ZONE_DMA32 , (1ULL <<32 ) >>PAGE_SHIFT ); -#endif } }arch/powerpc/mm/mem.c +0
-0
arch/powerpc/mm/mem.c void __init paging_init(void) · line 316
Quoted 10 lines
arch/powerpc/mm/mem.c +6
-0@@ -307,6 +307,12 @@ void __init paging_init(void)printk (KERN_DEBUG "Memory hole size: %ldMB\n" , (long int )((top_of_ram - total_ram) >>20 )); +#ifdef CONFIG_ZONE_DMA32 +/* Default limit for ZONE_DMA32, platform might limit it +* further due to PCI bridge addressing limitations +*/ +limit_zone_pfn (ZONE_DMA32 , (1ULL <<32 ) >>PAGE_SHIFT ); +#endif #ifdef CONFIG_HIGHMEM
Hmm, won't this break the PCI on the fsl SoCs? The ZONE_DMA32 is set to 2GB due to the PCI inbound window limitation on fsl SoCs. This will override that unconditionally. Please see the commit 84f44cc56c09 ("powerpc/fsl-pci:
Limit ZONE_DMA32 to 2GiB on 64-bit platforms") for more detail.
Thanks,
Kevin
Quoted 32 lines · Kevin Hao
Quoted 31 lines · Benjamin Herrenschmidt
We do this for consistency and also in order to support the use of a consistent mask smaller than the dma mask in subsequent patches.
Signed-off-by Benjamin Herrenschmidt <[email protected]>--- arch/powerpc/kernel/dma-swiotlb.c | 3 --- arch/powerpc/mm/mem.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-)arch/powerpc/kernel/dma-swiotlb.c +0
-3@@ -110,9 +110,6 @@ void __init swiotlb_detect_4g(void) {if ((memblock_end_of_DRAM () -1 ) >0xffffffff ) { ppc_swiotlb_enable =1 ; -#ifdef CONFIG_ZONE_DMA32 -limit_zone_pfn (ZONE_DMA32 , (1ULL <<32 ) >>PAGE_SHIFT ); -#endif } }arch/powerpc/mm/mem.c +0
-0@@ -307,6 +307,12 @@ void __init paging_init(void)printk (KERN_DEBUG "Memory hole size: %ldMB\n" , (long int )((top_of_ram - total_ram) >>20 ));
Quoted 12 lines
arch/powerpc/mm/mem.c void __init paging_init(void) · line 316
Quoted 7 lines
arch/powerpc/mm/mem.c +6
-0+#ifdef CONFIG_ZONE_DMA32 +/* Default limit for ZONE_DMA32, platform might limit it +* further due to PCI bridge addressing limitations +*/ +limit_zone_pfn (ZONE_DMA32 , (1ULL <<32 ) >>PAGE_SHIFT ); +#endif #ifdef CONFIG_HIGHMEM Hmm, won't this break the PCI on the fsl SoCs? The
ZONE_DMA32is set to 2GB due to the PCI inbound window limitation on fsl SoCs. This will override that unconditionally. Please see the commit84f44cc56c09("powerpc/fsl-pci:
LimitZONE_DMA32to 2GiB on 64-bit platforms") for more detail.
No it won't, or am I missing something ? Ie, limit_zone_pfn() will only reduce the size of the window, never increase it.
Cheers,
Ben.
Quoted 2 lines
Thanks,
Kevin
Quoted 2 lines · Benjamin Herrenschmidt
No it won't, or am I missing something ? Ie,
limit_zone_pfn()will only reduce the size of the window, never increase it.
Yes, you are right. Just overlook this. Sorry for the noise.
Thanks,
Kevin