Re: [PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-14 Thread Rob Herring
On 02/13/2013 12:51 PM, Doug Anderson wrote:
> Rob / Olof,
> 
> On Tue, Feb 12, 2013 at 2:52 PM, Olof Johansson  wrote:
>> On Tue, Feb 12, 2013 at 04:04:52PM -0600, Rob Herring wrote:
>>> From: Rob Herring 
>>>
>>> Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
>>> for GIC init). This commit split the irqchip initialization into 2 calls
>>> to of_irq_init. This does not work because of_irq_init requires interrupt
>>> parents to be in the match list.
>>>
>>> Rather than reverting exynos changes, make it do the proper thing by using
>>> IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.
>>>
>>> Reported-by: Doug Anderson 
>>> Signed-off-by: Rob Herring 
>>> Cc: Kukjin Kim 
>>> Cc: Russell King 
>>> Cc: Thomas Gleixner 
>>> Cc: linux-samsung-...@vger.kernel.org
>>> ---
>>>
>>> I thought there may be other platforms broken in the same way, but I
>>> checked and exynos is the only one.
>>>
>>> This is based on my gic/vic irqchip branch in arm-soc.
>>
>> Applied to next/cleanup.
> 
> I synced up to next-20130213 and the problem is fixed.  :)  ...that
> label doesn't exactly boot but the problems are unrelated to this
> problem now (there are problems with the OF conversions to raw
> spinlocks)...
> 

That should be fixed, but may not be in -next yet. It is in Grant's tree.

Rob

> I haven't done any review of this code (I'm assuming that Olof already
> looked it over and Samsung engineers will give it a thorough review),
> but it's definitely tested.  :)
> 
> Tested-by: Doug Anderson 
> 
> Thanks!
> 
> -Doug
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-14 Thread Rob Herring
On 02/13/2013 12:51 PM, Doug Anderson wrote:
 Rob / Olof,
 
 On Tue, Feb 12, 2013 at 2:52 PM, Olof Johansson o...@lixom.net wrote:
 On Tue, Feb 12, 2013 at 04:04:52PM -0600, Rob Herring wrote:
 From: Rob Herring rob.herr...@calxeda.com

 Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
 for GIC init). This commit split the irqchip initialization into 2 calls
 to of_irq_init. This does not work because of_irq_init requires interrupt
 parents to be in the match list.

 Rather than reverting exynos changes, make it do the proper thing by using
 IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.

 Reported-by: Doug Anderson diand...@chromium.org
 Signed-off-by: Rob Herring rob.herr...@calxeda.com
 Cc: Kukjin Kim kgene@samsung.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Thomas Gleixner t...@linutronix.de
 Cc: linux-samsung-...@vger.kernel.org
 ---

 I thought there may be other platforms broken in the same way, but I
 checked and exynos is the only one.

 This is based on my gic/vic irqchip branch in arm-soc.

 Applied to next/cleanup.
 
 I synced up to next-20130213 and the problem is fixed.  :)  ...that
 label doesn't exactly boot but the problems are unrelated to this
 problem now (there are problems with the OF conversions to raw
 spinlocks)...
 

That should be fixed, but may not be in -next yet. It is in Grant's tree.

Rob

 I haven't done any review of this code (I'm assuming that Olof already
 looked it over and Samsung engineers will give it a thorough review),
 but it's definitely tested.  :)
 
 Tested-by: Doug Anderson diand...@chromium.org
 
 Thanks!
 
 -Doug
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-13 Thread Doug Anderson
Rob / Olof,

On Tue, Feb 12, 2013 at 2:52 PM, Olof Johansson  wrote:
> On Tue, Feb 12, 2013 at 04:04:52PM -0600, Rob Herring wrote:
>> From: Rob Herring 
>>
>> Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
>> for GIC init). This commit split the irqchip initialization into 2 calls
>> to of_irq_init. This does not work because of_irq_init requires interrupt
>> parents to be in the match list.
>>
>> Rather than reverting exynos changes, make it do the proper thing by using
>> IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.
>>
>> Reported-by: Doug Anderson 
>> Signed-off-by: Rob Herring 
>> Cc: Kukjin Kim 
>> Cc: Russell King 
>> Cc: Thomas Gleixner 
>> Cc: linux-samsung-...@vger.kernel.org
>> ---
>>
>> I thought there may be other platforms broken in the same way, but I
>> checked and exynos is the only one.
>>
>> This is based on my gic/vic irqchip branch in arm-soc.
>
> Applied to next/cleanup.

I synced up to next-20130213 and the problem is fixed.  :)  ...that
label doesn't exactly boot but the problems are unrelated to this
problem now (there are problems with the OF conversions to raw
spinlocks)...

I haven't done any review of this code (I'm assuming that Olof already
looked it over and Samsung engineers will give it a thorough review),
but it's definitely tested.  :)

Tested-by: Doug Anderson 

Thanks!

-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-13 Thread Doug Anderson
Rob / Olof,

On Tue, Feb 12, 2013 at 2:52 PM, Olof Johansson o...@lixom.net wrote:
 On Tue, Feb 12, 2013 at 04:04:52PM -0600, Rob Herring wrote:
 From: Rob Herring rob.herr...@calxeda.com

 Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
 for GIC init). This commit split the irqchip initialization into 2 calls
 to of_irq_init. This does not work because of_irq_init requires interrupt
 parents to be in the match list.

 Rather than reverting exynos changes, make it do the proper thing by using
 IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.

 Reported-by: Doug Anderson diand...@chromium.org
 Signed-off-by: Rob Herring rob.herr...@calxeda.com
 Cc: Kukjin Kim kgene@samsung.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Thomas Gleixner t...@linutronix.de
 Cc: linux-samsung-...@vger.kernel.org
 ---

 I thought there may be other platforms broken in the same way, but I
 checked and exynos is the only one.

 This is based on my gic/vic irqchip branch in arm-soc.

 Applied to next/cleanup.

I synced up to next-20130213 and the problem is fixed.  :)  ...that
label doesn't exactly boot but the problems are unrelated to this
problem now (there are problems with the OF conversions to raw
spinlocks)...

I haven't done any review of this code (I'm assuming that Olof already
looked it over and Samsung engineers will give it a thorough review),
but it's definitely tested.  :)

Tested-by: Doug Anderson diand...@chromium.org

Thanks!

-Doug
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-12 Thread Olof Johansson
On Tue, Feb 12, 2013 at 04:04:52PM -0600, Rob Herring wrote:
> From: Rob Herring 
> 
> Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
> for GIC init). This commit split the irqchip initialization into 2 calls
> to of_irq_init. This does not work because of_irq_init requires interrupt
> parents to be in the match list.
> 
> Rather than reverting exynos changes, make it do the proper thing by using
> IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.
> 
> Reported-by: Doug Anderson 
> Signed-off-by: Rob Herring 
> Cc: Kukjin Kim 
> Cc: Russell King 
> Cc: Thomas Gleixner 
> Cc: linux-samsung-...@vger.kernel.org
> ---
> 
> I thought there may be other platforms broken in the same way, but I
> checked and exynos is the only one.
> 
> This is based on my gic/vic irqchip branch in arm-soc.

Applied to next/cleanup.

I guess this answers whether anyone boots linux-next regularly on Exynos
hardware. :(


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-12 Thread Rob Herring
From: Rob Herring 

Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
for GIC init). This commit split the irqchip initialization into 2 calls
to of_irq_init. This does not work because of_irq_init requires interrupt
parents to be in the match list.

Rather than reverting exynos changes, make it do the proper thing by using
IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.

Reported-by: Doug Anderson 
Signed-off-by: Rob Herring 
Cc: Kukjin Kim 
Cc: Russell King 
Cc: Thomas Gleixner 
Cc: linux-samsung-...@vger.kernel.org
---

I thought there may be other platforms broken in the same way, but I
checked and exynos is the only one.

This is based on my gic/vic irqchip branch in arm-soc.

Rob

 arch/arm/mach-exynos/common.c |  218 +--
 arch/arm/mach-exynos/common.h |3 +
 drivers/irqchip/Makefile  |1 +
 drivers/irqchip/exynos-combiner.c |  230 +
 4 files changed, 236 insertions(+), 216 deletions(-)
 create mode 100644 drivers/irqchip/exynos-combiner.c

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4ea80bc..50577b6 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -439,218 +440,6 @@ static void __init exynos5_init_clocks(int xtal)
 #endif
 }
 
-#define COMBINER_ENABLE_SET0x0
-#define COMBINER_ENABLE_CLEAR  0x4
-#define COMBINER_INT_STATUS0xC
-
-static DEFINE_SPINLOCK(irq_controller_lock);
-
-struct combiner_chip_data {
-   unsigned int irq_offset;
-   unsigned int irq_mask;
-   void __iomem *base;
-};
-
-static struct irq_domain *combiner_irq_domain;
-static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
-
-static inline void __iomem *combiner_base(struct irq_data *data)
-{
-   struct combiner_chip_data *combiner_data =
-   irq_data_get_irq_chip_data(data);
-
-   return combiner_data->base;
-}
-
-static void combiner_mask_irq(struct irq_data *data)
-{
-   u32 mask = 1 << (data->hwirq % 32);
-
-   __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR);
-}
-
-static void combiner_unmask_irq(struct irq_data *data)
-{
-   u32 mask = 1 << (data->hwirq % 32);
-
-   __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
-}
-
-static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc 
*desc)
-{
-   struct combiner_chip_data *chip_data = irq_get_handler_data(irq);
-   struct irq_chip *chip = irq_get_chip(irq);
-   unsigned int cascade_irq, combiner_irq;
-   unsigned long status;
-
-   chained_irq_enter(chip, desc);
-
-   spin_lock(_controller_lock);
-   status = __raw_readl(chip_data->base + COMBINER_INT_STATUS);
-   spin_unlock(_controller_lock);
-   status &= chip_data->irq_mask;
-
-   if (status == 0)
-   goto out;
-
-   combiner_irq = __ffs(status);
-
-   cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
-   if (unlikely(cascade_irq >= NR_IRQS))
-   do_bad_IRQ(cascade_irq, desc);
-   else
-   generic_handle_irq(cascade_irq);
-
- out:
-   chained_irq_exit(chip, desc);
-}
-
-static struct irq_chip combiner_chip = {
-   .name   = "COMBINER",
-   .irq_mask   = combiner_mask_irq,
-   .irq_unmask = combiner_unmask_irq,
-};
-
-static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int 
irq)
-{
-   unsigned int max_nr;
-
-   if (soc_is_exynos5250())
-   max_nr = EXYNOS5_MAX_COMBINER_NR;
-   else
-   max_nr = EXYNOS4_MAX_COMBINER_NR;
-
-   if (combiner_nr >= max_nr)
-   BUG();
-   if (irq_set_handler_data(irq, _data[combiner_nr]) != 0)
-   BUG();
-   irq_set_chained_handler(irq, combiner_handle_cascade_irq);
-}
-
-static void __init combiner_init_one(unsigned int combiner_nr,
-void __iomem *base)
-{
-   combiner_data[combiner_nr].base = base;
-   combiner_data[combiner_nr].irq_offset = irq_find_mapping(
-   combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
-   combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
-
-   /* Disable all interrupts */
-   __raw_writel(combiner_data[combiner_nr].irq_mask,
-base + COMBINER_ENABLE_CLEAR);
-}
-
-#ifdef CONFIG_OF
-static int combiner_irq_domain_xlate(struct irq_domain *d,
-struct device_node *controller,
-const u32 *intspec, unsigned int intsize,
-unsigned long *out_hwirq,
-unsigned int *out_type)
-{
-   if (d->of_node != controller)
-   return -EINVAL;
-
-   if (intsize < 2)
-   

[PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-12 Thread Rob Herring
From: Rob Herring rob.herr...@calxeda.com

Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
for GIC init). This commit split the irqchip initialization into 2 calls
to of_irq_init. This does not work because of_irq_init requires interrupt
parents to be in the match list.

Rather than reverting exynos changes, make it do the proper thing by using
IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.

Reported-by: Doug Anderson diand...@chromium.org
Signed-off-by: Rob Herring rob.herr...@calxeda.com
Cc: Kukjin Kim kgene@samsung.com
Cc: Russell King li...@arm.linux.org.uk
Cc: Thomas Gleixner t...@linutronix.de
Cc: linux-samsung-...@vger.kernel.org
---

I thought there may be other platforms broken in the same way, but I
checked and exynos is the only one.

This is based on my gic/vic irqchip branch in arm-soc.

Rob

 arch/arm/mach-exynos/common.c |  218 +--
 arch/arm/mach-exynos/common.h |3 +
 drivers/irqchip/Makefile  |1 +
 drivers/irqchip/exynos-combiner.c |  230 +
 4 files changed, 236 insertions(+), 216 deletions(-)
 create mode 100644 drivers/irqchip/exynos-combiner.c

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4ea80bc..50577b6 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -12,6 +12,7 @@
 #include linux/kernel.h
 #include linux/interrupt.h
 #include linux/irq.h
+#include linux/irqchip.h
 #include linux/io.h
 #include linux/device.h
 #include linux/gpio.h
@@ -439,218 +440,6 @@ static void __init exynos5_init_clocks(int xtal)
 #endif
 }
 
-#define COMBINER_ENABLE_SET0x0
-#define COMBINER_ENABLE_CLEAR  0x4
-#define COMBINER_INT_STATUS0xC
-
-static DEFINE_SPINLOCK(irq_controller_lock);
-
-struct combiner_chip_data {
-   unsigned int irq_offset;
-   unsigned int irq_mask;
-   void __iomem *base;
-};
-
-static struct irq_domain *combiner_irq_domain;
-static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
-
-static inline void __iomem *combiner_base(struct irq_data *data)
-{
-   struct combiner_chip_data *combiner_data =
-   irq_data_get_irq_chip_data(data);
-
-   return combiner_data-base;
-}
-
-static void combiner_mask_irq(struct irq_data *data)
-{
-   u32 mask = 1  (data-hwirq % 32);
-
-   __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR);
-}
-
-static void combiner_unmask_irq(struct irq_data *data)
-{
-   u32 mask = 1  (data-hwirq % 32);
-
-   __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
-}
-
-static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc 
*desc)
-{
-   struct combiner_chip_data *chip_data = irq_get_handler_data(irq);
-   struct irq_chip *chip = irq_get_chip(irq);
-   unsigned int cascade_irq, combiner_irq;
-   unsigned long status;
-
-   chained_irq_enter(chip, desc);
-
-   spin_lock(irq_controller_lock);
-   status = __raw_readl(chip_data-base + COMBINER_INT_STATUS);
-   spin_unlock(irq_controller_lock);
-   status = chip_data-irq_mask;
-
-   if (status == 0)
-   goto out;
-
-   combiner_irq = __ffs(status);
-
-   cascade_irq = combiner_irq + (chip_data-irq_offset  ~31);
-   if (unlikely(cascade_irq = NR_IRQS))
-   do_bad_IRQ(cascade_irq, desc);
-   else
-   generic_handle_irq(cascade_irq);
-
- out:
-   chained_irq_exit(chip, desc);
-}
-
-static struct irq_chip combiner_chip = {
-   .name   = COMBINER,
-   .irq_mask   = combiner_mask_irq,
-   .irq_unmask = combiner_unmask_irq,
-};
-
-static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int 
irq)
-{
-   unsigned int max_nr;
-
-   if (soc_is_exynos5250())
-   max_nr = EXYNOS5_MAX_COMBINER_NR;
-   else
-   max_nr = EXYNOS4_MAX_COMBINER_NR;
-
-   if (combiner_nr = max_nr)
-   BUG();
-   if (irq_set_handler_data(irq, combiner_data[combiner_nr]) != 0)
-   BUG();
-   irq_set_chained_handler(irq, combiner_handle_cascade_irq);
-}
-
-static void __init combiner_init_one(unsigned int combiner_nr,
-void __iomem *base)
-{
-   combiner_data[combiner_nr].base = base;
-   combiner_data[combiner_nr].irq_offset = irq_find_mapping(
-   combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
-   combiner_data[combiner_nr].irq_mask = 0xff  ((combiner_nr % 4)  3);
-
-   /* Disable all interrupts */
-   __raw_writel(combiner_data[combiner_nr].irq_mask,
-base + COMBINER_ENABLE_CLEAR);
-}
-
-#ifdef CONFIG_OF
-static int combiner_irq_domain_xlate(struct irq_domain *d,
-struct device_node *controller,
-const u32 *intspec, unsigned int intsize,
- 

Re: [PATCH] ARM: exynos: move exynos4210-combiner to drivers/irqchip

2013-02-12 Thread Olof Johansson
On Tue, Feb 12, 2013 at 04:04:52PM -0600, Rob Herring wrote:
 From: Rob Herring rob.herr...@calxeda.com
 
 Exynos boot is broken with commit 0529e315 (ARM: use common irqchip_init
 for GIC init). This commit split the irqchip initialization into 2 calls
 to of_irq_init. This does not work because of_irq_init requires interrupt
 parents to be in the match list.
 
 Rather than reverting exynos changes, make it do the proper thing by using
 IRQCHIP_DECLARE. This requires moving the combiner code to drivers/irqchip.
 
 Reported-by: Doug Anderson diand...@chromium.org
 Signed-off-by: Rob Herring rob.herr...@calxeda.com
 Cc: Kukjin Kim kgene@samsung.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Thomas Gleixner t...@linutronix.de
 Cc: linux-samsung-...@vger.kernel.org
 ---
 
 I thought there may be other platforms broken in the same way, but I
 checked and exynos is the only one.
 
 This is based on my gic/vic irqchip branch in arm-soc.

Applied to next/cleanup.

I guess this answers whether anyone boots linux-next regularly on Exynos
hardware. :(


-Olof
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/