linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.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	[thread overview]
Message-ID: <1358039458-31960-3-git-send-email-tomasz.figa@gmail.com> (raw)
In-Reply-To: <1358039458-31960-1-git-send-email-tomasz.figa@gmail.com>

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 <tomasz.figa@gmail.com>
---
 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;
 }
-- 
1.8.1

  parent reply	other threads:[~2013-01-13  1:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13  1:10 [PATCH 0/6] Initial Device Tree support for S3C64xx Tomasz Figa
2013-01-13  1:10 ` [PATCH 1/6] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
2013-01-14  1:08   ` Rob Herring
2013-01-14 10:44     ` Tomasz Figa
2013-01-13  1:10 ` Tomasz Figa [this message]
2013-01-13  1:10 ` [PATCH 3/6] ARM: s3c64xx: Add support for OF-based VIC initialization Tomasz Figa
2013-01-13  1:10 ` [PATCH 4/6] ARM: s3c64xx: Add board file for boot using Device Tree Tomasz Figa
2013-01-13  1:10 ` [PATCH 5/6] ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs Tomasz Figa
2013-01-14 14:48   ` Mark Rutland
2013-01-14 15:05     ` Lorenzo Pieralisi
2013-01-16 10:59       ` Dave Martin
2013-01-25 19:08         ` Tomasz Figa
2013-01-25 19:15           ` Kukjin Kim
2013-01-28  9:02             ` Mark Rutland
2013-01-28 13:04               ` Dave Martin
2013-01-13  1:10 ` [PATCH 6/6] ARM: dts: Add dts file for S3C6410-based Mini6410 board Tomasz Figa
2013-01-25 19:09 ` [PATCH 0/6] Initial Device Tree support for S3C64xx Tomasz Figa
2013-01-25 19:25   ` Kukjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358039458-31960-3-git-send-email-tomasz.figa@gmail.com \
    --to=tomasz.figa@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).