From patchwork Wed Jan 9 23:41:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1957801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4760C3FC5A for ; Wed, 9 Jan 2013 23:45:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tt5I1-0003W5-Oe; Wed, 09 Jan 2013 23:42:33 +0000 Received: from mail-ea0-f180.google.com ([209.85.215.180]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tt5Ha-0003Rv-0d for linux-arm-kernel@lists.infradead.org; Wed, 09 Jan 2013 23:42:08 +0000 Received: by mail-ea0-f180.google.com with SMTP id f13so890868eai.11 for ; Wed, 09 Jan 2013 15:42:03 -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=NNVrhgQPqYVYiw41bwQcuy043JhWe/rE+bR4GieULmN5Vk7U9sITP9tdihzpT/uk+l I5HvVW6M7HQ4mEMO0qFQiaiCmTHd1eYqF4GVNR4CxeDiX3qTJkFkEeCh2BaeduGQHfb9 g7dZhsxBOFrudjyk7/yyeSkSc3TXLCvHuOaDTPBvR9zXVKmLupuX72zCzWHPZ3LWWBwY cwvKHEEUuuJmb+DONDLDz4kH25z4EWTGvHG6HEYi2s+b3QLFwSMlgCpwoLrkFJCoFPnA v2J0ux6fY6n/b62gjZaRVEzXot++21BOKPRCJD8Jmg/k9dYWR/CKIJhk/YFMnVdQUYkM f30Q== X-Received: by 10.14.219.3 with SMTP id l3mr185810418eep.5.1357774923753; Wed, 09 Jan 2013 15:42:03 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPS id e2sm144296239eeo.8.2013.01.09.15.42.02 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Jan 2013 15:42:03 -0800 (PST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [RFC PATCH 2/7] ARM: common: vic: Fix invalid first IRQ number in OF-based registration Date: Thu, 10 Jan 2013 00:41:44 +0100 Message-Id: <1357774909-29938-3-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1357774909-29938-1-git-send-email-tomasz.figa@gmail.com> References: <1357774909-29938-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130109_184206_291659_8AFA4D0E X-CRM114-Status: GOOD ( 11.23 ) 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 [209.85.215.180 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; }