Bluetooth: Remove unnecessary smp_mb__{before,after}_atomic
The barriers are unneeded; wait_woken() and woken_wake_function() already provide us with the required synchronization: remove them and document that we're relying on the (implicit) synchronization provided by wait_woken() and woken_wake_function(). Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com> Reviewed-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
此提交包含在:
@@ -489,9 +489,6 @@ static int bnep_session(void *arg)
|
||||
|
||||
add_wait_queue(sk_sleep(sk), &wait);
|
||||
while (1) {
|
||||
/* Ensure session->terminate is updated */
|
||||
smp_mb__before_atomic();
|
||||
|
||||
if (atomic_read(&s->terminate))
|
||||
break;
|
||||
/* RX */
|
||||
@@ -512,6 +509,10 @@ static int bnep_session(void *arg)
|
||||
break;
|
||||
netif_wake_queue(dev);
|
||||
|
||||
/*
|
||||
* wait_woken() performs the necessary memory barriers
|
||||
* for us; see the header comment for this primitive.
|
||||
*/
|
||||
wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
|
||||
}
|
||||
remove_wait_queue(sk_sleep(sk), &wait);
|
||||
|
新增問題並參考
封鎖使用者