summaryrefslogtreecommitdiff
path: root/include/drm/spsc_queue.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-17 19:44:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-17 19:44:05 +0300
commitc02c0232f4b5a7b775c4819ec2d707bd6a696eee (patch)
tree45086e82a271619e08fbaeacf1372eba189d933e /include/drm/spsc_queue.h
parent81bd6aab35ad9ecce95dfe3e33c807effe370d83 (diff)
parente8af141440cebccb6554fc23f8d21ce063b976a1 (diff)
downloadlinux-rolling-stable.tar.xz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/drm/spsc_queue.h')
-rw-r--r--include/drm/spsc_queue.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/drm/spsc_queue.h b/include/drm/spsc_queue.h
index 125f096c88cb..ee9df8cc67b7 100644
--- a/include/drm/spsc_queue.h
+++ b/include/drm/spsc_queue.h
@@ -70,9 +70,11 @@ static inline bool spsc_queue_push(struct spsc_queue *queue, struct spsc_node *n
preempt_disable();
+ atomic_inc(&queue->job_count);
+ smp_mb__after_atomic();
+
tail = (struct spsc_node **)atomic_long_xchg(&queue->tail, (long)&node->next);
WRITE_ONCE(*tail, node);
- atomic_inc(&queue->job_count);
/*
* In case of first element verify new node will be visible to the consumer