From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Benjamin Gray <bgray@linux.ibm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Michael Ellerman <mpe@ellerman.id.au>,
Sasha Levin <sashal@kernel.org>,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH AUTOSEL 6.1 9/9] powerpc/powermac: Use early_* IO variants in via_calibrate_decr()
Date: Tue, 22 Aug 2023 07:31:30 -0400 [thread overview]
Message-ID: <20230822113130.3550050-9-sashal@kernel.org> (raw)
In-Reply-To: <20230822113130.3550050-1-sashal@kernel.org>
From: Benjamin Gray <bgray@linux.ibm.com>
[ Upstream commit 86582e6189dd8f9f52c25d46c70fe5d111da6345 ]
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 721255b9826b
("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/platforms/powermac/time.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index 4c5790aff1b54..8633891b7aa58 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -26,8 +26,8 @@
#include <linux/rtc.h>
#include <linux/of_address.h>
+#include <asm/early_ioremap.h>
#include <asm/sections.h>
-#include <asm/io.h>
#include <asm/machdep.h>
#include <asm/time.h>
#include <asm/nvram.h>
@@ -182,7 +182,7 @@ static int __init via_calibrate_decr(void)
return 0;
}
of_node_put(vias);
- via = ioremap(rsrc.start, resource_size(&rsrc));
+ via = early_ioremap(rsrc.start, resource_size(&rsrc));
if (via == NULL) {
printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
return 0;
@@ -207,7 +207,7 @@ static int __init via_calibrate_decr(void)
ppc_tb_freq = (dstart - dend) * 100 / 6;
- iounmap(via);
+ early_iounmap((void *)via, resource_size(&rsrc));
return 1;
}
--
2.40.1
prev parent reply other threads:[~2023-08-22 11:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 11:31 [PATCH AUTOSEL 6.1 1/9] clk: fixed-mmio: make COMMON_CLK_FIXED_MMIO depend on HAS_IOMEM Sasha Levin
2023-08-22 11:31 ` [PATCH AUTOSEL 6.1 2/9] vmbus_testing: fix wrong python syntax for integer value comparison Sasha Levin
2023-08-22 11:31 ` [PATCH AUTOSEL 6.1 3/9] Revert "wifi: ath11k: Enable threaded NAPI" Sasha Levin
2023-08-22 11:31 ` [PATCH AUTOSEL 6.1 4/9] Revert "wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12" Sasha Levin
2023-08-22 11:31 ` [PATCH AUTOSEL 6.1 5/9] net: dsa: microchip: KSZ9477 register regmap alignment to 32 bit boundaries Sasha Levin
2023-08-22 11:31 ` [PATCH AUTOSEL 6.1 6/9] net: annotate data-races around sk->sk_{rcv|snd}timeo Sasha Levin
2023-08-22 11:31 ` [PATCH AUTOSEL 6.1 7/9] net: usb: qmi_wwan: add Quectel EM05GV2 Sasha Levin
2023-08-22 11:31 ` [PATCH AUTOSEL 6.1 8/9] wifi: brcmfmac: Fix field-spanning write in brcmf_scan_params_v2_to_v1() Sasha Levin
2023-08-22 11:31 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230822113130.3550050-9-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bgray@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox