linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Qian Cai <cai@lca.pw>
Cc: akpm@linux-foundation.org, mark.rutland@arm.com,
	marc.zyngier@arm.com, daniel.lezcano@linaro.org,
	tglx@linutronix.de, mingo@kernel.org, longman@redhat.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH v2] clocksource/arm_arch_timer: fix a lockdep warning
Date: Mon, 10 Dec 2018 15:07:03 +0100	[thread overview]
Message-ID: <20181210140703.GM5289@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20181210135228.49751-1-cai@lca.pw>

On Mon, Dec 10, 2018 at 08:52:28AM -0500, Qian Cai wrote:
> Booting this Huawei TaiShan 2280 arm64 server generated this lockdep
> warning.
> 
> [    0.000000]  lockdep_assert_cpus_held+0x50/0x60
> [    0.000000]  static_key_enable_cpuslocked+0x30/0xe8
> [    0.000000]  arch_timer_check_ool_workaround+0x128/0x2d0
> [    0.000000]  arch_timer_acpi_init+0x274/0x6ac
> [    0.000000]  acpi_table_parse+0x1ac/0x218
> [    0.000000]  __acpi_probe_device_table+0x164/0x1ec
> [    0.000000]  timer_probe+0x1bc/0x254
> [    0.000000]  time_init+0x44/0x98
> [    0.000000]  start_kernel+0x4ec/0x7d4

It seems to me we want something like:

---
 kernel/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 91d5c38eb7e5..e1ee8caf28b5 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -313,6 +313,8 @@ void cpus_write_unlock(void)
 
 void lockdep_assert_cpus_held(void)
 {
+	if (system_state < SYSTEM_RUNNING)
+		return;
 	percpu_rwsem_assert_held(&cpu_hotplug_lock);
 }
 

  reply	other threads:[~2018-12-10 14:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 22:45 [PATCH v2] clocksource/arm_arch_timer: fix a lockdep warning Qian Cai
2018-12-10 13:52 ` [RESEND PATCH " Qian Cai
2018-12-10 14:07   ` Peter Zijlstra [this message]
2018-12-10 14:19     ` Valentin Schneider
2018-12-10 14:47       ` Peter Zijlstra
2018-12-10 15:47     ` Qian Cai
2018-12-10 21:31     ` Thomas Gleixner
2018-12-14 15:05       ` Qian Cai
2018-12-10 14:48   ` Marc Zyngier

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=20181210140703.GM5289@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).