Skip to content

Commit 86582e6

Browse files
BenjaminGrayNp1mpe
authored andcommitted
powerpc/powermac: Use early_* IO variants in via_calibrate_decr()
On a powermac platform, via the call path: start_kernel() time_init() ppc_md.calibrate_decr() (pmac_calibrate_decr) via_calibrate_decr() ioremap() and iounmap() are called. The unmap can enable interrupts unexpectedly (cond_resched() in vunmap_pmd_range()), which causes a warning later in the boot sequence in start_kernel(). Use the early_* variants of these IO functions to prevent this. The issue is pre-existing, but is surfaced by commit 721255b ("genirq: Use a maple tree for interrupt descriptor management"). Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230706010816.72682-1-bgray@linux.ibm.com
1 parent 2dc0bc1 commit 86582e6

File tree

1 file changed

+3
-3
lines changed
  • arch/powerpc/platforms/powermac

1 file changed

+3
-3
lines changed

arch/powerpc/platforms/powermac/time.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include <linux/rtc.h>
2727
#include <linux/of_address.h>
2828

29+
#include <asm/early_ioremap.h>
2930
#include <asm/sections.h>
30-
#include <asm/io.h>
3131
#include <asm/machdep.h>
3232
#include <asm/time.h>
3333
#include <asm/nvram.h>
@@ -182,7 +182,7 @@ static int __init via_calibrate_decr(void)
182182
return 0;
183183
}
184184
of_node_put(vias);
185-
via = ioremap(rsrc.start, resource_size(&rsrc));
185+
via = early_ioremap(rsrc.start, resource_size(&rsrc));
186186
if (via == NULL) {
187187
printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
188188
return 0;
@@ -207,7 +207,7 @@ static int __init via_calibrate_decr(void)
207207

208208
ppc_tb_freq = (dstart - dend) * 100 / 6;
209209

210-
iounmap(via);
210+
early_iounmap((void *)via, resource_size(&rsrc));
211211

212212
return 1;
213213
}

0 commit comments

Comments
 (0)