USB: serial: relax unthrottle memory barrier
Subsystems (2)
Johan Hovold
maintainerPATCH 1/1 USB: serial: relax unthrottle memory barrier
Commit a8d78d9f3856 ("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.
--- drivers/usb/serial/generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/generic.c +2 -2
@@ -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 ); }
Signature · 1 line
2.24.1
Quoted 7 lines · Johan Hovold
Commit
a8d78d9f3856("USB: serial: clean up throttle handling") converted the throttle handling to use atomic bitops. This means that we can relax thesmp_mb()inunthrottle()tosmp_mb__after_atomic(), which for example is a no-op on architectures like x86 that provide fully ordered atomics.Signed-off-by Johan Hovold <[email protected]>
Quoted 7 lines · Johan Hovold
Commit
a8d78d9f3856("USB: serial: clean up throttle handling") converted the throttle handling to use atomic bitops. This means that we can relax thesmp_mb()inunthrottle()tosmp_mb__after_atomic(), which for example is a no-op on architectures like x86 that provide fully ordered atomics.Signed-off-by Johan Hovold <[email protected]>
Johan Hovold
maintainerQuoted 11 lines · Davidlohr Bueso
Quoted 7 lines · Johan Hovold
Commit
a8d78d9f3856("USB: serial: clean up throttle handling") converted the throttle handling to use atomic bitops. This means that we can relax thesmp_mb()inunthrottle()tosmp_mb__after_atomic(), which for example is a no-op on architectures like x86 that provide fully ordered atomics.Signed-off-by Johan Hovold <[email protected]>Reviewed-by Davidlohr Bueso <[email protected]>
Thanks for the review. Now applied.
Johan