diff mbox series

usbnet: optimize barrier usage for Rmw atomic bitops

Message ID 20200129181646.25487-1-dave@stgolabs.net (mailing list archive)
State New, archived
Headers show
Series usbnet: optimize barrier usage for Rmw atomic bitops | expand

Commit Message

Davidlohr Bueso Jan. 29, 2020, 6:16 p.m. UTC
Use smp_mb__before_atomic() instead of smp_mb() and avoid the
unnecessary barrier for non LL/SC architectures, such as x86.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
 drivers/net/usb/usbnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Davidlohr Bueso Feb. 20, 2020, 3:35 p.m. UTC | #1
ping?
diff mbox series

Patch

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 5ec97def3513..24c767350e5e 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1912,7 +1912,7 @@  int usbnet_resume (struct usb_interface *intf)
 			}
 		}
 
-		smp_mb();
+		smp_mb__before_atomic();
 		clear_bit(EVENT_DEV_ASLEEP, &dev->flags);
 		spin_unlock_irq(&dev->txq.lock);