lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200129181646.25487-1-dave@stgolabs.net>
Date:   Wed, 29 Jan 2020 10:16:46 -0800
From:   Davidlohr Bueso <dave@...olabs.net>
To:     oneukum@...e.com
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        dave@...olabs.net, Davidlohr Bueso <dbueso@...e.de>
Subject: [PATCH] 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.

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

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);
 
-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ