linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask
@ 2018-07-11 11:24 Sudeep Holla
  2018-07-11 11:24 ` [PATCH 2/3] tick: broadcast-hrtimer: use cpu_possible_mask for ce_broadcast_hrtimer Sudeep Holla
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sudeep Holla @ 2018-07-11 11:24 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Sudeep Holla, Thomas Gleixner, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter, Santosh Shilimkar

Currently, quite a few clockevent devices have cpumask set to
cpu_all_mask which should be fine. However, cpu_possible_mask is more
accurate and if there are any other clockevent devices in the system
which have cpumask set to cpu_possible_mask, then having cpu_all_mask
may result in issues (mostly boot hang with forever loops in
clockevents_notify_released).

So, lets replace all the clockevent device cpu_all_mask to
cpu_possible_mask in order to prevent above mentioned possible issue.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/clocksource/tegra20_timer.c   | 2 +-
 drivers/clocksource/timer-atcpit100.c | 2 +-
 drivers/clocksource/timer-keystone.c  | 2 +-
 drivers/clocksource/zevio-timer.c     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c
index c337a8100a7b..dabf0a103567 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -230,7 +230,7 @@ static int __init tegra20_init_timer(struct device_node *np)
 		return ret;
 	}

-	tegra_clockevent.cpumask = cpu_all_mask;
+	tegra_clockevent.cpumask = cpu_possible_mask;
 	tegra_clockevent.irq = tegra_timer_irq.irq;
 	clockevents_config_and_register(&tegra_clockevent, 1000000,
 					0x1, 0x1fffffff);
diff --git a/drivers/clocksource/timer-atcpit100.c b/drivers/clocksource/timer-atcpit100.c
index 5e23d7b4a722..b4bd2f5b801d 100644
--- a/drivers/clocksource/timer-atcpit100.c
+++ b/drivers/clocksource/timer-atcpit100.c
@@ -185,7 +185,7 @@ static struct timer_of to = {
 		.set_state_oneshot = atcpit100_clkevt_set_oneshot,
 		.tick_resume = atcpit100_clkevt_shutdown,
 		.set_next_event = atcpit100_clkevt_next_event,
-		.cpumask = cpu_all_mask,
+		.cpumask = cpu_possible_mask,
 	},

 	.of_irq = {
diff --git a/drivers/clocksource/timer-keystone.c b/drivers/clocksource/timer-keystone.c
index 0eee03250cfc..f5b2eda30bf3 100644
--- a/drivers/clocksource/timer-keystone.c
+++ b/drivers/clocksource/timer-keystone.c
@@ -211,7 +211,7 @@ static int __init keystone_timer_init(struct device_node *np)
 	event_dev->set_state_shutdown = keystone_shutdown;
 	event_dev->set_state_periodic = keystone_set_periodic;
 	event_dev->set_state_oneshot = keystone_shutdown;
-	event_dev->cpumask = cpu_all_mask;
+	event_dev->cpumask = cpu_possible_mask;
 	event_dev->owner = THIS_MODULE;
 	event_dev->name = TIMER_NAME;
 	event_dev->irq = irq;
diff --git a/drivers/clocksource/zevio-timer.c b/drivers/clocksource/zevio-timer.c
index a6a0338eea77..f74689334f7c 100644
--- a/drivers/clocksource/zevio-timer.c
+++ b/drivers/clocksource/zevio-timer.c
@@ -162,7 +162,7 @@ static int __init zevio_timer_add(struct device_node *node)
 		timer->clkevt.set_state_oneshot = zevio_timer_set_oneshot;
 		timer->clkevt.tick_resume	= zevio_timer_set_oneshot;
 		timer->clkevt.rating		= 200;
-		timer->clkevt.cpumask		= cpu_all_mask;
+		timer->clkevt.cpumask		= cpu_possible_mask;
 		timer->clkevt.features		= CLOCK_EVT_FEAT_ONESHOT;
 		timer->clkevt.irq		= irqnr;

--
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] tick: broadcast-hrtimer: use cpu_possible_mask for ce_broadcast_hrtimer
  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 ` 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-07-11 11:36 ` [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask Daniel Lezcano
  2 siblings, 1 reply; 10+ messages in thread
From: Sudeep Holla @ 2018-07-11 11:24 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: Sudeep Holla, Thomas Gleixner

This is the last instance of cpu_all_mask usage in the core framework.
Lets replace it with cpu_possible_mask like all other instances in the
clockevent drivers. This will now enable us to add warning in the core
clockevents_register_device on usage of cpu_all_mask from any clockevent
drivers in future.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 kernel/time/tick-broadcast-hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c
index 58045eb976c3..a59641fb88b6 100644
--- a/kernel/time/tick-broadcast-hrtimer.c
+++ b/kernel/time/tick-broadcast-hrtimer.c
@@ -90,7 +90,7 @@ static struct clock_event_device ce_broadcast_hrtimer = {
 	.max_delta_ticks	= ULONG_MAX,
 	.mult			= 1,
 	.shift			= 0,
-	.cpumask		= cpu_all_mask,
+	.cpumask		= cpu_possible_mask,
 };

 static enum hrtimer_restart bc_handler(struct hrtimer *t)
--
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] clockevents: warn if cpu_all_mask is used for cpumask while registering new device
  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-07-11 11:24 ` Sudeep Holla
  2018-08-02 12:39   ` Sudeep Holla
  2018-08-02 12:58   ` [tip:timers/core] clockevents: Warn if cpu_all_mask is used as cpumask tip-bot for Sudeep Holla
  2018-07-11 11:36 ` [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask Daniel Lezcano
  2 siblings, 2 replies; 10+ messages in thread
From: Sudeep Holla @ 2018-07-11 11:24 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: Sudeep Holla, Thomas Gleixner

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 boot hang with forever loop in clockevents_notify_released as both
were being selected as preferred.

In order to prevent such issues in future, let's warn if any clockevent
drivers 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.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sudeep Holla <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);
--
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask
  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-07-11 11:24 ` [PATCH 3/3] clockevents: warn if cpu_all_mask is used for cpumask while registering new device Sudeep Holla
@ 2018-07-11 11:36 ` Daniel Lezcano
  2018-07-11 13:42   ` Sudeep Holla
  2 siblings, 1 reply; 10+ messages in thread
From: Daniel Lezcano @ 2018-07-11 11:36 UTC (permalink / raw)
  To: Sudeep Holla, linux-kernel, linux-arm-kernel
  Cc: Thomas Gleixner, Thierry Reding, Jonathan Hunter, Santosh Shilimkar

On 11/07/2018 13:24, Sudeep Holla wrote:
> Currently, quite a few clockevent devices have cpumask set to
> cpu_all_mask which should be fine. However, cpu_possible_mask is more
> accurate and if there are any other clockevent devices in the system
> which have cpumask set to cpu_possible_mask, then having cpu_all_mask
> may result in issues (mostly boot hang with forever loops in
> clockevents_notify_released).
> 
> So, lets replace all the clockevent device cpu_all_mask to
> cpu_possible_mask in order to prevent above mentioned possible issue.
> 
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---

Applied, thanks for the fix.


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Sudeep Holla @ 2018-07-11 13:42 UTC (permalink / raw)
  To: Daniel Lezcano, linux-kernel, linux-arm-kernel
  Cc: Sudeep Holla, Thomas Gleixner, Thierry Reding, Jonathan Hunter,
	Santosh Shilimkar

Hi Daniel,

On 11/07/18 12:36, Daniel Lezcano wrote:
> On 11/07/2018 13:24, Sudeep Holla wrote:
>> Currently, quite a few clockevent devices have cpumask set to
>> cpu_all_mask which should be fine. However, cpu_possible_mask is more
>> accurate and if there are any other clockevent devices in the system
>> which have cpumask set to cpu_possible_mask, then having cpu_all_mask
>> may result in issues (mostly boot hang with forever loops in
>> clockevents_notify_released).
>>
>> So, lets replace all the clockevent device cpu_all_mask to
>> cpu_possible_mask in order to prevent above mentioned possible issue.
>>
>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Thierry Reding <thierry.reding@gmail.com>
>> Cc: Jonathan Hunter <jonathanh@nvidia.com>
>> Cc: Santosh Shilimkar <ssantosh@kernel.org>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
> 
> Applied, thanks for the fix.
> 

Thomas was planning to take this, see [1]
-- 
Regards,
Sudeep

[1]
https://lore.kernel.org/lkml/alpine.DEB.2.21.1807102220320.1588@nanos.tec.linutronix.de/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask
  2018-07-11 13:42   ` Sudeep Holla
@ 2018-07-11 16:38     ` Daniel Lezcano
  2018-07-13 22:45       ` Thomas Gleixner
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Lezcano @ 2018-07-11 16:38 UTC (permalink / raw)
  To: Sudeep Holla, linux-kernel, linux-arm-kernel
  Cc: Thomas Gleixner, Thierry Reding, Jonathan Hunter, Santosh Shilimkar

On 11/07/2018 15:42, Sudeep Holla wrote:
> Hi Daniel,
> 
> On 11/07/18 12:36, Daniel Lezcano wrote:
>> On 11/07/2018 13:24, Sudeep Holla wrote:
>>> Currently, quite a few clockevent devices have cpumask set to
>>> cpu_all_mask which should be fine. However, cpu_possible_mask is more
>>> accurate and if there are any other clockevent devices in the system
>>> which have cpumask set to cpu_possible_mask, then having cpu_all_mask
>>> may result in issues (mostly boot hang with forever loops in
>>> clockevents_notify_released).
>>>
>>> So, lets replace all the clockevent device cpu_all_mask to
>>> cpu_possible_mask in order to prevent above mentioned possible issue.
>>>
>>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>>> Cc: Thomas Gleixner <tglx@linutronix.de>
>>> Cc: Thierry Reding <thierry.reding@gmail.com>
>>> Cc: Jonathan Hunter <jonathanh@nvidia.com>
>>> Cc: Santosh Shilimkar <ssantosh@kernel.org>
>>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>>> ---
>>
>> Applied, thanks for the fix.
>>
> 
> Thomas was planning to take this, see [1]

Thomas ?

Do you want to take all the series ? Or shall I take this one ?


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] clocksource: drivers: set clockevent device cpumask to cpu_possible_mask
  2018-07-11 16:38     ` Daniel Lezcano
@ 2018-07-13 22:45       ` Thomas Gleixner
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Gleixner @ 2018-07-13 22:45 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Sudeep Holla, linux-kernel, linux-arm-kernel, Thierry Reding,
	Jonathan Hunter, Santosh Shilimkar

On Wed, 11 Jul 2018, Daniel Lezcano wrote:

> On 11/07/2018 15:42, Sudeep Holla wrote:
> > Hi Daniel,
> > 
> > On 11/07/18 12:36, Daniel Lezcano wrote:
> >> On 11/07/2018 13:24, Sudeep Holla wrote:
> >>> Currently, quite a few clockevent devices have cpumask set to
> >>> cpu_all_mask which should be fine. However, cpu_possible_mask is more
> >>> accurate and if there are any other clockevent devices in the system
> >>> which have cpumask set to cpu_possible_mask, then having cpu_all_mask
> >>> may result in issues (mostly boot hang with forever loops in
> >>> clockevents_notify_released).
> >>>
> >>> So, lets replace all the clockevent device cpu_all_mask to
> >>> cpu_possible_mask in order to prevent above mentioned possible issue.
> >>>
> >>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> >>> Cc: Thomas Gleixner <tglx@linutronix.de>
> >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> >>> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> >>> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> >>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> >>> ---
> >>
> >> Applied, thanks for the fix.
> >>
> > 
> > Thomas was planning to take this, see [1]
> 
> Thomas ?
> 
> Do you want to take all the series ? Or shall I take this one ?

Take it, it's ok for this to go into 4.19

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] clockevents: warn if cpu_all_mask is used for cpumask while registering new device
  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:timers/core] clockevents: Warn if cpu_all_mask is used as cpumask tip-bot for Sudeep Holla
  1 sibling, 0 replies; 10+ messages in thread
From: Sudeep Holla @ 2018-08-02 12:39 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, Thomas Gleixner; +Cc: Sudeep Holla

Hi Thomas,

On 11/07/18 12:24, Sudeep Holla wrote:
> 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 boot hang with forever loop in clockevents_notify_released as both
> were being selected as preferred.
> 
> In order to prevent such issues in future, let's warn if any clockevent
> drivers 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.
> 

Daniel has picked up patch 1/3, do you want me to resend this patch 2
and 3 again or you happy to pick them ?

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [tip:timers/core] tick/broadcast-hrtimer: Use cpu_possible_mask for ce_broadcast_hrtimer
  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-bot for Sudeep Holla
  0 siblings, 0 replies; 10+ messages in thread
From: tip-bot for Sudeep Holla @ 2018-08-02 12:58 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: tglx, linux-kernel, mingo, sudeep.holla, hpa

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

tick/broadcast-hrtimer: Use cpu_possible_mask for ce_broadcast_hrtimer

This is the last instance of cpu_all_mask usage in the core framework.

Replace it with cpu_possible_mask like all other instances in the
clockevent drivers. This makes it possible to add a warning in the core
clockevents_register_device on usage of cpu_all_mask from any clockevent
drivers in the future.

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-2-git-send-email-sudeep.holla@arm.com

---
 kernel/time/tick-broadcast-hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c
index 58045eb976c3..a59641fb88b6 100644
--- a/kernel/time/tick-broadcast-hrtimer.c
+++ b/kernel/time/tick-broadcast-hrtimer.c
@@ -90,7 +90,7 @@ static struct clock_event_device ce_broadcast_hrtimer = {
 	.max_delta_ticks	= ULONG_MAX,
 	.mult			= 1,
 	.shift			= 0,
-	.cpumask		= cpu_all_mask,
+	.cpumask		= cpu_possible_mask,
 };
 
 static enum hrtimer_restart bc_handler(struct hrtimer *t)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [tip:timers/core] clockevents: Warn if cpu_all_mask is used as cpumask
  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
  1 sibling, 0 replies; 10+ messages in thread
From: tip-bot for Sudeep Holla @ 2018-08-02 12:58 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: mingo, hpa, sudeep.holla, linux-kernel, tglx

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);

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-08-02 12:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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:timers/core] clockevents: Warn if cpu_all_mask is used as cpumask tip-bot for Sudeep Holla
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

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).