From patchwork Wed Apr 12 19:33:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9678291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C9E1601C3 for ; Wed, 12 Apr 2017 19:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B9FD28615 for ; Wed, 12 Apr 2017 19:35:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 106A928641; Wed, 12 Apr 2017 19:35:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9E5628615 for ; Wed, 12 Apr 2017 19:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755129AbdDLTfS (ORCPT ); Wed, 12 Apr 2017 15:35:18 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36103 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754634AbdDLTfP (ORCPT ); Wed, 12 Apr 2017 15:35:15 -0400 Received: by mail-wm0-f68.google.com with SMTP id q125so8538298wmd.3 for ; Wed, 12 Apr 2017 12:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=O6Q4ZdsQtJklfrV3O5E9jf1AKJoX/f56R/StFHW3HNE=; b=SBKZ/gTSvXX6AkvO2evqZev/aTEbjHnwslCjLhgXwRgr+PWFxEeGn086kNdvatCsXT TF41mf8Mj88zFAZD0He6xn8QL6PldiS5hNOjX27/PewCgx0A/4w439PCPwSfJFryaX9z FD+MBvU3x83Fdz1WiASdzCQQieArSbrQ6yUvXimNKZHVQPbDM1Z6LZLlyvwbnyeKih/w Glw1fbCaZdR+ZY14NtsPSQjjlfU/nRiRoXltFU+Y3Uu1wjXcILzn6Dqdp19OQgtbd3O+ yYD8xf0OXcQ2fSgzEVqH/gQAd6HqdELAqxb3BtTzFh7pcit/KpqgoSc2WRixjShkq/L3 fm+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=O6Q4ZdsQtJklfrV3O5E9jf1AKJoX/f56R/StFHW3HNE=; b=Fp+bhn8w5+whZIZUpU61FMuDzFFHMiwwRBP/PctIyT9D16vPQbgyqmzgHCT4RsDCAz A4AiaNF0ZKRrbg5alJ6TJsCEe4/wOHgiPxJrJPfvRWbfibux71MNSu1wnlfLrNBTqleO sfr8tSf2t6R6ZClCGidVeXnBS3TWBuCjbkkf0I+I4vaBrkuSKLQa27hVJ3DmNZI1pVYv Xcp8UZoRAmogI7Hy9NHNdHrNBq9qP9SYcQsgEpWov5QEm3Vzpy+32AyOKVFeFS5vJMUW HFhsM9byiuWbeLpm2zTxdZsfC1KUDiibX/8zwtQR8LVorWnQ+qZjj08RjD+QoFyt5H12 m/uw== X-Gm-Message-State: AN3rC/4WtL7OVUCgkVLSwkCdzVXyqtptSUUCy+t85s1/K+T9L940yxLGwWWZS30Ysus0Uw== X-Received: by 10.28.178.17 with SMTP id b17mr4189761wmf.23.1492025714590; Wed, 12 Apr 2017 12:35:14 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdc:4000:f514:8038:dab0:5880? (p200300C6EBDC4000F5148038DAB05880.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:f514:8038:dab0:5880]) by smtp.googlemail.com with ESMTPSA id g63sm7734220wme.11.2017.04.12.12.35.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Apr 2017 12:35:14 -0700 (PDT) Subject: [PATCH v2 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler From: Heiner Kallweit To: Mauro Carvalho Chehab , Sean Young , Kevin Hilman , Neil Armstrong Cc: linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org References: Message-ID: Date: Wed, 12 Apr 2017 21:33:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need the memory barriers here and an interrupt handler should be as fast as possible. Therefore switch to readl_relaxed. Signed-off-by: Heiner Kallweit Reviewed-by: Neil Armstrong --- v2: - added R-b --- drivers/media/rc/meson-ir.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c index cf8943d2..1c72593d 100644 --- a/drivers/media/rc/meson-ir.c +++ b/drivers/media/rc/meson-ir.c @@ -83,16 +83,17 @@ static void meson_ir_set_mask(struct meson_ir *ir, unsigned int reg, static irqreturn_t meson_ir_irq(int irqno, void *dev_id) { struct meson_ir *ir = dev_id; - u32 duration; + u32 duration, status; DEFINE_IR_RAW_EVENT(rawir); spin_lock(&ir->lock); - duration = readl(ir->reg + IR_DEC_REG1); + duration = readl_relaxed(ir->reg + IR_DEC_REG1); duration = FIELD_GET(REG1_TIME_IV_MASK, duration); rawir.duration = US_TO_NS(duration * MESON_TRATE); - rawir.pulse = !!(readl(ir->reg + IR_DEC_STATUS) & STATUS_IR_DEC_IN); + status = readl_relaxed(ir->reg + IR_DEC_STATUS); + rawir.pulse = !!(status & STATUS_IR_DEC_IN); ir_raw_event_store_with_filter(ir->rc, &rawir); ir_raw_event_handle(ir->rc);