From patchwork Wed Jan 29 18:15:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davidlohr Bueso X-Patchwork-Id: 11356673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42ED414B7 for ; Wed, 29 Jan 2020 18:25:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22E5520716 for ; Wed, 29 Jan 2020 18:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbgA2SZx (ORCPT ); Wed, 29 Jan 2020 13:25:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:45858 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726560AbgA2SZx (ORCPT ); Wed, 29 Jan 2020 13:25:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 01C25AECB; Wed, 29 Jan 2020 18:25:52 +0000 (UTC) From: Davidlohr Bueso To: oneukum@suse.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net, Davidlohr Bueso Subject: [PATCH 7/8] usb, cdc-acm: optimize barrier usage for Rmw atomic bitops Date: Wed, 29 Jan 2020 10:15:45 -0800 Message-Id: <20200129181545.25302-1-dave@stgolabs.net> X-Mailer: git-send-email 2.16.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 Reviewed-by: Johan Hovold --- 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); }