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: 9674613 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 D462560382 for ; Tue, 11 Apr 2017 06:08:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF1F82849A for ; Tue, 11 Apr 2017 06:08:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3EE8284F4; Tue, 11 Apr 2017 06:08:08 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B6B52849A for ; Tue, 11 Apr 2017 06:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pHsn+Xxto3uro9t8VoqxlvMyL6k8Kot13BQM62wNUzE=; b=OynRIdmjrYVEBX brrD36u6sRbzohjK6sVsqm7HyPv1Y+c1IK1zQ5IvOKM3X23t5aUcCJrnO7hPXry+3JNOwWOSTj/5W /hoeEDuAnA/dYww/LcawwyI8oZAYW426s1ekyu4J22ffAhfQWZua9M2NkG78KUXRz4hTCRtAXyZi1 pfJ7EkPHKVjBmj80ysrgNCHuPf5feNvGGkaN3/nArHKE0QlmZRNm4rg53M6ewFPZSrgJUK5j2kEYp W5inhpAIfAsayRZutg7t9V2n0nb0Gt/HUSpmFDlAKZBgPfGvmNEOx/UmPkHNFqYDKNqmWnVNVxfyK O8yZuPrHD69AsxfkuOXw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cxoyB-00070d-7h; Tue, 11 Apr 2017 06:08:03 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cxoy6-0006u2-0L for linux-amlogic@lists.infradead.org; Tue, 11 Apr 2017 06:07:59 +0000 Received: by mail-wm0-x241.google.com with SMTP id d79so13018190wmi.2 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=UmNu72OEbfeKiFcmZsOcdW+qBB9zvulYYDX09XQLdJalWVMkfqIxetP7NYoC41BDkB 3+wNFNzg/984PLaxdMpMZmHnVHhZo5sVqNqzGoefI7jaFrYOlLaTw2/QQilq8aCZFnd7 lzHD4Tft06S/2Dm+hGPS5JkwRlKoQ9S1aH2BnL03ASL4fKl/skg2r//lqeiRZea4xvNS m1kdtjbp7HMOLl6DneQ9YRJLvmIkzo/613KCqV63PNy4+M7nKT3hbQ2dECA4eVUOMyFj XokATOh9YwVPy+74UEObzzMkc4ucsN6txv5/janyCVF2DZUEmCk+J9RDRyDxc7Rmg6hW QzOg== X-Gm-Message-State: AN3rC/4p4DVRbl0DoTe+lYdTqX2iqfTPl+vgpm8ZTYbKuBQjfDQcH4MrgMYPc5y2UU0iuA== 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 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170410_230758_216404_933E5A9E X-CRM114-Status: UNSURE ( 8.30 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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);