Unverified Commit 5816fc7b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11820 powerpc/qspinlock: Fix deadlock in MCS queue

parents 6d1d24f5 e0d98a97
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -715,7 +715,15 @@ static __always_inline void queued_spin_lock_mcs_queue(struct qspinlock *lock, b
	}

release:
	qnodesp->count--; /* release the node */
	/*
	 * Clear the lock before releasing the node, as another CPU might see stale
	 * values if an interrupt occurs after we increment qnodesp->count
	 * but before node->lock is initialized. The barrier ensures that
	 * there are no further stores to the node after it has been released.
	 */
	node->lock = NULL;
	barrier();
	qnodesp->count--;
}

void queued_spin_lock_slowpath(struct qspinlock *lock)