* [PATCH] m68k: amiga: lower min_low_pfn to make RAM DMA-able
@ 2026-11-05 13:27 Steffen A. Mork
0 siblings, 0 replies; only message in thread
From: Steffen A. Mork @ 2026-11-05 13:27 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-m68k, linux-kernel, Thorsten Blum, Steffen A. Mork
With reference to the patch by Denis Ahrens for the MVME16x platform, this
patch works in the same way for the Amiga. Currently, all DMA-capable SCSI
controllers have ceased to function due to the same underlying issue. While
the wd33c93=nodma parameter can be used as a workaround for the wd33c93
driver on the Amiga 3000, other drivers —- such as the zorro_esp driver
(tested on a Blizzard 2060) -— fail completely once memory has been
released by free_initmem().
Applying this patch restores proper functionality to both the Amiga 3000
SCSI controller (without requiring the wd33c93=nodma parameter) and the
Blizzard 2060.
Link: https://lore.kernel.org/r/C718B642-57B9-48F3-8C0C-87DCB31A8495@h3q.com
Tested-by: Steffen A. Mork <linux-dev@morknet.de> # native Amiga 2000 with Blizzard 2060
Tested-by: Steffen A. Mork <linux-dev@morknet.de> # FS-UAE virtual Amiga 3000
Signed-off-by: Steffen A. Mork <linux-dev@morknet.de>
---
arch/m68k/amiga/config.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 6e89e7f7e98b..c48aa3dbd837 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -24,6 +24,7 @@
#include <linux/interrupt.h>
#include <linux/zorro.h>
#include <linux/module.h>
+#include <linux/memblock.h>
#include <linux/keyboard.h>
#include <asm/bootinfo.h>
@@ -854,3 +855,38 @@ static void amiga_get_hardware_list(struct seq_file *m)
#ifdef CONFIG_VT
EXPORT_SYMBOL_GPL(key_maps);
#endif
+
+/*
+ * Make all system RAM available for DMA.
+ *
+ * paging_init() sets min_low_pfn to the first free page
+ * after the kernel image. free_initmem() later releases
+ * the init sections, but min_low_pfn remains unchanged.
+ *
+ * This prevents dma_capable() from mapping those pages.
+ */
+static int __init amiga_init_dma_pfn_limit(void)
+{
+ unsigned long pfn = ULONG_MAX;
+ int i;
+
+ for (i = 0; i < m68k_num_memory; i++) {
+ unsigned long mem_pfn;
+
+ mem_pfn = m68k_memory[i].addr >> PAGE_SHIFT;
+
+ if (mem_pfn < pfn)
+ pfn = mem_pfn;
+ }
+
+ if (pfn >= min_low_pfn)
+ return 0;
+
+ pr_info("Amiga: lowering min_low_pfn 0x%lx -> 0x%lx\n",
+ min_low_pfn, pfn);
+
+ min_low_pfn = pfn;
+
+ return 0;
+}
+arch_initcall(amiga_init_dma_pfn_limit);
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-05 13:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-05 13:27 [PATCH] m68k: amiga: lower min_low_pfn to make RAM DMA-able Steffen A. Mork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®