Skip to contentSkip to conversation

usbnet: optimize barrier usage for Rmw atomic bitops

PATCH In review Davidlohr Bueso 1 participant 2 messages Jan 29, 2020 – Feb 20, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usbnet: optimize barrier usage for Rmw atomic bitops

Use smp_mb__before_atomic() instead of smp_mb() and avoid the unnecessary barrier for non LL/SC architectures, such as x86.

---
 drivers/net/usb/usbnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/usbnet.c +1 -1
index 5ec97def3513..24c767350e5e 100644
@@ -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);
 
Signature · 1 line
2.16.4