Commit 32553441 authored by Johan Hovold's avatar Johan Hovold
Browse files

USB: serial: relax unthrottle memory barrier



Commit a8d78d9f ("USB: serial: clean up throttle handling")
converted the throttle handling to use atomic bitops. This means that we
can relax the smp_mb() in unthrottle() to smp_mb__after_atomic(), which
for example is a no-op on architectures like x86 that provide fully
ordered atomics.

Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarDavidlohr Bueso <dbueso@suse.de>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent bb6d3fb3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -417,7 +417,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
	/*
	 * Make sure URB is marked as free before checking the throttled flag
	 * to avoid racing with unthrottle() on another CPU. Matches the
	 * smp_mb() in unthrottle().
	 * smp_mb__after_atomic() in unthrottle().
	 */
	smp_mb__after_atomic();

@@ -489,7 +489,7 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty)
	 * Matches the smp_mb__after_atomic() in
	 * usb_serial_generic_read_bulk_callback().
	 */
	smp_mb();
	smp_mb__after_atomic();

	usb_serial_generic_submit_read_urbs(port, GFP_KERNEL);
}