From patchwork Wed Aug 31 14:48:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 1116812 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7VEmihK008171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 31 Aug 2011 14:49:05 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qym5Y-0006uj-Ts; Wed, 31 Aug 2011 14:48:25 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qym5Y-0000Vn-Dx; Wed, 31 Aug 2011 14:48:24 +0000 Received: from mail-pz0-f41.google.com ([209.85.210.41]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qym5U-0000VR-T3 for linux-arm-kernel@lists.infradead.org; Wed, 31 Aug 2011 14:48:21 +0000 Received: by pzk4 with SMTP id 4so1834484pzk.28 for ; Wed, 31 Aug 2011 07:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=OJvUD8BPf97MDHBQlxfsrXR2m013YG2iIjnXxLX4OyA=; b=hoLOBULZ/BpMsybK6m3StvTBBWZoc48qngCu62JP3GKScFspVICva+G1VetaElyANX sTkh8iyUULFaolTbGPcTNX9/Ghy07cfYV63c698S4hTR14aIXnxN7eAh9KpkSu2AusFp fIp9Xzn4EZSuKgQV9G7deS0OHfII8EjWRchRE= Received: by 10.68.121.205 with SMTP id lm13mr608194pbb.321.1314802098590; Wed, 31 Aug 2011 07:48:18 -0700 (PDT) Received: from localhost ([119.136.67.77]) by mx.google.com with ESMTPS id u10sm4085548pbr.12.2011.08.31.07.48.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Aug 2011 07:48:17 -0700 (PDT) From: tom.leiming@gmail.com To: linux@arm.linux.org.uk Subject: [PATCH] arm: gic: fix gic_set_affinity Date: Wed, 31 Aug 2011 22:48:06 +0800 Message-Id: <1314802086-26133-1-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.7.4.1 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110831_104821_218214_DAEED610 X-CRM114-Status: GOOD ( 12.20 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tom.leiming[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.41 listed in list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL To: misformatted and free email service Cc: Ming Lei , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 31 Aug 2011 14:49:05 +0000 (UTC) From: Ming Lei Current gic_set_affinity doesn't support to route irq to all cpu, so fix it. Also remove the unnecessary check for 'cpu' since cpu_online_mask is already ADDed to produce correct one. Signed-off-by: Ming Lei --- arch/arm/common/gic.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index 3227ca9..20890f4 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c @@ -173,14 +173,14 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, { void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); unsigned int shift = (d->irq % 4) * 8; - unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); - u32 val, mask, bit; + unsigned int cpu; + u32 val, mask, bit, cpuset = 0; - if (cpu >= 8 || cpu >= nr_cpu_ids) - return -EINVAL; + for_each_cpu_and(cpu, mask_val, cpu_online_mask) + cpuset |= 1 << cpu; mask = 0xff << shift; - bit = 1 << (cpu + shift); + bit = cpuset << shift; spin_lock(&irq_controller_lock); val = readl_relaxed(reg) & ~mask;