diff mbox series

powerpc/imc-pmu: Use the correct spinlock initializer.

Message ID 20230309134831.Nz12nqsU@linutronix.de (mailing list archive)
State Accepted
Commit 007240d59c11f87ac4f6cfc6a1d116630b6b634c
Headers show
Series powerpc/imc-pmu: Use the correct spinlock initializer. | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 6 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 24 jobs.

Commit Message

Sebastian Andrzej Siewior March 9, 2023, 1:48 p.m. UTC
The macro __SPIN_LOCK_INITIALIZER() is implementation specific. Users
that desire to initialize a spinlock in a struct must use
__SPIN_LOCK_UNLOCKED().

Use __SPIN_LOCK_UNLOCKED() for the spinlock_t in imc_global_refc.

Fixes: 76d588dddc459 ("powerpc/imc-pmu: Fix use of mutex in IRQs disabled section")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/powerpc/perf/imc-pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Ellerman Oct. 27, 2023, 9:59 a.m. UTC | #1
On Thu, 09 Mar 2023 14:48:31 +0100, Sebastian Andrzej Siewior wrote:
> The macro __SPIN_LOCK_INITIALIZER() is implementation specific. Users
> that desire to initialize a spinlock in a struct must use
> __SPIN_LOCK_UNLOCKED().
> 
> Use __SPIN_LOCK_UNLOCKED() for the spinlock_t in imc_global_refc.
> 
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/imc-pmu: Use the correct spinlock initializer.
      https://git.kernel.org/powerpc/c/007240d59c11f87ac4f6cfc6a1d116630b6b634c

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index 9d229ef7f86ef..ada817c49b722 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -51,7 +51,7 @@  static int trace_imc_mem_size;
  * core and trace-imc
  */
 static struct imc_pmu_ref imc_global_refc = {
-	.lock = __SPIN_LOCK_INITIALIZER(imc_global_refc.lock),
+	.lock = __SPIN_LOCK_UNLOCKED(imc_global_refc.lock),
 	.id = 0,
 	.refc = 0,
 };