All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build
@ 2012-06-13 12:57 Shawn Guo
  2012-06-13 13:07 ` Shawn Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shawn Guo @ 2012-06-13 12:57 UTC (permalink / raw)
  To: linux-arm-kernel

The commit a2be01b (ARM: only include mach/irqs.h for !SPARSE_IRQ)
makes mach/irqs.h only be included for !SPARSE_IRQ build.  There are
a nubmer of platforms have FIQ_START defined in mach/irqs.h.

  arch/arm/mach-at91/include/mach/irqs.h:#define FIQ_START AT91_ID_FIQ
  arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START         64
  arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START             IRQ_EINT0
  arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0
  arch/arm/plat-omap/include/plat/irqs.h:#define FIQ_START                1024

If SPARSE_IRQ is enabled for any of these platforms, the following
compile error will be seen.

  arch/arm/kernel/fiq.c: In function ?enable_fiq?:
  arch/arm/kernel/fiq.c:127:19: error: ?FIQ_START? undeclared (first use in this function)
  arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
  arch/arm/kernel/fiq.c: In function ?disable_fiq?:
  arch/arm/kernel/fiq.c:132:20: error: ?FIQ_START? undeclared (first use in this function)

So before we can remove the reference to FIQ_START in fiq.c, we need
a way out.  The patch adds a mach/fiq.h inclusion for SPARSE_IRQ build
in asm/irq.h, so that platform can have a chance to provide FIQ_START.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/include/asm/irq.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
index 35c21c3..3fa390d 100644
--- a/arch/arm/include/asm/irq.h
+++ b/arch/arm/include/asm/irq.h
@@ -7,6 +7,7 @@
 #include <mach/irqs.h>
 #else
 #define NR_IRQS NR_IRQS_LEGACY
+#include <mach/fiq.h>
 #endif
 
 #ifndef irq_canonicalize
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build
  2012-06-13 12:57 [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build Shawn Guo
@ 2012-06-13 13:07 ` Shawn Guo
  2012-06-13 13:38   ` Shawn Guo
  2012-06-13 14:34 ` Nicolas Pitre
  2012-06-13 14:36 ` Rob Herring
  2 siblings, 1 reply; 5+ messages in thread
From: Shawn Guo @ 2012-06-13 13:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 13, 2012 at 08:57:33PM +0800, Shawn Guo wrote:
> The commit a2be01b (ARM: only include mach/irqs.h for !SPARSE_IRQ)
> makes mach/irqs.h only be included for !SPARSE_IRQ build.  There are
> a nubmer of platforms have FIQ_START defined in mach/irqs.h.
> 
>   arch/arm/mach-at91/include/mach/irqs.h:#define FIQ_START AT91_ID_FIQ
>   arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START         64
>   arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START             IRQ_EINT0
>   arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0
>   arch/arm/plat-omap/include/plat/irqs.h:#define FIQ_START                1024
> 
> If SPARSE_IRQ is enabled for any of these platforms, the following
> compile error will be seen.
> 
>   arch/arm/kernel/fiq.c: In function ?enable_fiq?:
>   arch/arm/kernel/fiq.c:127:19: error: ?FIQ_START? undeclared (first use in this function)
>   arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
>   arch/arm/kernel/fiq.c: In function ?disable_fiq?:
>   arch/arm/kernel/fiq.c:132:20: error: ?FIQ_START? undeclared (first use in this function)
> 
> So before we can remove the reference to FIQ_START in fiq.c, we need
> a way out.  The patch adds a mach/fiq.h inclusion for SPARSE_IRQ build
> in asm/irq.h, so that platform can have a chance to provide FIQ_START.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  arch/arm/include/asm/irq.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
> index 35c21c3..3fa390d 100644
> --- a/arch/arm/include/asm/irq.h
> +++ b/arch/arm/include/asm/irq.h
> @@ -7,6 +7,7 @@
>  #include <mach/irqs.h>
>  #else
>  #define NR_IRQS NR_IRQS_LEGACY
> +#include <mach/fiq.h>
>  #endif
>  
Damned.  Just realized that this will break those platforms with
SPARSE_IRQ enabled but no mach/fiq.h provided.

Any sensible solution there?

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build
  2012-06-13 13:07 ` Shawn Guo
@ 2012-06-13 13:38   ` Shawn Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2012-06-13 13:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 13, 2012 at 09:07:56PM +0800, Shawn Guo wrote:
> Damned.  Just realized that this will break those platforms with
> SPARSE_IRQ enabled but no mach/fiq.h provided.
> 
What about adding #ifdef CONFIG_FIQ check for the inclusion?

--8<---

diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
index 35c21c3..8db119a 100644
--- a/arch/arm/include/asm/irq.h
+++ b/arch/arm/include/asm/irq.h
@@ -7,6 +7,9 @@
 #include <mach/irqs.h>
 #else
 #define NR_IRQS NR_IRQS_LEGACY
+#ifdef CONFIG_FIQ
+#include <mach/fiq.h>
+#endif
 #endif

 #ifndef irq_canonicalize

--->8--

Regards,
Shawn

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build
  2012-06-13 12:57 [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build Shawn Guo
  2012-06-13 13:07 ` Shawn Guo
@ 2012-06-13 14:34 ` Nicolas Pitre
  2012-06-13 14:36 ` Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Pitre @ 2012-06-13 14:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 13 Jun 2012, Shawn Guo wrote:

> The commit a2be01b (ARM: only include mach/irqs.h for !SPARSE_IRQ)
> makes mach/irqs.h only be included for !SPARSE_IRQ build.  There are
> a nubmer of platforms have FIQ_START defined in mach/irqs.h.
> 
>   arch/arm/mach-at91/include/mach/irqs.h:#define FIQ_START AT91_ID_FIQ
>   arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START         64
>   arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START             IRQ_EINT0
>   arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0
>   arch/arm/plat-omap/include/plat/irqs.h:#define FIQ_START                1024
> 
> If SPARSE_IRQ is enabled for any of these platforms, the following
> compile error will be seen.
> 
>   arch/arm/kernel/fiq.c: In function ?enable_fiq?:
>   arch/arm/kernel/fiq.c:127:19: error: ?FIQ_START? undeclared (first use in this function)
>   arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
>   arch/arm/kernel/fiq.c: In function ?disable_fiq?:
>   arch/arm/kernel/fiq.c:132:20: error: ?FIQ_START? undeclared (first use in this function)
> 
> So before we can remove the reference to FIQ_START in fiq.c, we need
> a way out.  The patch adds a mach/fiq.h inclusion for SPARSE_IRQ build
> in asm/irq.h, so that platform can have a chance to provide FIQ_START.

This is a step backward.  Please let's get rid of FIQ_START instead.
This should be removed from enable_fiq() and disable_fiq(), and the 
arguments to those functions should use the absolute IRQ number instead.  
for instance, there is FIQ_FLOPPYDATA in mach-rpc/include/mach/irqs.h 
which could be defined as 64 instead of 0, etc.


Nicolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build
  2012-06-13 12:57 [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build Shawn Guo
  2012-06-13 13:07 ` Shawn Guo
  2012-06-13 14:34 ` Nicolas Pitre
@ 2012-06-13 14:36 ` Rob Herring
  2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2012-06-13 14:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/13/2012 07:57 AM, Shawn Guo wrote:
> The commit a2be01b (ARM: only include mach/irqs.h for !SPARSE_IRQ)
> makes mach/irqs.h only be included for !SPARSE_IRQ build.  There are
> a nubmer of platforms have FIQ_START defined in mach/irqs.h.
> 
>   arch/arm/mach-at91/include/mach/irqs.h:#define FIQ_START AT91_ID_FIQ

This one doesn't appear to actually be used anywhere.

>   arch/arm/mach-rpc/include/mach/irqs.h:#define FIQ_START         64
>   arch/arm/mach-s3c24xx/include/mach/irqs.h:#define FIQ_START             IRQ_EINT0
>   arch/arm/plat-mxc/include/mach/irqs.h:#define FIQ_START 0
>   arch/arm/plat-omap/include/plat/irqs.h:#define FIQ_START                1024
> 
> If SPARSE_IRQ is enabled for any of these platforms, the following
> compile error will be seen.
> 
>   arch/arm/kernel/fiq.c: In function ?enable_fiq?:
>   arch/arm/kernel/fiq.c:127:19: error: ?FIQ_START? undeclared (first use in this function)
>   arch/arm/kernel/fiq.c:127:19: note: each undeclared identifier is reported only once for each function it appears in
>   arch/arm/kernel/fiq.c: In function ?disable_fiq?:
>   arch/arm/kernel/fiq.c:132:20: error: ?FIQ_START? undeclared (first use in this function)
> 
> So before we can remove the reference to FIQ_START in fiq.c, we need
> a way out.  The patch adds a mach/fiq.h inclusion for SPARSE_IRQ build
> in asm/irq.h, so that platform can have a chance to provide FIQ_START.

The whole point of enabling SPARSE_IRQ was to eliminate a mach include
and now this adds a new one. This is not the right solution.

I think we need to remove FIQ_START from enable_fiq/disable_fiq and make
the platforms add any private offset they need. Only rpc and imx call
enable_fiq/disable_fiq. imx offset is 0, so that leaves only rpc.

The other simple solution is make fiq_start a variable.

Rob

> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  arch/arm/include/asm/irq.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
> index 35c21c3..3fa390d 100644
> --- a/arch/arm/include/asm/irq.h
> +++ b/arch/arm/include/asm/irq.h
> @@ -7,6 +7,7 @@
>  #include <mach/irqs.h>
>  #else
>  #define NR_IRQS NR_IRQS_LEGACY
> +#include <mach/fiq.h>
>  #endif
>  
>  #ifndef irq_canonicalize

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-13 14:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13 12:57 [PATCH] ARM: irq: add a mach/fiq.h inclusion for SPARSE_IRQ build Shawn Guo
2012-06-13 13:07 ` Shawn Guo
2012-06-13 13:38   ` Shawn Guo
2012-06-13 14:34 ` Nicolas Pitre
2012-06-13 14:36 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.