From patchwork Mon Oct 24 08:00:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 78869 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2440188qge; Mon, 24 Oct 2016 00:59:33 -0700 (PDT) X-Received: by 10.98.133.141 with SMTP id m13mr26115307pfk.147.1477295973260; Mon, 24 Oct 2016 00:59:33 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yp2si11855461pab.121.2016.10.24.00.59.32; Mon, 24 Oct 2016 00:59:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934585AbcJXH73 (ORCPT + 27 others); Mon, 24 Oct 2016 03:59:29 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:26514 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933422AbcJXH70 (ORCPT ); Mon, 24 Oct 2016 03:59:26 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id u9O7w6Hp008639; Mon, 24 Oct 2016 16:58:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u9O7w6Hp008639 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1477295890; bh=Pmqxwv3eCCIbpmw81n2iGvdKtEFkH7+8EPKz+kykTNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qhcAjliCSR6rT97X8noFoN8s6J4Cis6l54ZLhbEQ2kOV33qWAljJpiBZFriDScuBS BH6TRZNI4xePK4HK4pMeORv27xIYqVbeZ9CI61BHhMu+ve/BzaJDBFTjC6HqnM9Ga8 oCuE5WYtANlDxBL5mrjmnS3MLWl+U4dCYs+FUAHKuObgTdadF13jfntgzz84dNQdsg ADCZbHkNZ4OZ82pcc9Kw0+jIOdSV0OiU7BUb8PZ6KOhRbYTq45a2EztcdYWgGEZCbz M+seQ5D0L2dyKtUToXd6pHWjtpaBZiJWrFEM8ET5yMKu1saSCU6yTvfaxR5i6Hgj9K N5WLnf/LMev2g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-serial@vger.kernel.org Cc: Denys Vlasenko , Masahiro Yamada , Jiri Slaby , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] serial: 8250_uniphier: avoid locking for FCR register write Date: Mon, 24 Oct 2016 17:00:30 +0900 Message-Id: <1477296030-7517-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477296030-7517-1-git-send-email-yamada.masahiro@socionext.com> References: <1477296030-7517-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The hardware book says, the FCR is combined with a register called CHAR (it will trigger interrupt when a specific character is received). At first, I used lock/read/modify/write/unlock dance for the FCR to not affect the upper bits, but the CHAR is actually never used. It should not hurt to always clear the CHAR and to handle the FCR as a normal case. It can save the costly locking. Signed-off-by: Masahiro Yamada Suggested-by: Denys Vlasenko --- drivers/tty/serial/8250/8250_uniphier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index 92e7bb7..746680e 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c @@ -101,7 +101,7 @@ static unsigned int uniphier_serial_in(struct uart_port *p, int offset) static void uniphier_serial_out(struct uart_port *p, int offset, int value) { unsigned int valshift = 0; - bool normal = false; + bool normal = true; switch (offset) { case UART_FCR: @@ -114,9 +114,9 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value) /* fall through */ case UART_MCR: offset = UNIPHIER_UART_LCR_MCR; + normal = false; break; default: - normal = true; offset <<= UNIPHIER_UART_REGSHIFT; break; }