From patchwork Sun Jan 13 01:10:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1969441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id A3238DF215 for ; Sun, 13 Jan 2013 01:15:21 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TuC70-0008Jh-R8; Sun, 13 Jan 2013 01:11:47 +0000 Received: from mail-ee0-f47.google.com ([74.125.83.47]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TuC6U-000876-M0 for linux-arm-kernel@lists.infradead.org; Sun, 13 Jan 2013 01:11:16 +0000 Received: by mail-ee0-f47.google.com with SMTP id e52so1398801eek.20 for ; Sat, 12 Jan 2013 17:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=pbjZaPgoraAj4TuZMRhES2PA9sC61B9HlpzT8P0bRoI=; b=lif+Im2FOHINFvSaVSmIh67fsNmF90LV0af3nt6oEpSsPRAEl3fGhPyUMmJOkjuW4f 7wQD2rwCGr2hLNTJH8phl29SuFefxLqAiPLYRMjEATUGZvoVxZ6atXXHsgf93HQ731Ik Eq7WdpSUxEkqHgSVnlHi21ou8fLEbNoHTcNqqkW9CjchospFKUcmjoFmSdmr9LJKOpRK 5Bw0qnCacmznoKd/lJKqqLzsUl+Cr9G5KNcD0Gq93dKA6N91hMKITdoNO1J9HmpRACRl ibSCqp96OTJfEsYso9IxffNCvFjLCWWF99H3rlsO64YcNwpAg6QAg5rIuhxcwhJC2IUa JsAQ== X-Received: by 10.14.194.4 with SMTP id l4mr215535487een.42.1358039472340; Sat, 12 Jan 2013 17:11:12 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPS id r1sm15084072eeo.2.2013.01.12.17.11.11 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Jan 2013 17:11:11 -0800 (PST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/6] ARM: common: vic: Fix invalid first IRQ number in OF-based registration Date: Sun, 13 Jan 2013 02:10:54 +0100 Message-Id: <1358039458-31960-3-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1358039458-31960-1-git-send-email-tomasz.figa@gmail.com> References: <1358039458-31960-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130112_201114_973821_96D1C1CF X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.47 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomasz.figa[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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 Cc: kgene.kim@samsung.com, linux@arm.linux.org.uk, kwangwoo.lee@gmail.com, devicetree-discuss@lists.ozlabs.org, broonie@opensource.wolfsonmicro.com, mcuelenaere@gmail.com, Tomasz Figa , augulis.darius@gmail.com, jacmet@sunsite.dk, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 Without this patch, vic_of_init passed -1 as first IRQ number to __vic_init (as signed int), then to vic_register (now as unsigned int equals to 0xffffffff) and finally to irq_domain_add_simple (again as unsigned 0xffffffff), which tries to allocate irq descriptors starting from IRQ 0xffffffff, which obviously is bound to fail. This patch corrects OF-based VIC registration by locating VICs in IRQ address space starting from IRQ 32 and then placing one VIC after another. This is similar to the solution used with GIC and allows to maintain compatibility with legacy code using static IRQ numbers. Signed-off-by: Tomasz Figa --- arch/arm/common/vic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index c2889da..8001994 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c @@ -421,9 +421,9 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) of_property_read_u32(node, "wakeup-mask", &wakeup_mask); /* - * Passing -1 as first IRQ makes the simple domain allocate descriptors + * Use IRQ numbers starting from 32 and placing each VIC after another */ - __vic_init(regs, -1, interrupt_mask, wakeup_mask, node); + __vic_init(regs, 32 + (32 * vic_id), interrupt_mask, wakeup_mask, node); return 0; }