From patchwork Tue Apr 11 06:05:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9674601 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 5602260382 for ; Tue, 11 Apr 2017 06:07:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D09E2849A for ; Tue, 11 Apr 2017 06:07:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30714284F4; Tue, 11 Apr 2017 06:07:41 +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 B398D2849A for ; Tue, 11 Apr 2017 06:07:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752319AbdDKGHj (ORCPT ); Tue, 11 Apr 2017 02:07:39 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33368 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753032AbdDKGHh (ORCPT ); Tue, 11 Apr 2017 02:07:37 -0400 Received: by mail-wm0-f68.google.com with SMTP id o81so12978886wmb.0 for ; Mon, 10 Apr 2017 23:07:37 -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=WsOBkRZ5/fC6QQbCtYSslH7YFQES9W3cmAI0UL6E/+w=; b=GTRF+b5eW0zOGTKjOWGXgzuUHACyvA6iy1zsfI6oLH4qteZQWHMSHIERMWXsQ5j9x+ fQZDk6Nh1fRjUuQh3XmHNJvz7j7FrGDFJn0NhLH5m8AUUDdcARBXq0u3Kv7Z/FrKR13Y zyOu3YUUYPyddsh0UnBfk800+L0lKstR3a6BQbIzALSEXhNHvVJe9ZcZMjvTkReGqiZ6 ceXzzqF1UBbUQdKBOLjWJHleqL/rtRK6a7LJxRn1hPFPiFSWCA9Kg+qrgl/8Kcpu/D7z hJDD+GJYvJCTJvxpL43eDCmT0vjE4CYY5Deiy7Z4mnMg1/e6o7jqolIrS/vUGfeTo764 RNhA== 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=WsOBkRZ5/fC6QQbCtYSslH7YFQES9W3cmAI0UL6E/+w=; b=MSwVk5RmZf4rY+fQYTec/a1E45kfbywogQ0h2j2vSeJh4xz/2zMKyuBHWETNlZmyZZ 0nuCJo/9rGTGECz8o9if2i5Ex8Idb6F0YjZrfR8lBZcer1VYBk7cL9o6Qt9zxHcrB8kw /GV/xQKjY9+dKPBLKsg4X2fOWroh6rmbs9vYEJeaMzE5Tlxv5QGJBa/zRfh8mlcCN5SL 0gOeDYJ4s4UKPd9KNq085v0sDNlT1robifyzFw+AW4DfZ1JiX58T5mywg0tyd5Lxf9B9 kVG0DmSzK3hs3PphQhmMeHeE1Kh5HLQWkSoLJZien52GNxIdhWc0T6Ca1MnHVc1wp14h EKZQ== X-Gm-Message-State: AN3rC/7DxGzxBSaalBaSs9CscYExVwRyA7ybRmjaKSNjEUFxSvHIms6NnU0Q8c6uCus8gQ== X-Received: by 10.28.86.68 with SMTP id k65mr12796219wmb.112.1491890856285; Mon, 10 Apr 2017 23:07:36 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdc:4000:4d95:3656:1b99:b390? (p200300C6EBDC40004D9536561B99B390.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:4d95:3656:1b99:b390]) by smtp.googlemail.com with ESMTPSA id 13sm1027626wml.25.2017.04.10.23.07.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 23:07:35 -0700 (PDT) Subject: [PATCH 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler From: Heiner Kallweit To: Mauro Carvalho Chehab , Sean Young , Kevin Hilman Cc: linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org References: Message-ID: <3add55c4-1e29-f070-6fef-7f92b2595874@gmail.com> Date: Tue, 11 Apr 2017 08:05:26 +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 --- 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 d56ef27e..246da2db 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);