Skip to content

Commit

Permalink
staging: vchiq_util: get rid of unneeded memory barriers
Browse files Browse the repository at this point in the history
All the memory operations featured in this file modify/access memory
that is only accessed by the CPU. So we can assume that all the memory
barrier handling done by the completion routines is good enough for us.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Nicolas Saenz Julienne authored and Greg Kroah-Hartman committed Nov 27, 2018
1 parent f27e47b commit 96f3371
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,7 @@ void vchiu_queue_push(VCHIU_QUEUE_T *queue, VCHIQ_HEADER_T *header)
flush_signals(current);
}

/*
* Write to queue->storage must be visible after read from
* queue->read
*/
smp_mb();

queue->storage[queue->write & (queue->size - 1)] = header;

/*
* Write to queue->storage must be visible before write to
* queue->write
*/
smp_wmb();

queue->write++;

complete(&queue->push);
Expand All @@ -112,12 +99,6 @@ VCHIQ_HEADER_T *vchiu_queue_peek(VCHIU_QUEUE_T *queue)

complete(&queue->push); // We haven't removed anything from the queue.

/*
* Read from queue->storage must be visible after read from
* queue->write
*/
smp_rmb();

return queue->storage[queue->read & (queue->size - 1)];
}

Expand All @@ -130,20 +111,7 @@ VCHIQ_HEADER_T *vchiu_queue_pop(VCHIU_QUEUE_T *queue)
flush_signals(current);
}

/*
* Read from queue->storage must be visible after read from
* queue->write
*/
smp_rmb();

header = queue->storage[queue->read & (queue->size - 1)];

/*
* Read from queue->storage must be visible before write to
* queue->read
*/
smp_mb();

queue->read++;

complete(&queue->pop);
Expand Down

0 comments on commit 96f3371

Please sign in to comment.