linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers
@ 2015-09-14 16:59 Will Deacon
  2015-09-14 18:08 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Will Deacon @ 2015-09-14 16:59 UTC (permalink / raw)
  To: linux-arm-kernel

We have a couple of CPU hotplug notifiers for resetting the CPU debug
state to a sane value when a CPU comes online.

This patch ensures that we mask out CPU_TASKS_FROZEN so that we don't
miss any online events occuring due to suspend/resume.

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/kernel/debug-monitors.c | 2 +-
 arch/arm64/kernel/hw_breakpoint.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 9b3b62ac9c24..cebf78661a55 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -134,7 +134,7 @@ static int os_lock_notify(struct notifier_block *self,
 				    unsigned long action, void *data)
 {
 	int cpu = (unsigned long)data;
-	if (action == CPU_ONLINE)
+	if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
 		smp_call_function_single(cpu, clear_os_lock, NULL, 1);
 	return NOTIFY_OK;
 }
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 565244fd57ff..2926c3dd6479 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -878,7 +878,7 @@ static int hw_breakpoint_reset_notify(struct notifier_block *self,
 						void *hcpu)
 {
 	int cpu = (long)hcpu;
-	if (action == CPU_ONLINE)
+	if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
 		smp_call_function_single(cpu, hw_breakpoint_reset, NULL, 1);
 	return NOTIFY_OK;
 }
-- 
2.1.4

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

* [PATCH] arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers
  2015-09-14 16:59 [PATCH] arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers Will Deacon
@ 2015-09-14 18:08 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2015-09-14 18:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 14, 2015 at 05:59:51PM +0100, Will Deacon wrote:
> We have a couple of CPU hotplug notifiers for resetting the CPU debug
> state to a sane value when a CPU comes online.
> 
> This patch ensures that we mask out CPU_TASKS_FROZEN so that we don't
> miss any online events occuring due to suspend/resume.
> 
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>  arch/arm64/kernel/debug-monitors.c | 2 +-
>  arch/arm64/kernel/hw_breakpoint.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

> 
> diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
> index 9b3b62ac9c24..cebf78661a55 100644
> --- a/arch/arm64/kernel/debug-monitors.c
> +++ b/arch/arm64/kernel/debug-monitors.c
> @@ -134,7 +134,7 @@ static int os_lock_notify(struct notifier_block *self,
>  				    unsigned long action, void *data)
>  {
>  	int cpu = (unsigned long)data;
> -	if (action == CPU_ONLINE)
> +	if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
>  		smp_call_function_single(cpu, clear_os_lock, NULL, 1);
>  	return NOTIFY_OK;
>  }
> diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
> index 565244fd57ff..2926c3dd6479 100644
> --- a/arch/arm64/kernel/hw_breakpoint.c
> +++ b/arch/arm64/kernel/hw_breakpoint.c
> @@ -878,7 +878,7 @@ static int hw_breakpoint_reset_notify(struct notifier_block *self,
>  						void *hcpu)
>  {
>  	int cpu = (long)hcpu;
> -	if (action == CPU_ONLINE)
> +	if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
>  		smp_call_function_single(cpu, hw_breakpoint_reset, NULL, 1);
>  	return NOTIFY_OK;
>  }
> -- 
> 2.1.4
> 

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

end of thread, other threads:[~2015-09-14 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14 16:59 [PATCH] arm64: cpu hotplug: ensure we mask out CPU_TASKS_FROZEN in notifiers Will Deacon
2015-09-14 18:08 ` Lorenzo Pieralisi

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