lkml.org 
[lkml]   [2020]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops
On Wed, Jan 29, 2020 at 10:15:45AM -0800, Davidlohr Bueso wrote:
> We can avoid the unnecessary barrier on non LL/SC architectures,
> such as x86. Instead, use the smp_mb__after_atomic() call.
>
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>

Reviewed-by: Johan Hovold <johan@kernel.org>

> ---
> drivers/usb/class/cdc-acm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> index 62f4fb9b362f..0bc4b558f387 100644
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -842,7 +842,7 @@ static void acm_tty_unthrottle(struct tty_struct *tty)
> clear_bit(ACM_THROTTLED, &acm->flags);
>
> /* Matches the smp_mb__after_atomic() in acm_read_bulk_callback(). */
> - smp_mb();
> + smp_mb__after_atomic();
>
> acm_submit_read_urbs(acm, GFP_KERNEL);
> }

We have another barrier in USB serial which can also be relaxed this
way. I'll post a patch shortly.

Johan

\
 
 \ /
  Last update: 2020-01-30 11:06    [W:0.430 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site