mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Sudeep Holla <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, hpa@zytor.com, sudeep.holla@arm.com,
	linux-kernel@vger.kernel.org, tglx@linutronix.de
Subject: [tip:timers/core] clockevents: Warn if cpu_all_mask is used as cpumask
Date: Thu, 2 Aug 2018 05:58:49 -0700	[thread overview]
Message-ID: <tip-fbfa9260085b5b578a049a90135e5c51928c5f7f@git.kernel.org> (raw)
In-Reply-To: <1531308264-24220-3-git-send-email-sudeep.holla@arm.com>

Commit-ID:  fbfa9260085b5b578a049a90135e5c51928c5f7f
Gitweb:     https://git.kernel.org/tip/fbfa9260085b5b578a049a90135e5c51928c5f7f
Author:     Sudeep Holla <sudeep.holla@arm.com>
AuthorDate: Wed, 11 Jul 2018 12:24:24 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 2 Aug 2018 14:55:53 +0200

clockevents: Warn if cpu_all_mask is used as cpumask

Using cpu_all_mask in clockevents cpumask may result in issues while
comparing multiple clockevent devices to choose the preferred one.

On one of the platforms with 2 system (i.e. non per-CPU) timers with
different ratings, having cpu_all_mask for one of the device resulted in a
boot hang due to a endless loop in clockevents_notify_released() as both
were clocksources were selected as preferred.

In order to prevent such issues in the future, warn if any clockevent
driver sets cpu_all_mask as it's cpumask and just override it to use
cpu_possible_mask. All the existing occurrences of cpu_all_mask are already
replaced with cpu_possible_mask.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lkml.kernel.org/r/1531308264-24220-3-git-send-email-sudeep.holla@arm.com

---
 kernel/time/clockevents.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 16c027e9cc73..8c0e4092f661 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -463,6 +463,12 @@ void clockevents_register_device(struct clock_event_device *dev)
 		dev->cpumask = cpumask_of(smp_processor_id());
 	}
 
+	if (dev->cpumask == cpu_all_mask) {
+		WARN(1, "%s cpumask == cpu_all_mask, using cpu_possible_mask instead\n",
+		     dev->name);
+		dev->cpumask = cpu_possible_mask;
+	}
+
 	raw_spin_lock_irqsave(&clockevents_lock, flags);
 
 	list_add(&dev->list, &clockevent_devices);

  parent reply	other threads:[~2018-08-02 12:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 11:24 [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask Sudeep Holla
2018-07-11 11:24 ` [PATCH 2/3] tick: broadcast-hrtimer: use cpu_possible_mask for ce_broadcast_hrtimer Sudeep Holla
2018-08-02 12:58   ` [tip:timers/core] tick/broadcast-hrtimer: Use " tip-bot for Sudeep Holla
2018-07-11 11:24 ` [PATCH 3/3] clockevents: warn if cpu_all_mask is used for cpumask while registering new device Sudeep Holla
2018-08-02 12:39   ` Sudeep Holla
2018-08-02 12:58   ` tip-bot for Sudeep Holla [this message]
2018-07-11 11:36 ` [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask Daniel Lezcano
2018-07-11 13:42   ` Sudeep Holla
2018-07-11 16:38     ` Daniel Lezcano
2018-07-13 22:45       ` Thomas Gleixner

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=tip-fbfa9260085b5b578a049a90135e5c51928c5f7f@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sudeep.holla@arm.com \
    --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

Powered by JetHome