linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: oneukum@suse.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops
Date: Thu, 30 Jan 2020 11:06:17 +0100	[thread overview]
Message-ID: <20200130100617.GA8871@localhost> (raw)
In-Reply-To: <20200129181545.25302-1-dave@stgolabs.net>

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

  reply	other threads:[~2020-01-30 10:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 18:15 [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops Davidlohr Bueso
2020-01-30 10:06 ` Johan Hovold [this message]
2020-03-23 17:29 ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200130100617.GA8871@localhost \
    --to=johan@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).