# Re: \[PATCH v2\] powerpc/qspinlock: Fix deadlock in MCS queue

- From: Michael Ellerman \<hidden\>
- Date: 2024-09-06 11:48:12 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2024/09/2738510
- Thread: https://ratatoskr.run/stable/2024/08/2726261/t.md

```text
On Thu, 29 Aug 2024 07:58:27 +0530, Nysal Jan K.A. wrote:
> If an interrupt occurs in queued_spin_lock_slowpath() after we increment
> qnodesp->count and before node->lock is initialized, another CPU might
> see stale lock values in get_tail_qnode(). If the stale lock value happens
> to match the lock on that CPU, then we write to the "next" pointer of
> the wrong qnode. This causes a deadlock as the former CPU, once it becomes
> the head of the MCS queue, will spin indefinitely until it's "next" pointer
> is set by its successor in the queue.
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/qspinlock: Fix deadlock in MCS queue
      https://git.kernel.org/powerpc/c/734ad0af3609464f8f93e00b6c0de1e112f44559

cheers

```
