From patchwork Tue Sep 9 10:03:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 37066 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A8D8F20566 for ; Tue, 9 Sep 2014 10:04:13 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 131sf8101375ykp.4 for ; Tue, 09 Sep 2014 03:04:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=ks7pj9o8+Pf46tlJ6q7YGh6JU4390lKcaesA6D47sw0=; b=cKKw85kclrnJn0vAxhKWHXQggsFTQHs51l0HgKCpmFuuIrcZV/PIfmBcGv6AG+mbVA bUzJpp5ztt+wMuP8SccFwJWwQ8FczZlvgkZ+zRwXovbJNGmxBKkzSZG7PbMGBNbiW9LL WGV8pp3yCOZNNTA1gEK7uQ4qMXhM7iP+0824Fj2prOxikKl4juEzbF7IIpx6MWDkFjJJ h5uHu2ogZYnRh8EQ4DIj4zeB1T6E219x+quRVFGHC0mctnHU6Fd92xAEebEkDBJ3iA4g hDqIw1qE2qiEV6wA/BdJ7PUjvpNdyqDQoRIDTEZ3zH8wmVE+XSkt22jVewP+16hEdYUX p8+Q== X-Gm-Message-State: ALoCoQkTj4Z8inerFy/3xHGo3VsAm5NIp2OOBQ/1jAT4cS7trO0wLBlmcGY2uetMPm4gPKl86AcW X-Received: by 10.236.150.170 with SMTP id z30mr30542yhj.58.1410257053523; Tue, 09 Sep 2014 03:04:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.70 with SMTP id g64ls2169637qgf.85.gmail; Tue, 09 Sep 2014 03:04:13 -0700 (PDT) X-Received: by 10.221.26.70 with SMTP id rl6mr2083224vcb.0.1410257053444; Tue, 09 Sep 2014 03:04:13 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id q4si1350290vdb.79.2014.09.09.03.04.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 03:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so16764994vcb.16 for ; Tue, 09 Sep 2014 03:04:13 -0700 (PDT) X-Received: by 10.52.129.200 with SMTP id ny8mr2410481vdb.27.1410257053352; Tue, 09 Sep 2014 03:04:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp259511vcb; Tue, 9 Sep 2014 03:04:12 -0700 (PDT) X-Received: by 10.194.59.201 with SMTP id b9mr42119783wjr.43.1410257051895; Tue, 09 Sep 2014 03:04:11 -0700 (PDT) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx.google.com with ESMTPS id l9si16547368wjf.107.2014.09.09.03.04.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 03:04:11 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.52 as permitted sender) client-ip=74.125.82.52; Received: by mail-wg0-f52.google.com with SMTP id x13so3156611wgg.23 for ; Tue, 09 Sep 2014 03:04:11 -0700 (PDT) X-Received: by 10.180.218.99 with SMTP id pf3mr15404129wic.19.1410257051355; Tue, 09 Sep 2014 03:04:11 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id wr10sm14287435wjc.10.2014.09.09.03.04.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Sep 2014 03:04:10 -0700 (PDT) From: Daniel Thompson To: Greg Kroah-Hartman Cc: Daniel Thompson , linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Srinivas Kandagatla , Maxime Coquelin , Patrice Chotard , Jiri Slaby , kernel@stlinux.com, linux-serial@vger.kernel.org Subject: [PATCH 3.17-rc3 v2] serial: asc: Adopt readl_/writel_relaxed() Date: Tue, 9 Sep 2014 11:03:57 +0100 Message-Id: <1410257037-20030-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409745651-3247-1-git-send-email-daniel.thompson@linaro.org> References: <1409745651-3247-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The architectures supported by this driver, arm and sh, have expensive implementations of writel(), reliant on spin locks and explicit L2 cache management. These architectures provide a cheaper writel_relaxed() which is much better suited to peripherals that do not perform DMA. The situation with readl()/readl_relaxed()is similar although less acute. This driver does not use DMA and will be more power efficient and more robust (due to absence of spin locks during console I/O) if it uses the relaxed variants. The driver supports COMPILE_TEST and therefore falls back to writel() when writel_relaxed() does not exist. Signed-off-by: Daniel Thompson Cc: Srinivas Kandagatla Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: kernel@stlinux.com Cc: linux-serial@vger.kernel.org --- Notes: Changes since v1: * Added fallback to writel() to permit COMPILE_TESTing (review of Greg Kroah-Hartmam). drivers/tty/serial/st-asc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 1.9.3 diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 8b2d735..a3fc167 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -151,12 +151,16 @@ static inline struct asc_port *to_asc_port(struct uart_port *port) static inline u32 asc_in(struct uart_port *port, u32 offset) { - return readl(port->membase + offset); + return readl_relaxed(port->membase + offset); } static inline void asc_out(struct uart_port *port, u32 offset, u32 value) { +#ifdef writel_relaxed + writel_relaxed(value, port->membase + offset); +#else writel(value, port->membase + offset); +#endif } /*