mbox

[0/4] sparse irq fixes for pxa and sa1100

Message ID 1329449534-23811-1-git-send-email-robherring2@gmail.com
State New
Headers show

Pull-request

git://sources.calxeda.com/kernel/linux.git sparse-irq-fixes

Message

Rob Herring Feb. 17, 2012, 3:32 a.m. UTC
From: Rob Herring <rob.herring@calxeda.com>

Russell,

Here's fixes for sa1100 and pxa. This is based on your for-next branch.
I've built all the boards for both, but there could be some more drivers
lurking if they aren't enabled in the defconfigs. I'm running an all
defconfig build now.

I've published the branch below if you want to pull the changes. I'm going
to be offline most of the next 4 days.

Also, I found a few other unrelated things breaking builds, but haven't done
a fix:
-xip mtd is broken on pxa.
-exynos cpufreq needs to depend on exynos.

Rob

The following changes since commit 41bc99e49cc9ab74a4f1a5083d79231fd6ea2704:

  Merge branch 'devel-stable' into for-next (2012-02-16 00:34:44 +0000)

are available in the git repository at:

  git://sources.calxeda.com/kernel/linux.git sparse-irq-fixes

Rob Herring (4):
  ARM: sa1100: fix sa1100 after sparse irq conversion
  ARM: sa1100: fix simpad compile error
  ARM: pxa: mainstone: add missing include for IRQ_BOARD_START
  rtc: sa1100: include mach/irqs.h instead of asm/irq.h

 arch/arm/mach-pxa/include/mach/mainstone.h |    2 ++
 arch/arm/mach-sa1100/assabet.c             |    2 ++
 arch/arm/mach-sa1100/badge4.c              |    1 +
 arch/arm/mach-sa1100/cerf.c                |    2 ++
 arch/arm/mach-sa1100/collie.c              |    2 ++
 arch/arm/mach-sa1100/generic.c             |    4 +++-
 arch/arm/mach-sa1100/h3100.c               |    2 ++
 arch/arm/mach-sa1100/h3600.c               |    2 ++
 arch/arm/mach-sa1100/hackkit.c             |    5 ++++-
 arch/arm/mach-sa1100/include/mach/irqs.h   |    2 +-
 arch/arm/mach-sa1100/irq.c                 |    1 +
 arch/arm/mach-sa1100/jornada720.c          |    5 ++++-
 arch/arm/mach-sa1100/lart.c                |    2 ++
 arch/arm/mach-sa1100/nanoengine.c          |    2 ++
 arch/arm/mach-sa1100/neponset.c            |    1 +
 arch/arm/mach-sa1100/pleb.c                |    1 +
 arch/arm/mach-sa1100/shannon.c             |    2 ++
 arch/arm/mach-sa1100/simpad.c              |    4 +++-
 arch/arm/mach-sa1100/ssp.c                 |    1 +
 arch/arm/mach-sa1100/time.c                |    1 +
 drivers/gpio/gpio-sa1100.c                 |    1 +
 drivers/net/ethernet/smsc/smc91x.c         |    4 ++++
 drivers/rtc/rtc-sa1100.c                   |    2 +-
 drivers/tty/serial/sa1100.c                |    1 +
 24 files changed, 46 insertions(+), 6 deletions(-)

Comments

Russell King - ARM Linux Feb. 18, 2012, 11:18 p.m. UTC | #1
On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> SA1100 was converted to sparse irq in parallel with include of mach/irqs.h
> being removed from asm/irq.h when sparse irq is enabled, resulting in lots
> of compile errors.

Can this be applied before the change to enable sparse IRQ for sa11x0
platforms without breaking them?

Thanks.
Russell King - ARM Linux Feb. 18, 2012, 11:20 p.m. UTC | #2
On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
> diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
> index 0c9a0bd..cfcaaef 100644
> --- a/arch/arm/mach-sa1100/jornada720.c
> +++ b/arch/arm/mach-sa1100/jornada720.c
> @@ -23,7 +23,6 @@
>  #include <linux/mtd/partitions.h>
>  #include <video/s1d13xxxfb.h>
>  
> -#include <mach/hardware.h>
>  #include <asm/hardware/sa1111.h>
>  #include <asm/irq.h>
>  #include <asm/page.h>
> @@ -34,6 +33,9 @@
>  #include <asm/mach/map.h>
>  #include <asm/mach/serial_sa1100.h>
>  
> +#include <mach/hardware.h>
> +#include <mach/irqs.h>

Does this still need asm/irq.h ?

> diff --git a/arch/arm/mach-sa1100/ssp.c b/arch/arm/mach-sa1100/ssp.c
> index b20ff93..1c14617 100644
> --- a/arch/arm/mach-sa1100/ssp.c
> +++ b/arch/arm/mach-sa1100/ssp.c
> @@ -21,6 +21,7 @@
>  
>  #include <asm/irq.h>
>  #include <mach/hardware.h>
> +#include <mach/irqs.h>

Ditto.

> diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c
> index ef7a21a..2ca5959 100644
> --- a/drivers/tty/serial/sa1100.c
> +++ b/drivers/tty/serial/sa1100.c
> @@ -38,6 +38,7 @@
>  
>  #include <asm/irq.h>
>  #include <mach/hardware.h>
> +#include <mach/irqs.h>

Ditto.
Rob Herring Feb. 19, 2012, 3:21 p.m. UTC | #3
On 02/18/2012 05:18 PM, Russell King - ARM Linux wrote:
> On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> SA1100 was converted to sparse irq in parallel with include of mach/irqs.h
>> being removed from asm/irq.h when sparse irq is enabled, resulting in lots
>> of compile errors.
> 
> Can this be applied before the change to enable sparse IRQ for sa11x0
> platforms without breaking them?

All but the rename of NR_IRQS to SA1100_NR_IRQS should be fine, but I
can change it to leave NR_IRQS.

Rob
Russell King - ARM Linux Feb. 19, 2012, 7:39 p.m. UTC | #4
On Sun, Feb 19, 2012 at 09:21:19AM -0600, Rob Herring wrote:
> On 02/18/2012 05:18 PM, Russell King - ARM Linux wrote:
> > On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
> >> From: Rob Herring <rob.herring@calxeda.com>
> >>
> >> SA1100 was converted to sparse irq in parallel with include of mach/irqs.h
> >> being removed from asm/irq.h when sparse irq is enabled, resulting in lots
> >> of compile errors.
> > 
> > Can this be applied before the change to enable sparse IRQ for sa11x0
> > platforms without breaking them?
> 
> All but the rename of NR_IRQS to SA1100_NR_IRQS should be fine, but I
> can change it to leave NR_IRQS.

That sounds like a good thing to have sorted and merged into my sa11x0
branch before the switching on of SPARSE_IRQ for sa11x0.
Russell King - ARM Linux Feb. 21, 2012, 1:25 p.m. UTC | #5
On Sun, Feb 19, 2012 at 09:21:19AM -0600, Rob Herring wrote:
> On 02/18/2012 05:18 PM, Russell King - ARM Linux wrote:
> > On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
> >> From: Rob Herring <rob.herring@calxeda.com>
> >>
> >> SA1100 was converted to sparse irq in parallel with include of mach/irqs.h
> >> being removed from asm/irq.h when sparse irq is enabled, resulting in lots
> >> of compile errors.
> > 
> > Can this be applied before the change to enable sparse IRQ for sa11x0
> > platforms without breaking them?
> 
> All but the rename of NR_IRQS to SA1100_NR_IRQS should be fine, but I
> can change it to leave NR_IRQS.

This isn't going to work.

If we update stuff to include mach/irqs.h, then we end up with mach/irqs.h
trying to override NR_IRQS in asm/irq.h:

#ifndef CONFIG_SPARSE_IRQ
#include <mach/irqs.h>
#else
#define NR_IRQS NR_IRQS_LEGACY
#endif

which spits out a lovely warning:

In file included from arch/arm/mach-sa1100/irq.c:20:
arch/arm/mach-sa1100/include/mach/irqs.h:86:1: warning: "NR_IRQS" redefined
In file included from arch/arm/include/asm/hardirq.h:6,
                 from include/linux/hardirq.h:7,
                 from include/linux/interrupt.h:12,
                 from arch/arm/mach-sa1100/irq.c:14:
arch/arm/include/asm/irq.h:9:1: warning: this is the location of the previous definition

There's three solutions I can think to this:

1. you need to decouple the SPARSE IRQ conversion from the removal of
   mach/irqs.h, so that there's a clean way to transition
2. I rebase the 100 odd otherwise unrelated sa11x0 patches on top of your
   stuff, which isn't going to be a nice experience.
3. I drop the final commit for this merge window to convert sa11x0 to
   sparse IRQ and the sparse IRQ conversion patch becomes quite large
   (basically meaning that all the includes have to be changed in unison
   with enabling sparse IRQ.)

(1) I think is the right solution, because it means that there's a nice
easy transition path for everyone in the future without requiring (3)
to happen every time.
Rob Herring Feb. 21, 2012, 5:02 p.m. UTC | #6
Russell,

On 02/21/2012 07:25 AM, Russell King - ARM Linux wrote:
> On Sun, Feb 19, 2012 at 09:21:19AM -0600, Rob Herring wrote:
>> On 02/18/2012 05:18 PM, Russell King - ARM Linux wrote:
>>> On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
>>>> From: Rob Herring <rob.herring@calxeda.com>
>>>>
>>>> SA1100 was converted to sparse irq in parallel with include of mach/irqs.h
>>>> being removed from asm/irq.h when sparse irq is enabled, resulting in lots
>>>> of compile errors.
>>>
>>> Can this be applied before the change to enable sparse IRQ for sa11x0
>>> platforms without breaking them?
>>
>> All but the rename of NR_IRQS to SA1100_NR_IRQS should be fine, but I
>> can change it to leave NR_IRQS.
> 
> This isn't going to work.
> 
> If we update stuff to include mach/irqs.h, then we end up with mach/irqs.h
> trying to override NR_IRQS in asm/irq.h:
> 
> #ifndef CONFIG_SPARSE_IRQ
> #include <mach/irqs.h>
> #else
> #define NR_IRQS NR_IRQS_LEGACY
> #endif
> 
> which spits out a lovely warning:
> 
> In file included from arch/arm/mach-sa1100/irq.c:20:
> arch/arm/mach-sa1100/include/mach/irqs.h:86:1: warning: "NR_IRQS" redefined
> In file included from arch/arm/include/asm/hardirq.h:6,
>                  from include/linux/hardirq.h:7,
>                  from include/linux/interrupt.h:12,
>                  from arch/arm/mach-sa1100/irq.c:14:
> arch/arm/include/asm/irq.h:9:1: warning: this is the location of the previous definition
> 

But this only occurs after you converted to SPARSE_IRQ, right? If you
add an "#ifndef NR_IRQS" to mach/irqs.h in your conversion, then
everything should be okay. Then after everything is merged, NR_IRQS can
be removed.

> There's three solutions I can think to this:
> 
> 1. you need to decouple the SPARSE IRQ conversion from the removal of
>    mach/irqs.h, so that there's a clean way to transition
> 2. I rebase the 100 odd otherwise unrelated sa11x0 patches on top of your
>    stuff, which isn't going to be a nice experience.

But the SPARSE_IRQ conversion commit is the last one on your sa11x0
branch. I'm assuming you are okay with rebasing that commit.

> 3. I drop the final commit for this merge window to convert sa11x0 to
>    sparse IRQ and the sparse IRQ conversion patch becomes quite large
>    (basically meaning that all the includes have to be changed in unison
>    with enabling sparse IRQ.)
> 
> (1) I think is the right solution, because it means that there's a nice
> easy transition path for everyone in the future without requiring (3)
> to happen every time.

Can you take a look at my branch sa11x0-sparse-irq I just pushed out.
It's based on your sa11x0 branch with just your sparse irq conversion
commit rebased. I've built it with and without the sparse irq conversion
and also merged my sparse_irq branch in without conflict and built that.

Rob
Russell King - ARM Linux Feb. 22, 2012, 10:09 p.m. UTC | #7
On Tue, Feb 21, 2012 at 11:02:39AM -0600, Rob Herring wrote:
> Russell,
> 
> On 02/21/2012 07:25 AM, Russell King - ARM Linux wrote:
> > On Sun, Feb 19, 2012 at 09:21:19AM -0600, Rob Herring wrote:
> >> On 02/18/2012 05:18 PM, Russell King - ARM Linux wrote:
> >>> On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
> >>>> From: Rob Herring <rob.herring@calxeda.com>
> >>>>
> >>>> SA1100 was converted to sparse irq in parallel with include of mach/irqs.h
> >>>> being removed from asm/irq.h when sparse irq is enabled, resulting in lots
> >>>> of compile errors.
> >>>
> >>> Can this be applied before the change to enable sparse IRQ for sa11x0
> >>> platforms without breaking them?
> >>
> >> All but the rename of NR_IRQS to SA1100_NR_IRQS should be fine, but I
> >> can change it to leave NR_IRQS.
> > 
> > This isn't going to work.
> > 
> > If we update stuff to include mach/irqs.h, then we end up with mach/irqs.h
> > trying to override NR_IRQS in asm/irq.h:
> > 
> > #ifndef CONFIG_SPARSE_IRQ
> > #include <mach/irqs.h>
> > #else
> > #define NR_IRQS NR_IRQS_LEGACY
> > #endif
> > 
> > which spits out a lovely warning:
> > 
> > In file included from arch/arm/mach-sa1100/irq.c:20:
> > arch/arm/mach-sa1100/include/mach/irqs.h:86:1: warning: "NR_IRQS" redefined
> > In file included from arch/arm/include/asm/hardirq.h:6,
> >                  from include/linux/hardirq.h:7,
> >                  from include/linux/interrupt.h:12,
> >                  from arch/arm/mach-sa1100/irq.c:14:
> > arch/arm/include/asm/irq.h:9:1: warning: this is the location of the previous definition
> > 
> 
> But this only occurs after you converted to SPARSE_IRQ, right? If you
> add an "#ifndef NR_IRQS" to mach/irqs.h in your conversion, then
> everything should be okay. Then after everything is merged, NR_IRQS can
> be removed.

Right, I was thinking about the effects of changing this stuff after the
sparse IRQ commit.  But you're right, it can be done before that.

What does need to happen is the fixing of NR_IRQS etc needs to be part
of the very same commit which enables sparse IRQ.

> Can you take a look at my branch sa11x0-sparse-irq I just pushed out.
> It's based on your sa11x0 branch with just your sparse irq conversion
> commit rebased. I've built it with and without the sparse irq conversion
> and also merged my sparse_irq branch in without conflict and built that.

I'll take your word for it, and if you want to throw the relevant commits
at the patch system, I'll merge them into the enormous sa11x0 branch. I
need to drop the asoc branch out of it before the next merge window though
as I'm not planning to push that just yet.
Russell King - ARM Linux Feb. 23, 2012, 10:11 p.m. UTC | #8
On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
> diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
> index 0dba050..0c16c0a 100644
> --- a/drivers/net/ethernet/smsc/smc91x.c
> +++ b/drivers/net/ethernet/smsc/smc91x.c
> @@ -89,6 +89,10 @@ static const char version[] =
>  
>  #include <asm/io.h>
>  
> +#if defined(CONFIG_SA1100_ASSABET)
> +#include <mach/neponset.h>
> +#endif
> +
>  #include "smc91x.h"
>  
>  #ifndef SMC_NOWAIT

Why do you need this include when smc91x.h just below does this:

#elif defined(CONFIG_SA1100_ASSABET)

#include <mach/neponset.h>

/* We can only do 8-bit reads and writes in the static memory space. */
#define SMC_CAN_USE_8BIT        1
#define SMC_CAN_USE_16BIT       0
#define SMC_CAN_USE_32BIT       0
#define SMC_NOWAIT              1

/* The first two address lines aren't connected... */
#define SMC_IO_SHIFT            2

#define SMC_inb(a, r)           readb((a) + (r))
#define SMC_outb(v, a, r)       writeb(v, (a) + (r))
#define SMC_insb(a, r, p, l)    readsb((a) + (r), p, (l))
#define SMC_outsb(a, r, p, l)   writesb((a) + (r), p, (l))
#define SMC_IRQ_FLAGS           (-1)    /* from resource */

My guess is you have PLEB enabled which overrides this definition.  Yes,
this driver is rather horrible in this regard...
Rob Herring Feb. 23, 2012, 10:24 p.m. UTC | #9
On 02/23/2012 04:11 PM, Russell King - ARM Linux wrote:
> On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
>> diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
>> index 0dba050..0c16c0a 100644
>> --- a/drivers/net/ethernet/smsc/smc91x.c
>> +++ b/drivers/net/ethernet/smsc/smc91x.c
>> @@ -89,6 +89,10 @@ static const char version[] =
>>  
>>  #include <asm/io.h>
>>  
>> +#if defined(CONFIG_SA1100_ASSABET)
>> +#include <mach/neponset.h>
>> +#endif
>> +
>>  #include "smc91x.h"
>>  
>>  #ifndef SMC_NOWAIT
> 
> Why do you need this include when smc91x.h just below does this:
> 
> #elif defined(CONFIG_SA1100_ASSABET)
> 
> #include <mach/neponset.h>
> 
> /* We can only do 8-bit reads and writes in the static memory space. */
> #define SMC_CAN_USE_8BIT        1
> #define SMC_CAN_USE_16BIT       0
> #define SMC_CAN_USE_32BIT       0
> #define SMC_NOWAIT              1
> 
> /* The first two address lines aren't connected... */
> #define SMC_IO_SHIFT            2
> 
> #define SMC_inb(a, r)           readb((a) + (r))
> #define SMC_outb(v, a, r)       writeb(v, (a) + (r))
> #define SMC_insb(a, r, p, l)    readsb((a) + (r), p, (l))
> #define SMC_outsb(a, r, p, l)   writesb((a) + (r), p, (l))
> #define SMC_IRQ_FLAGS           (-1)    /* from resource */
> 
> My guess is you have PLEB enabled which overrides this definition.  Yes,
> this driver is rather horrible in this regard...

Yes, that's right. I assumed I had broken things and neponset.h was no
longer getting implicitly included. I guess it's not really a valid
config to have both enabled if you want working networking. What do you
want to do here?

Rob
Russell King - ARM Linux Feb. 23, 2012, 10:25 p.m. UTC | #10
On Thu, Feb 23, 2012 at 04:24:07PM -0600, Rob Herring wrote:
> On 02/23/2012 04:11 PM, Russell King - ARM Linux wrote:
> > On Thu, Feb 16, 2012 at 09:32:11PM -0600, Rob Herring wrote:
> >> diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
> >> index 0dba050..0c16c0a 100644
> >> --- a/drivers/net/ethernet/smsc/smc91x.c
> >> +++ b/drivers/net/ethernet/smsc/smc91x.c
> >> @@ -89,6 +89,10 @@ static const char version[] =
> >>  
> >>  #include <asm/io.h>
> >>  
> >> +#if defined(CONFIG_SA1100_ASSABET)
> >> +#include <mach/neponset.h>
> >> +#endif
> >> +
> >>  #include "smc91x.h"
> >>  
> >>  #ifndef SMC_NOWAIT
> > 
> > Why do you need this include when smc91x.h just below does this:
> > 
> > #elif defined(CONFIG_SA1100_ASSABET)
> > 
> > #include <mach/neponset.h>
> > 
> > /* We can only do 8-bit reads and writes in the static memory space. */
> > #define SMC_CAN_USE_8BIT        1
> > #define SMC_CAN_USE_16BIT       0
> > #define SMC_CAN_USE_32BIT       0
> > #define SMC_NOWAIT              1
> > 
> > /* The first two address lines aren't connected... */
> > #define SMC_IO_SHIFT            2
> > 
> > #define SMC_inb(a, r)           readb((a) + (r))
> > #define SMC_outb(v, a, r)       writeb(v, (a) + (r))
> > #define SMC_insb(a, r, p, l)    readsb((a) + (r), p, (l))
> > #define SMC_outsb(a, r, p, l)   writesb((a) + (r), p, (l))
> > #define SMC_IRQ_FLAGS           (-1)    /* from resource */
> > 
> > My guess is you have PLEB enabled which overrides this definition.  Yes,
> > this driver is rather horrible in this regard...
> 
> Yes, that's right. I assumed I had broken things and neponset.h was no
> longer getting implicitly included. I guess it's not really a valid
> config to have both enabled if you want working networking. What do you
> want to do here?

Probably best to just drop the change to this driver - it needs fixing
properly at some point.  In the mean time, enabling both pleb and neponset
will cause grief... ;(
Russell King - ARM Linux Feb. 23, 2012, 10:53 p.m. UTC | #11
On Thu, Feb 23, 2012 at 10:25:38PM +0000, Russell King - ARM Linux wrote:
> Probably best to just drop the change to this driver - it needs fixing
> properly at some point.  In the mean time, enabling both pleb and neponset
> will cause grief... ;(

In case I wasn't clear, a replacement patch for 7342/1 without the smsc
change please.