Skip to contentSkip to conversation

powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

PATCH Applied Christoph Hellwig 7 participants 12 messages Jun 13, 2019 – Jun 23, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")
---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +7 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks.
+ */
+#ifdef CONFIG_PPC32
+#define ARCH_ZONE_DMA_BITS 30
+#else
 #define ARCH_ZONE_DMA_BITS 31
+#endif
 
 #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
index cba29131bccc..2540d3b2588c 100644
@@ -248,7 +248,8 @@ void __init paging_init(void)
 	       (long int)((top_of_ram - total_ram) >> 20));
 
 #ifdef CONFIG_ZONE_DMA
-	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT);
+	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn,
+			((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT);
 #endif
 	max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
arch/powerpc/platforms/powermac/Kconfig +1 -0
index f834a19ed772..c02d8c503b29 100644
@@ -7,6 +7,7 @@ config PPC_PMAC
 	select PPC_INDIRECT_PCI if PPC32
 	select PPC_MPC106 if PPC32
 	select PPC_NATIVE
+	select ZONE_DMA if PPC32
 	default y
 
 config PPC_PMAC64
Signature · 1 line
2.20.1
Tested-by Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Christoph Hellwig

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")

As expected, it works. The patch needs
Cc: Stable <stable*vger.kernel.org> # v5.1+

Thanks for the help, and the patience with my debugging problems with u64 variables.

Larry

#2 lore raw
In reply to Christoph Hellwig
Quoted 20 lines · Christoph Hellwig

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")
---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +0 -0
index b8286a2013b4..0d52f57fca04 100644

arch/powerpc/include/asm/page.h struct vm_area_struct; · line 323

Quoted 5 lines
arch/powerpc/include/asm/page.h +2 -0
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks.

nit: would it be possible to mention explicit reference to b43-legacy. Using b43 on my macmini g4 never showed those symptoms (using 5.2.0-rc2+)

$ dmesg | grep b43
[   14.327189] bus: 'pci': add driver b43-pci-bridge
[   14.345354] bus: 'pci': driver_probe_device: matched device
0001:10:12.0 with driver b43-pci-bridge
[   14.380110] bus: 'pci': really_probe: probing driver b43-pci-bridge
with device 0001:10:12.0
[   14.440295] b43-pci-bridge 0001:10:12.0: enabling device (0004 -> 0006)
[   14.637223] b43-pci-bridge 0001:10:12.0: Sonics Silicon Backplane
found on PCI device 0001:10:12.0
[   14.644858] driver: 'b43-pci-bridge': driver_bound: bound to device
'0001:10:12.0'
[   14.743341] bus: 'pci': really_probe: bound device 0001:10:12.0 to
driver b43-pci-bridge
[   18.724343] bus: 'bcma': add driver b43
[   18.728635] bus: 'ssb': add driver b43
[   18.734305] bus: 'ssb': driver_probe_device: matched device ssb0:0
with driver b43
[   18.743155] bus: 'ssb': really_probe: probing driver b43 with device ssb0:0
[   18.747782] b43-phy0: Broadcom 4306 WLAN found (core revision 5)
[   18.767439] b43-phy0: Found PHY: Analog 2, Type 2 (G), Revision 2
[   18.771759] b43-phy0: Found Radio: Manuf 0x17F, ID 0x2050, Revision
2, Version 0
[   18.795467] driver: 'b43': driver_bound: bound to device 'ssb0:0'
[   18.801533] bus: 'ssb': really_probe: bound device ssb0:0 to driver b43
[   22.143084] b43-phy0: Loading firmware version 666.2 (2011-02-23 01:15:07)
[   25.133011] b43 ssb0:0 wlan0: disabling HT as WMM/QoS is not
supported by the AP
[   25.140221] b43 ssb0:0 wlan0: disabling VHT as WMM/QoS is not
supported by the AP
Quoted 37 lines
arch/powerpc/include/asm/page.h +5 -0
+ */
+#ifdef CONFIG_PPC32
+#define ARCH_ZONE_DMA_BITS 30
+#else
 #define ARCH_ZONE_DMA_BITS 31
+#endif
 
 #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
index cba29131bccc..2540d3b2588c 100644
@@ -248,7 +248,8 @@ void __init paging_init(void)
               (long int)((top_of_ram - total_ram) >> 20));
 
 #ifdef CONFIG_ZONE_DMA
-       max_zone_pfns[ZONE_DMA] = min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT);
+       max_zone_pfns[ZONE_DMA] = min(max_low_pfn,
+                       ((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT);
 #endif
        max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
arch/powerpc/platforms/powermac/Kconfig +1 -1
index f834a19ed772..c02d8c503b29 100644
@@ -7,6 +7,7 @@ config PPC_PMAC
        select PPC_INDIRECT_PCI if PPC32
        select PPC_MPC106 if PPC32
        select PPC_NATIVE
+       select ZONE_DMA if PPC32
        default y
 
 config PPC_PMAC64
--

2.20.1

#3 lore raw

Hi,

Quoted 23 lines · Mathieu Malaterre
Quoted 22 lines · Christoph Hellwig

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")
---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +0 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
Quoted 6 lines

arch/powerpc/include/asm/page.h struct vm_area_struct; · line 323

Quoted 2 lines
arch/powerpc/include/asm/page.h +2 -0
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks.

nit: would it be possible to mention explicit reference to b43-legacy. Using b43 on my macmini g4 never showed those symptoms (using 5.2.0-rc2+)

According to Wikipedia Mac mini G4 is limited to 1 GB RAM, so that's why you don't see the issue.

A.

#4 lore raw
Quoted 33 lines · Aaro Koskinen

Hi,

Quoted 23 lines · Mathieu Malaterre
Quoted 22 lines · Christoph Hellwig

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")
---
  arch/powerpc/include/asm/page.h         | 7 +++++++
  arch/powerpc/mm/mem.c                   | 3 ++-
  arch/powerpc/platforms/powermac/Kconfig | 1 +
  3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +0 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
  #endif /* __ASSEMBLY__ */
  #include <asm/slice.h>
 
Quoted 6 lines

arch/powerpc/include/asm/page.h struct vm_area_struct; · line 323

Quoted 2 lines
arch/powerpc/include/asm/page.h +2 -0
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks.

nit: would it be possible to mention explicit reference to b43-legacy. Using b43 on my macmini g4 never showed those symptoms (using 5.2.0-rc2+)

Quoted 2 lines

According to Wikipedia Mac mini G4 is limited to 1 GB RAM, so that's why you don't see the issue.

He wouldn't see it with b43. Those cards have 32-bit DMA.

Larry

Tested-by on v1 1/1
#5 lore raw
In reply to Christoph Hellwig

Hi,

Quoted 8 lines · Christoph Hellwig

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")

A.

Quoted 53 lines
---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +7 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks.
+ */
+#ifdef CONFIG_PPC32
+#define ARCH_ZONE_DMA_BITS 30
+#else
 #define ARCH_ZONE_DMA_BITS 31
+#endif
 
 #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
index cba29131bccc..2540d3b2588c 100644
@@ -248,7 +248,8 @@ void __init paging_init(void)
 	       (long int)((top_of_ram - total_ram) >> 20));
 
 #ifdef CONFIG_ZONE_DMA
-	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT);
+	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn,
+			((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT);
 #endif
 	max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
arch/powerpc/platforms/powermac/Kconfig +1 -0
index f834a19ed772..c02d8c503b29 100644
@@ -7,6 +7,7 @@ config PPC_PMAC
 	select PPC_INDIRECT_PCI if PPC32
 	select PPC_MPC106 if PPC32
 	select PPC_NATIVE
+	select ZONE_DMA if PPC32
 	default y
 
 config PPC_PMAC64
Signature · 1 line
2.20.1
#6 lore raw
In reply to Christoph Hellwig

Any chance this could get picked up to fix the regression?

Quoted 60 lines · Christoph Hellwig

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")
---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +7 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks.
+ */
+#ifdef CONFIG_PPC32
+#define ARCH_ZONE_DMA_BITS 30
+#else
 #define ARCH_ZONE_DMA_BITS 31
+#endif
 
 #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
index cba29131bccc..2540d3b2588c 100644
@@ -248,7 +248,8 @@ void __init paging_init(void)
 	       (long int)((top_of_ram - total_ram) >> 20));
 
 #ifdef CONFIG_ZONE_DMA
-	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT);
+	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn,
+			((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT);
 #endif
 	max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
arch/powerpc/platforms/powermac/Kconfig +1 -0
index f834a19ed772..c02d8c503b29 100644
@@ -7,6 +7,7 @@ config PPC_PMAC
 	select PPC_INDIRECT_PCI if PPC32
 	select PPC_MPC106 if PPC32
 	select PPC_NATIVE
+	select ZONE_DMA if PPC32
 	default y
 
 config PPC_PMAC64
Signature · 1 line
2.20.1

---end quoted text---

#7 lore raw
Quoted 1 line · Christoph Hellwig

Any chance this could get picked up to fix the regression?

Was hoping Ben would Ack it. He's still powermac maintainer :)

I guess he OK'ed it in the other thread, will add it to my queue.

cheers

Quoted 62 lines · Christoph Hellwig
Quoted 60 lines

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")
---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +7 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many powerbooks.
+ */
+#ifdef CONFIG_PPC32
+#define ARCH_ZONE_DMA_BITS 30
+#else
 #define ARCH_ZONE_DMA_BITS 31
+#endif
 
 #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
index cba29131bccc..2540d3b2588c 100644
@@ -248,7 +248,8 @@ void __init paging_init(void)
 	       (long int)((top_of_ram - total_ram) >> 20));
 
 #ifdef CONFIG_ZONE_DMA
-	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT);
+	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn,
+			((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT);
 #endif
 	max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
arch/powerpc/platforms/powermac/Kconfig +1 -0
index f834a19ed772..c02d8c503b29 100644
@@ -7,6 +7,7 @@ config PPC_PMAC
 	select PPC_INDIRECT_PCI if PPC32
 	select PPC_MPC106 if PPC32
 	select PPC_NATIVE
+	select ZONE_DMA if PPC32
 	default y
 
 config PPC_PMAC64
Signature · 1 line
2.20.1

---end quoted text---

#8 lore raw
Quoted 6 lines · Michael Ellerman
Quoted 1 line · Christoph Hellwig

Any chance this could get picked up to fix the regression?

Was hoping Ben would Ack it. He's still powermac maintainer :)

I guess he OK'ed it in the other thread, will add it to my queue.

Yeah ack. If I had written it myself, I would have made the DMA bits a variable and only set it down to 30 if I see that device in the DT early on, but I can't be bothered now, if it works, ship it :-)

Note: The patch affects all ppc32, though I don't think it will cause any significant issue on those who don't need it.

Cheers,
Ben.

Quoted 72 lines

cheers

Quoted 70 lines · Christoph Hellwig
Quoted 67 lines

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks
stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove

dma_nommu_dma_supported")

---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +2 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many

powerbooks.
+ */

arch/powerpc/include/asm/page.h +4 -0
+#ifdef CONFIG_PPC32
+#define ARCH_ZONE_DMA_BITS 30
+#else
 #define ARCH_ZONE_DMA_BITS 31
+#endif
 
 #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
index cba29131bccc..2540d3b2588c 100644
@@ -248,7 +248,8 @@ void __init paging_init(void)
 	       (long int)((top_of_ram - total_ram) >> 20));
 
 #ifdef CONFIG_ZONE_DMA
-	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn, 0x7fffffffUL
 >> PAGE_SHIFT);
+	max_zone_pfns[ZONE_DMA]	= min(max_low_pfn,
+			((1UL << ARCH_ZONE_DMA_BITS) - 1) >>
 PAGE_SHIFT);
 #endif
arch/powerpc/mm/mem.c +0 -0
 	max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
 #ifdef CONFIG_HIGHMEM
arch/powerpc/platforms/powermac/Kconfig +1 -0
index f834a19ed772..c02d8c503b29 100644
@@ -7,6 +7,7 @@ config PPC_PMAC
 	select PPC_INDIRECT_PCI if PPC32
 	select PPC_MPC106 if PPC32
 	select PPC_NATIVE
+	select ZONE_DMA if PPC32
 	default y
 
 config PPC_PMAC64
Signature · 1 line
2.20.1

---end quoted text---

#9 lore raw
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 5 lines · Michael Ellerman
Quoted 1 line · Christoph Hellwig

Any chance this could get picked up to fix the regression?

Was hoping Ben would Ack it. He's still powermac maintainer :)

Quoted 8 lines
Quoted 1 line

I guess he OK'ed it in the other thread, will add it to my queue.

Yeah ack. If I had written it myself, I would have made the DMA bits a variable and only set it down to 30 if I see that device in the DT early on, but I can't be bothered now, if it works, ship it :-)

Note: The patch affects all ppc32, though I don't think it will cause any significant issue on those who don't need it.

Thanks, that answer my earlier question.

Quoted 76 lines

Cheers,
Ben.

Quoted 72 lines

cheers

Quoted 70 lines · Christoph Hellwig
Quoted 66 lines

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks
stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove

dma_nommu_dma_supported")

---
 arch/powerpc/include/asm/page.h         | 7 +++++++
 arch/powerpc/mm/mem.c                   | 3 ++-
 arch/powerpc/platforms/powermac/Kconfig | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/page.h +2 -0
index b8286a2013b4..0d52f57fca04 100644
@@ -319,6 +319,13 @@ struct vm_area_struct;
 #endif /* __ASSEMBLY__ */
 #include <asm/slice.h>
 
+/*
+ * Allow 30-bit DMA for very limited Broadcom wifi chips on many

powerbooks.
+ */

arch/powerpc/include/asm/page.h +4 -0
+#ifdef CONFIG_PPC32
+#define ARCH_ZONE_DMA_BITS 30
+#else
 #define ARCH_ZONE_DMA_BITS 31
+#endif
 
 #endif /* _ASM_POWERPC_PAGE_H */
arch/powerpc/mm/mem.c +2 -1
index cba29131bccc..2540d3b2588c 100644
@@ -248,7 +248,8 @@ void __init paging_init(void)
         (long int)((top_of_ram - total_ram) >> 20));
 
 #ifdef CONFIG_ZONE_DMA
- max_zone_pfns[ZONE_DMA] = min(max_low_pfn, 0x7fffffffUL
 >> PAGE_SHIFT);
+ max_zone_pfns[ZONE_DMA] = min(max_low_pfn,
+                 ((1UL << ARCH_ZONE_DMA_BITS) - 1) >>
 PAGE_SHIFT);
 #endif

max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
#ifdef CONFIG_HIGHMEM

arch/powerpc/platforms/powermac/Kconfig +1 -1
index f834a19ed772..c02d8c503b29 100644
@@ -7,6 +7,7 @@ config PPC_PMAC
  select PPC_INDIRECT_PCI if PPC32
  select PPC_MPC106 if PPC32
  select PPC_NATIVE
+ select ZONE_DMA if PPC32
  default y
 
 config PPC_PMAC64
--
Quoted 1 line

2.20.1

---end quoted text---

#10 lore raw
In reply to Benjamin Herrenschmidt
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 6 lines · Michael Ellerman
Quoted 1 line · Christoph Hellwig

Any chance this could get picked up to fix the regression?

Was hoping Ben would Ack it. He's still powermac maintainer :)

I guess he OK'ed it in the other thread, will add it to my queue.

Yeah ack. If I had written it myself, I would have made the DMA bits a variable and only set it down to 30 if I see that device in the DT early on, but I can't be bothered now, if it works, ship it :-)

OK, we can do that next release if someone's motivated.

Quoted 2 lines

Note: The patch affects all ppc32, though I don't think it will cause any significant issue on those who don't need it.

Yeah. We could always hide it behind CONFIG_PPC_PMAC if it becomes a problem.

cheers

#11 lore raw
In reply to Christoph Hellwig
Quoted 11 lines · Christoph Hellwig

With the strict dma mask checking introduced with the switch to the generic DMA direct code common wifi chips on 32-bit powerbooks stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds to allow them to reliably allocate dma coherent memory.

Fixes 65a21b71f948 ("powerpc/dma: remove dma_nommu_dma_supported")

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/9739ab7eda459f0669ec9807e0d9be5020bab88c

cheers