All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP2+: powerdomain: use raw_smp_processor_id() for trace
@ 2018-03-09  9:50 ` Tero Kristo
  0 siblings, 0 replies; 4+ messages in thread
From: Tero Kristo @ 2018-03-09  9:50 UTC (permalink / raw)
  To: tony, linux-omap; +Cc: linux-arm-kernel

smp_processor_id() checks preemption if CONFIG_DEBUG_PREEMPT is enabled,
causing a warning dump during boot:

[    5.042377] BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
[    5.050281] caller is pwrdm_set_next_pwrst+0x48/0x88
[    5.055330] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.24-g57341df0b4 #1

Use the raw_smp_processor_id() for the trace instead, this value does
not need to be perfectly correct. The alternative of disabling preempt
is too heavy weight operation to be applied in PM hot path for just
tracing purposes.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/mach-omap2/powerdomain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 76eb6ec..1e6a967 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -188,7 +188,7 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 				       ((prev & OMAP_POWERSTATE_MASK) << 0));
 			trace_power_domain_target_rcuidle(pwrdm->name,
 							  trace_state,
-							  smp_processor_id());
+							  raw_smp_processor_id());
 		}
 		break;
 	default:
@@ -518,7 +518,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
 		/* Trace the pwrdm desired target state */
 		trace_power_domain_target_rcuidle(pwrdm->name, pwrst,
-						  smp_processor_id());
+						  raw_smp_processor_id());
 		/* Program the pwrdm desired target state */
 		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
 	}
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH] ARM: OMAP2+: powerdomain: use raw_smp_processor_id() for trace
@ 2018-03-09  9:50 ` Tero Kristo
  0 siblings, 0 replies; 4+ messages in thread
From: Tero Kristo @ 2018-03-09  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

smp_processor_id() checks preemption if CONFIG_DEBUG_PREEMPT is enabled,
causing a warning dump during boot:

[    5.042377] BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
[    5.050281] caller is pwrdm_set_next_pwrst+0x48/0x88
[    5.055330] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.24-g57341df0b4 #1

Use the raw_smp_processor_id() for the trace instead, this value does
not need to be perfectly correct. The alternative of disabling preempt
is too heavy weight operation to be applied in PM hot path for just
tracing purposes.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/mach-omap2/powerdomain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 76eb6ec..1e6a967 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -188,7 +188,7 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 				       ((prev & OMAP_POWERSTATE_MASK) << 0));
 			trace_power_domain_target_rcuidle(pwrdm->name,
 							  trace_state,
-							  smp_processor_id());
+							  raw_smp_processor_id());
 		}
 		break;
 	default:
@@ -518,7 +518,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
 		/* Trace the pwrdm desired target state */
 		trace_power_domain_target_rcuidle(pwrdm->name, pwrst,
-						  smp_processor_id());
+						  raw_smp_processor_id());
 		/* Program the pwrdm desired target state */
 		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
 	}
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Re: [PATCH] ARM: OMAP2+: powerdomain: use raw_smp_processor_id() for trace
  2018-03-09  9:50 ` Tero Kristo
@ 2018-05-01 14:50   ` Tony Lindgren
  -1 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2018-05-01 14:50 UTC (permalink / raw)
  To: Tero Kristo; +Cc: linux-omap, linux-arm-kernel

* Tero Kristo <t-kristo@ti.com> [180309 01:51]:
> smp_processor_id() checks preemption if CONFIG_DEBUG_PREEMPT is enabled,
> causing a warning dump during boot:
> 
> [    5.042377] BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
> [    5.050281] caller is pwrdm_set_next_pwrst+0x48/0x88
> [    5.055330] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.24-g57341df0b4 #1
> 
> Use the raw_smp_processor_id() for the trace instead, this value does
> not need to be perfectly correct. The alternative of disabling preempt
> is too heavy weight operation to be applied in PM hot path for just
> tracing purposes.

Sorry just noticed this is still pending while looking through
my inbox. Applying into omap-for-v4.17/fixes.

Regards,

Tony

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

* [PATCH] ARM: OMAP2+: powerdomain: use raw_smp_processor_id() for trace
@ 2018-05-01 14:50   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2018-05-01 14:50 UTC (permalink / raw)
  To: linux-arm-kernel

* Tero Kristo <t-kristo@ti.com> [180309 01:51]:
> smp_processor_id() checks preemption if CONFIG_DEBUG_PREEMPT is enabled,
> causing a warning dump during boot:
> 
> [    5.042377] BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
> [    5.050281] caller is pwrdm_set_next_pwrst+0x48/0x88
> [    5.055330] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.24-g57341df0b4 #1
> 
> Use the raw_smp_processor_id() for the trace instead, this value does
> not need to be perfectly correct. The alternative of disabling preempt
> is too heavy weight operation to be applied in PM hot path for just
> tracing purposes.

Sorry just noticed this is still pending while looking through
my inbox. Applying into omap-for-v4.17/fixes.

Regards,

Tony

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

end of thread, other threads:[~2018-05-01 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09  9:50 [PATCH] ARM: OMAP2+: powerdomain: use raw_smp_processor_id() for trace Tero Kristo
2018-03-09  9:50 ` Tero Kristo
2018-05-01 14:50 ` Tony Lindgren
2018-05-01 14:50   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.