From patchwork Sun May 11 08:05:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 29934 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 88136208CF for ; Sun, 11 May 2014 08:09:07 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wm4sf31448192obc.10 for ; Sun, 11 May 2014 01:09:07 -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:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=Nle0JJWLsszO3JFjSkm+ZBh6FHAACiBPnthQQkBJeYI=; b=Bve/Te+/uepXFuNyOJPmCRDxP+dDImPD5GnGkTnTi0mnbDyeS66DAS4yVPnAswpFE8 dJbOoJXS3LsqBQhYQAGQp1IoHZI/OspLW5pT2B1worrRL+ZfiHxHBxFwJ4T1BVe223iD zCvA9SEfitbi8kzskAVnHNWMMZMabi6BMdi+kbTSmrQUM0/bRwBsdVU4HG0737bo9BD6 oBfaS8ir5koPh8Qzr5omQmYkwYRsRAJtcnOFiKBOSI/T8CYkzeybYhaGyP5PCGHuS2uX pLRefDZlRvqSr+k7MfZfdacftCkvP4wFJ23mOdaylMKTd9/pRPW0i78iEA8qC/7VMz86 5CtA== X-Gm-Message-State: ALoCoQlhVDWEjhlUP1wDhUdRhz5n3mz6dz+Ij4AmY9U7R37vmp8X38lUjk6yLvNhgVzTXWNlrP1o X-Received: by 10.182.22.133 with SMTP id d5mr10512261obf.27.1399795747051; Sun, 11 May 2014 01:09:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.112 with SMTP id p103ls946845qga.41.gmail; Sun, 11 May 2014 01:09:07 -0700 (PDT) X-Received: by 10.52.142.10 with SMTP id rs10mr14493731vdb.3.1399795746971; Sun, 11 May 2014 01:09:06 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id de9si1529865vcb.213.2014.05.11.01.09.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 May 2014 01:09:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jw12so7242531veb.5 for ; Sun, 11 May 2014 01:09:06 -0700 (PDT) X-Received: by 10.52.185.105 with SMTP id fb9mr14330786vdc.12.1399795746898; Sun, 11 May 2014 01:09: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.220.221.72 with SMTP id ib8csp128000vcb; Sun, 11 May 2014 01:09:06 -0700 (PDT) X-Received: by 10.224.119.131 with SMTP id z3mr28180641qaq.91.1399795746322; Sun, 11 May 2014 01:09:06 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id u7si4377643qab.6.2014.05.11.01.09.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 May 2014 01:09:06 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WjOnD-000484-Vn; Sun, 11 May 2014 08:07:31 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WjOn2-0003aq-Mg for linux-arm-kernel@lists.infradead.org; Sun, 11 May 2014 08:07:21 +0000 Received: by mail-pa0-f50.google.com with SMTP id fb1so6142834pad.23 for ; Sun, 11 May 2014 01:06:56 -0700 (PDT) X-Received: by 10.66.148.134 with SMTP id ts6mr40963629pab.113.1399795616624; Sun, 11 May 2014 01:06:56 -0700 (PDT) Received: from localhost.localdomain ([140.206.182.114]) by mx.google.com with ESMTPSA id i10sm32062137pat.36.2014.05.11.01.06.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 May 2014 01:06:55 -0700 (PDT) From: Haojian Zhuang To: tglx@linutronix.de, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, arnd@arndb.de, olof@lixom.net, khilman@kernel.org, xuwei5@hisilicon.com, christoffer.dall@linaro.org, Dave.Martin@arm.com, nicolas.pitre@linaro.org, marc.zyngier@arm.com Subject: [PATCH v6 02/15] irq: gic: use mask field in GICC_IAR Date: Sun, 11 May 2014 16:05:58 +0800 Message-Id: <1399795571-17231-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399795571-17231-1-git-send-email-haojian.zhuang@linaro.org> References: <1399795571-17231-1-git-send-email-haojian.zhuang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140511_010720_754105_65598476 X-CRM114-Status: GOOD ( 11.23 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.50 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Cc: Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: haojian.zhuang@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.128.174 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 Bit[9:0] is interrupt ID field in GICC_IAR. Bit[12:10] is CPU ID field, and others are reserved. So we should use GICC_IAR_INT_ID_MASK to get interrupt ID. It's not a good way to use ~0x1c00 (CPU ID field) to get interrupt ID. Signed-off-by: Haojian Zhuang --- drivers/irqchip/irq-gic.c | 2 +- include/linux/irqchip/arm-gic.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 4300b66..f711fb6 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -287,7 +287,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) do { irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK); - irqnr = irqstat & ~0x1c00; + irqnr = irqstat & GICC_IAR_INT_ID_MASK; if (likely(irqnr > 15 && irqnr < 1021)) { irqnr = irq_find_mapping(gic->domain, irqnr); diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h index 7ed92d0..45e2d8c 100644 --- a/include/linux/irqchip/arm-gic.h +++ b/include/linux/irqchip/arm-gic.h @@ -21,6 +21,8 @@ #define GIC_CPU_ACTIVEPRIO 0xd0 #define GIC_CPU_IDENT 0xfc +#define GICC_IAR_INT_ID_MASK 0x3ff + #define GIC_DIST_CTRL 0x000 #define GIC_DIST_CTR 0x004 #define GIC_DIST_IGROUP 0x080