From patchwork Wed May 7 14:44:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 29775 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D96D3202E4 for ; Wed, 7 May 2014 14:48:01 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kx10sf4838384pab.6 for ; Wed, 07 May 2014 07:48:00 -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=QpwTZdQSDVfRaUu0WorRKYK+Fy+GCiPR1LhasCmBgv1M8FY+GLrIo3xivU8SjkLsM8 LXlbxMb8VwwYCl/WlHTzphWHsiNvZOdBT27ckISrLp0Tt+34Olo7sCJYyA5IA4SMCXj/ /XlkYpNuiKofJMMBxruWKIw7KmBVyjNQ7no/7RVu+zHu0JPTofBjQ/HAUK8OwWatFlAP zzD6yCH6OigOpRUEOfrLjf0xuyeAm7kT3SRTqMnpM8Px4S95ukB7VD+9EChWZLxuy9Sg gdwvkWom4rcDL4POn6TO9w6HzJcJPgzpDO8sYeja2eygkFcO33HO85g0w3dCjOib1edf 6ljA== X-Gm-Message-State: ALoCoQmkrXkKkA8tCpZLeF6L212yK4QGXI2KU0H3/79HMSfuPppmSyokqJP1du/qeEB05UxTTmiw X-Received: by 10.66.121.136 with SMTP id lk8mr4409967pab.34.1399474080479; Wed, 07 May 2014 07:48:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.247 with SMTP id u110ls1453507qge.79.gmail; Wed, 07 May 2014 07:48:00 -0700 (PDT) X-Received: by 10.58.127.168 with SMTP id nh8mr1448816veb.44.1399474080181; Wed, 07 May 2014 07:48:00 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id ej2si2950005veb.95.2014.05.07.07.48.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 07:48:00 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lg15so1404660vcb.7 for ; Wed, 07 May 2014 07:48:00 -0700 (PDT) X-Received: by 10.58.112.98 with SMTP id ip2mr6859771veb.35.1399474080110; Wed, 07 May 2014 07:48:00 -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 ib8csp315661vcb; Wed, 7 May 2014 07:47:59 -0700 (PDT) X-Received: by 10.140.36.105 with SMTP id o96mr35483099qgo.25.1399474079461; Wed, 07 May 2014 07:47:59 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id n7si6825798qas.171.2014.05.07.07.47.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2014 07:47:59 -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 1Wi375-0005dP-6c; Wed, 07 May 2014 14:46:27 +0000 Received: from mail-pd0-f170.google.com ([209.85.192.170]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wi36z-0005Nt-1H for linux-arm-kernel@lists.infradead.org; Wed, 07 May 2014 14:46:21 +0000 Received: by mail-pd0-f170.google.com with SMTP id v10so1168534pde.15 for ; Wed, 07 May 2014 07:45:57 -0700 (PDT) X-Received: by 10.66.250.161 with SMTP id zd1mr20016780pac.136.1399473957542; Wed, 07 May 2014 07:45:57 -0700 (PDT) Received: from localhost.localdomain ([140.206.182.114]) by mx.google.com with ESMTPSA id nw13sm115484380pab.37.2014.05.07.07.45.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 May 2014 07:45:56 -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 v5 04/14] irq: gic: use mask field in GICC_IAR Date: Wed, 7 May 2014 22:44:38 +0800 Message-Id: <1399473888-12947-5-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399473888-12947-1-git-send-email-haojian.zhuang@linaro.org> References: <1399473888-12947-1-git-send-email-haojian.zhuang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140507_074621_100757_0288B536 X-CRM114-Status: GOOD ( 11.86 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.170 listed in list.dnswl.org] 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=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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