From patchwork Mon Jul 28 21:16:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 34415 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 49C9F202E4 for ; Mon, 28 Jul 2014 21:18:07 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf56142663pac.11 for ; Mon, 28 Jul 2014 14:18:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=ZhHNWJ2KwoYZebkTd6A8x10nt1CdTrWV8LDkx3LX/p4=; b=bGlqTcYQp+yxVnhqKXL0abAfEYF92onzym8vxLhk/hpKxYy3A3+tYrJ9jNHynI+Hud HfAHG2Z8Fii3iekVFuPGdzmvLXQEYOK4w5EUuUnNCC5jx6N9JDXU2HkzZR4JgSwXeDuL 9uLZZZDB5vOnSi2nTJzlQZAiiMh0K0jJ0yQyAERMIEvdY0sHstEu/dSRY1+lDpmr/MoJ M1H8CONCLyE8YjM3S4e/Ud5O8sm9QjmK/ScaYaKEyOZu/2ptQxjG6fV19DKIhZs4qjVK ldmnMn7ZZLQP0rB927C2EHI65qrQbDRGAa0o44umbDIQStTE2HJMN8UUFG6TWEVfwLY9 7q7w== X-Gm-Message-State: ALoCoQmK7/23xcMwwhOs7ZQjbnjS2jspWOO2dnaSTatgsuQBqvnhcuLoKbVPVzFp78mw3LE5StTI X-Received: by 10.66.90.193 with SMTP id by1mr7644387pab.30.1406582286507; Mon, 28 Jul 2014 14:18:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.101 with SMTP id c92ls2124152qge.90.gmail; Mon, 28 Jul 2014 14:18:06 -0700 (PDT) X-Received: by 10.220.183.65 with SMTP id cf1mr3550729vcb.76.1406582286373; Mon, 28 Jul 2014 14:18:06 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id rd6si13346673vcb.39.2014.07.28.14.18.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jul 2014 14:18:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so11964582vcb.24 for ; Mon, 28 Jul 2014 14:18:06 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr3612411vcb.48.1406582286295; Mon, 28 Jul 2014 14:18:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp197003vcb; Mon, 28 Jul 2014 14:18:05 -0700 (PDT) X-Received: by 10.70.118.9 with SMTP id ki9mr7774444pdb.104.1406582285482; Mon, 28 Jul 2014 14:18:05 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dv3si9546868pdb.109.2014.07.28.14.18.04 for ; Mon, 28 Jul 2014 14:18:05 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbaG1VSA (ORCPT + 6 others); Mon, 28 Jul 2014 17:18:00 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:59240 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbaG1VRm (ORCPT ); Mon, 28 Jul 2014 17:17:42 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s6SLHEMX032108; Mon, 28 Jul 2014 16:17:14 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6SLHEe0027674; Mon, 28 Jul 2014 16:17:14 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 28 Jul 2014 16:17:13 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6SLHD5n018939; Mon, 28 Jul 2014 16:17:13 -0500 From: Felipe Balbi To: Tony Lindgren CC: Linux OMAP Mailing List , Linux ARM Kernel Mailing List , , , , , , , Linux Kernel Mailing List , Felipe Balbi Subject: [PATCH 28/35] arm: omap: irq: get rid of ifdef hack Date: Mon, 28 Jul 2014 16:16:16 -0500 Message-ID: <1406582183-696-29-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.1.563.g66f467c In-Reply-To: <1406582183-696-1-git-send-email-balbi@ti.com> References: <1406582183-696-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com 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.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , we don't need the ifdef if we have omap_nr_pending telling us how many pending registers we have on current platform. This solves a possible problem where we could try to handle bogus interrupts on OMAP2 and OMAP3 if using single zImage kernel, because we would end up reading the following pending FIQ register. Signed-off-by: Felipe Balbi --- arch/arm/mach-omap2/irq.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index 583a1c7..43785ee 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c @@ -234,24 +234,16 @@ static void __init omap_init_irq(u32 base, struct device_node *node) static asmlinkage void __exception_irq_entry omap_intc_handle_irq(struct pt_regs *regs) { - u32 irqnr; + u32 irqnr = 0; int handled_irq = 0; + int i; do { - irqnr = intc_readl(INTC_PENDING_IRQ0); - if (irqnr) - goto out; - - irqnr = intc_readl(INTC_PENDING_IRQ1); - if (irqnr) - goto out; - - irqnr = intc_readl(INTC_PENDING_IRQ2); -#if IS_ENABLED(CONFIG_SOC_TI81XX) || IS_ENABLED(CONFIG_SOC_AM33XX) - if (irqnr) - goto out; - irqnr = intc_readl(INTC_PENDING_IRQ3); -#endif + for (i = 0; i < omap_nr_pending; i++) { + irqnr = intc_readl(INTC_PENDING_IRQ0 + (0x20 * i)); + if (irqnr) + goto out; + } out: if (!irqnr)