Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 00/16] Enable SPARSE_IRQ support for imx

It seems that the lack of SPARSE_IRQ support becomes the last blocker
for imx being built with multi-platform.  The series is to enable
SPARSE_IRQ for imx by having all the irqchips allocate their irq_descs.
Along with the change, a legacy irqdomain is added for each of these
irqchips (except ipu_irq) to help the mapping between hardware irq and
Linux irq number, which is required by DT boot but also benefits non-DT.

Based on v3.5-rc2.  Boot tested on imx3, imx5 and imx6, and compile
tested with imx_v4_v5_defconfig.

Shawn Guo (16):
  ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
  ARM: imx: eliminate macro IOMUX_TO_IRQ()
  ARM: imx: eliminate macro IRQ_GPIOx()
  gpio/mxc: move irq_domain_add_legacy call into gpio driver
  ARM: imx: move irq_domain_add_legacy call into tzic driver
  ARM: imx: move irq_domain_add_legacy call into avic driver
  dma: ipu: remove the use of ipu_platform_data
  ARM: imx: leave irq_base of wm8350_platform_data uninitialized
  ARM: imx: pass gpio than irq number into mxc_expio_init
  ARM: imx: add a legacy irqdomain for 3ds_debugboard
  ARM: imx: add a legacy irqdomain for mx31ads
  i2c: imx: remove unneeded mach/irqs.h inclusion
  ARM: imx: remove unneeded mach/irq.h inclusion
  tty: serial: imx: remove the use of MXC_INTERNAL_IRQS
  ARM: fiq: save FIQ_START by passing absolute fiq number
  ARM: imx: enable SPARSE_IRQ for imx platform

 arch/arm/Kconfig                                |    1 +
 arch/arm/kernel/fiq.c                           |    4 +-
(Continue reading)

Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 01/16] ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()

This patch changes all the static gpio irq number assigning with
IMX_GPIO_TO_IRQ() to run-time assigning with gpio_to_irq call, and
in turn eliminates the macro IMX_GPIO_TO_IRQ().

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/mach-cpuimx35.c         |    3 ++-
 arch/arm/mach-imx/mach-cpuimx51sd.c       |    3 ++-
 arch/arm/mach-imx/mach-mx27_3ds.c         |    3 ++-
 arch/arm/mach-imx/mach-mx35_3ds.c         |    3 ++-
 arch/arm/mach-imx/mach-mx53_ard.c         |    5 +++--
 arch/arm/mach-imx/mach-vpr200.c           |    3 ++-
 arch/arm/mach-imx/mx51_efika.c            |    3 ++-
 arch/arm/plat-mxc/include/mach/hardware.h |    2 --
 8 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index c515f8e..73c4b65 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
 <at>  <at>  -72,7 +72,7  <at>  <at>  static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
 		I2C_BOARD_INFO("tsc2007", 0x48),
 		.type		= "tsc2007",
 		.platform_data	= &tsc2007_info,
-		.irq		= IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
+		/* irq number is run-time assigned */
 	},
 };

 <at>  <at>  -173,6 +173,7  <at>  <at>  static void __init eukrea_cpuimx35_init(void)
(Continue reading)

Dong Aisheng | 14 Jun 2012 09:31
Favicon

Re: [PATCH 01/16] ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()

On Thu, Jun 14, 2012 at 01:59:32PM +0800, Shawn Guo wrote:
> This patch changes all the static gpio irq number assigning with
> IMX_GPIO_TO_IRQ() to run-time assigning with gpio_to_irq call, and
> in turn eliminates the macro IMX_GPIO_TO_IRQ().
> 
Good clean up.

> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> ---
>  arch/arm/mach-imx/mach-cpuimx35.c         |    3 ++-
>  arch/arm/mach-imx/mach-cpuimx51sd.c       |    3 ++-
>  arch/arm/mach-imx/mach-mx27_3ds.c         |    3 ++-
>  arch/arm/mach-imx/mach-mx35_3ds.c         |    3 ++-
>  arch/arm/mach-imx/mach-mx53_ard.c         |    5 +++--
>  arch/arm/mach-imx/mach-vpr200.c           |    3 ++-
>  arch/arm/mach-imx/mx51_efika.c            |    3 ++-
>  arch/arm/plat-mxc/include/mach/hardware.h |    2 --
>  8 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
> index c515f8e..73c4b65 100644
> --- a/arch/arm/mach-imx/mach-cpuimx35.c
> +++ b/arch/arm/mach-imx/mach-cpuimx35.c
>  <at>  <at>  -72,7 +72,7  <at>  <at>  static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
>  		I2C_BOARD_INFO("tsc2007", 0x48),
>  		.type		= "tsc2007",
>  		.platform_data	= &tsc2007_info,
> -		.irq		= IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
> +		/* irq number is run-time assigned */
Maybe this line is not need.
(Continue reading)

Shawn Guo | 14 Jun 2012 09:39
Favicon

Re: [PATCH 01/16] ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()

On Thu, Jun 14, 2012 at 03:31:46PM +0800, Dong Aisheng wrote:
> > -		.irq		= IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
> > +		/* irq number is run-time assigned */
> Maybe this line is not need.
> 
Documentation never harms.

Regards,
Shawn
Dong Aisheng | 14 Jun 2012 10:04
Favicon

Re: [PATCH 01/16] ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()

On Thu, Jun 14, 2012 at 03:39:58PM +0800, Shawn Guo wrote:
> On Thu, Jun 14, 2012 at 03:31:46PM +0800, Dong Aisheng wrote:
> > > -		.irq		= IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
> > > +		/* irq number is run-time assigned */
> > Maybe this line is not need.
> > 
> Documentation never harms.
> 
Hmm, you may see in the patch, this comment is added in every places
where need change even in the same file, so totally we added a lot
duplicated lines.

IMHO for this common sense bits, we may not have to document it.
User can refer to common document or code.

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 12/16] i2c: imx: remove unneeded mach/irqs.h inclusion

Remove unneeded mach/irq.h inclusion from i2c-imx driver.

Signed-off-by: Shawn Guo <shawn.guo@...>
Cc: linux-i2c@...
Cc: Wolfram Sang <w.sang@...>
---
 drivers/i2c/busses/i2c-imx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 8d6b504..370031a 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
 <at>  <at>  -53,7 +53,6  <at>  <at> 
 #include <linux/of_i2c.h>
 #include <linux/pinctrl/consumer.h>

-#include <mach/irqs.h>
 #include <mach/hardware.h>
 #include <mach/i2c.h>

--

-- 
1.7.5.4

Wolfram Sang | 14 Jun 2012 09:30
Picon
Favicon

Re: [PATCH 12/16] i2c: imx: remove unneeded mach/irqs.h inclusion

On Thu, Jun 14, 2012 at 01:59:43PM +0800, Shawn Guo wrote:
> Remove unneeded mach/irq.h inclusion from i2c-imx driver.
> 
> Signed-off-by: Shawn Guo <shawn.guo@...>
> Cc: linux-i2c@...
> Cc: Wolfram Sang <w.sang@...>

Acked-by: Wolfram Sang <w.sang@...>

Thanks!

--

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Dong Aisheng | 18 Jun 2012 10:20
Favicon

Re: [PATCH 12/16] i2c: imx: remove unneeded mach/irqs.h inclusion

On Thu, Jun 14, 2012 at 01:59:43PM +0800, Shawn Guo wrote:
> Remove unneeded mach/irq.h inclusion from i2c-imx driver.
> 
> Signed-off-by: Shawn Guo <shawn.guo@...>
> Cc: linux-i2c@...
> Cc: Wolfram Sang <w.sang@...>
> ---
>  drivers/i2c/busses/i2c-imx.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
Acked-by: Dong Aisheng <dong.aisheng@...>

Regards
Dong Aisheng

Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 14/16] tty: serial: imx: remove the use of MXC_INTERNAL_IRQS

As the part of the effort to enable SPARE_IRQ for imx platform,
the macro MXC_INTERNAL_IRQS will be removed.  The imx serial driver
has a references to it for a decision on flags of request_irq call
based on rtsirq is beyond MXC_INTERNAL_IRQS.  However the searching
on imx platform code tells that rtsirq will never be beyond
MXC_INTERNAL_IRQS.  That said, the check, consequently the reference
to MXC_INTERNAL_IRQS are not needed, so remove them.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
Cc: linux-serial <at> vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh <at> linuxfoundation.org>
---
 drivers/tty/serial/imx.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 4ef7473..d5c689d6 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
 <at>  <at>  -169,7 +169,6  <at>  <at> 
 #define SERIAL_IMX_MAJOR        207
 #define MINOR_START	        16
 #define DEV_NAME		"ttymxc"
-#define MAX_INTERNAL_IRQ	MXC_INTERNAL_IRQS

 /*
  * This determines how often we check the modem status signals
 <at>  <at>  -741,10 +740,7  <at>  <at>  static int imx_startup(struct uart_port *port)

 		/* do not use RTS IRQ on IrDA */
(Continue reading)

Greg Kroah-Hartman | 14 Jun 2012 17:37
Favicon
Gravatar

Re: [PATCH 14/16] tty: serial: imx: remove the use of MXC_INTERNAL_IRQS

On Thu, Jun 14, 2012 at 01:59:45PM +0800, Shawn Guo wrote:
> As the part of the effort to enable SPARE_IRQ for imx platform,
> the macro MXC_INTERNAL_IRQS will be removed.  The imx serial driver
> has a references to it for a decision on flags of request_irq call
> based on rtsirq is beyond MXC_INTERNAL_IRQS.  However the searching
> on imx platform code tells that rtsirq will never be beyond
> MXC_INTERNAL_IRQS.  That said, the check, consequently the reference
> to MXC_INTERNAL_IRQS are not needed, so remove them.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> Cc: linux-serial <at> vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh <at> linuxfoundation.org>

Acked-by: Greg Kroah-Hartman <gregkh <at> linuxfoundation.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Dong Aisheng | 18 Jun 2012 10:22
Favicon

Re: [PATCH 14/16] tty: serial: imx: remove the use of MXC_INTERNAL_IRQS

On Thu, Jun 14, 2012 at 01:59:45PM +0800, Shawn Guo wrote:
> As the part of the effort to enable SPARE_IRQ for imx platform,
> the macro MXC_INTERNAL_IRQS will be removed.  The imx serial driver
> has a references to it for a decision on flags of request_irq call
> based on rtsirq is beyond MXC_INTERNAL_IRQS.  However the searching
> on imx platform code tells that rtsirq will never be beyond
> MXC_INTERNAL_IRQS.  That said, the check, consequently the reference
> to MXC_INTERNAL_IRQS are not needed, so remove them.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> Cc: linux-serial <at> vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh <at> linuxfoundation.org>

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 02/16] ARM: imx: eliminate macro IOMUX_TO_IRQ()

This patch changes all the static gpio irq number assigning with
IOMUX_TO_IRQ() to run-time assigning with gpio_to_irq call, and
in turn eliminates the macro IOMUX_TO_IRQ().

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/mach-armadillo5x0.c      |   12 ++++++++----
 arch/arm/mach-imx/mach-kzm_arm11_01.c      |   20 +++++++++++++++-----
 arch/arm/mach-imx/mach-mx31_3ds.c          |   13 ++++++-------
 arch/arm/mach-imx/mach-mx31ads.c           |   14 +++++++++-----
 arch/arm/mach-imx/mach-mx31lilly.c         |   10 +++++++---
 arch/arm/mach-imx/mach-mx31lite.c          |   10 +++++++---
 arch/arm/mach-imx/mach-mx31moboard.c       |    4 +++-
 arch/arm/mach-imx/mach-pcm037.c            |   18 ++++++++++++------
 arch/arm/mach-imx/mach-qong.c              |    9 +++++----
 arch/arm/mach-imx/mx31lilly-db.c           |    5 +++--
 arch/arm/mach-imx/mx31lite-db.c            |    5 +++--
 arch/arm/plat-mxc/include/mach/iomux-mx3.h |    3 ---
 12 files changed, 78 insertions(+), 45 deletions(-)

diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index c650145..f83c5c6 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
 <at>  <at>  -408,7 +408,8  <at>  <at>  static int armadillo5x0_sdhc1_init(struct device *dev,
 	gpio_direction_input(gpio_wp);

 	/* When supported the trigger type have to be BOTH */
-	ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), detect_irq,
+	ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)),
(Continue reading)

Dong Aisheng | 14 Jun 2012 09:59
Favicon

Re: [PATCH 02/16] ARM: imx: eliminate macro IOMUX_TO_IRQ()

On Thu, Jun 14, 2012 at 01:59:33PM +0800, Shawn Guo wrote:
> This patch changes all the static gpio irq number assigning with
> IOMUX_TO_IRQ()
Hmm, we have too many ways to get gpio irq number before...

> to run-time assigning with gpio_to_irq call, and
> in turn eliminates the macro IOMUX_TO_IRQ().
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 03/16] ARM: imx: eliminate macro IRQ_GPIOx()

This patch changes all the static gpio irq number assigning with
IRQ_GPIOA() ... IRQ_GPIOF() to run-time assigning with gpio_to_irq
call, and in turn eliminates these macros.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/eukrea_mbimx27-baseboard.c |    3 ++-
 arch/arm/mach-imx/mach-apf9328.c             |    6 ++++--
 arch/arm/mach-imx/mach-cpuimx27.c            |   12 ++++++++----
 arch/arm/mach-imx/mach-imx27_visstrim_m10.c  |    9 +++++----
 arch/arm/mach-imx/mach-mx21ads.c             |   16 +++++++++++-----
 arch/arm/mach-imx/mach-mx27ads.c             |   12 ++++++------
 arch/arm/mach-imx/mach-mxt_td60.c            |    6 +++---
 arch/arm/mach-imx/mach-pca100.c              |    4 ++--
 arch/arm/mach-imx/mach-pcm038.c              |    4 +++-
 arch/arm/mach-imx/mach-scb9328.c             |    6 ++++--
 arch/arm/mach-imx/pcm970-baseboard.c         |   13 +++++++------
 arch/arm/plat-mxc/include/mach/iomux-v1.h    |    7 -------
 12 files changed, 55 insertions(+), 43 deletions(-)

diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index b46cab0..fd3177f 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
 <at>  <at>  -266,7 +266,7  <at>  <at>  static struct spi_board_info __maybe_unused
 		.bus_num	= 0,
 		.chip_select	= 0,
 		.max_speed_hz	= 1500000,
-		.irq		= IRQ_GPIOD(25),
+		/* irq number is run-time assigned */
(Continue reading)

Dong Aisheng | 15 Jun 2012 11:23
Favicon

Re: [PATCH 03/16] ARM: imx: eliminate macro IRQ_GPIOx()

On Thu, Jun 14, 2012 at 01:59:34PM +0800, Shawn Guo wrote:
> This patch changes all the static gpio irq number assigning with
> IRQ_GPIOA() ... IRQ_GPIOF() to run-time assigning with gpio_to_irq
> call, and in turn eliminates these macros.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
>
Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 04/16] gpio/mxc: move irq_domain_add_legacy call into gpio driver

Move irq_domain_add_legacy call from imx*-dt.c into gpio driver and
have the gpio driver adopt irqdomain support for both DT and non-DT
boot.

With all imx platform code converted from static gpio irq number
computation to use run-time gpio_to_irq call, we can now use
irq_alloc_descs and irqdomain support to dynamically get irq_base
and have the mapping between gpio and irq number available without
using virtual_irq_start and MXC_GPIO_IRQ_START.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
Cc: Grant Likely <grant.likely <at> secretlab.ca>
---
 arch/arm/mach-imx/imx27-dt.c   |   13 ---------
 arch/arm/mach-imx/imx51-dt.c   |   12 --------
 arch/arm/mach-imx/imx53-dt.c   |   12 --------
 arch/arm/mach-imx/mach-imx6q.c |   14 ----------
 drivers/gpio/gpio-mxc.c        |   56 ++++++++++++++++++++++-----------------
 5 files changed, 32 insertions(+), 75 deletions(-)

diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index eee0cc8..c734e56 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
 <at>  <at>  -40,21 +40,8  <at>  <at>  static int __init imx27_avic_add_irq_domain(struct device_node *np,
 	return 0;
 }

-static int __init imx27_gpio_add_irq_domain(struct device_node *np,
-				struct device_node *interrupt_parent)
(Continue reading)

Dong Aisheng | 15 Jun 2012 11:26
Favicon

Re: [PATCH 04/16] gpio/mxc: move irq_domain_add_legacy call into gpio driver

On Thu, Jun 14, 2012 at 01:59:35PM +0800, Shawn Guo wrote:
> Move irq_domain_add_legacy call from imx*-dt.c into gpio driver and
> have the gpio driver adopt irqdomain support for both DT and non-DT
> boot.
> 
> With all imx platform code converted from static gpio irq number
> computation to use run-time gpio_to_irq call, we can now use
> irq_alloc_descs and irqdomain support to dynamically get irq_base
> and have the mapping between gpio and irq number available without
> using virtual_irq_start and MXC_GPIO_IRQ_START.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> Cc: Grant Likely <grant.likely <at> secretlab.ca>

Nice move.

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 05/16] ARM: imx: move irq_domain_add_legacy call into tzic driver

Move irq_domain_add_legacy call from imx5*-dt.c into tzic init function
and have the tzic driver adopt irqdomain support for both DT and non-DT
boot.

Now tzic init function calls irq_alloc_descs to get irq_base and adds
a lenacy irqdomain with the irq_base, so that the mapping between tzic
irq and Linux irq number can be handled by irqdomain.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/imx51-dt.c |   15 ---------------
 arch/arm/mach-imx/imx53-dt.c |   15 ---------------
 arch/arm/plat-mxc/tzic.c     |   28 ++++++++++++++++++++--------
 3 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index 3bdabbc..d4067fe 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
 <at>  <at>  -11,7 +11,6  <at>  <at> 
  */

 #include <linux/irq.h>
-#include <linux/irqdomain.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/machine.h>
 <at>  <at>  -45,18 +44,6  <at>  <at>  static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
 	{ /* sentinel */ }
 };
(Continue reading)

Dong Aisheng | 15 Jun 2012 11:29
Favicon

Re: [PATCH 05/16] ARM: imx: move irq_domain_add_legacy call into tzic driver

On Thu, Jun 14, 2012 at 01:59:36PM +0800, Shawn Guo wrote:
> Move irq_domain_add_legacy call from imx5*-dt.c into tzic init function
> and have the tzic driver adopt irqdomain support for both DT and non-DT
> boot.
> 
> Now tzic init function calls irq_alloc_descs to get irq_base and adds
> a lenacy irqdomain with the irq_base, so that the mapping between tzic
> irq and Linux irq number can be handled by irqdomain.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
...
>  <at>  <at>  -77,15 +80,14  <at>  <at>  static int tzic_set_irq_fiq(unsigned int irq, unsigned int type)
>  static void tzic_irq_suspend(struct irq_data *d)
>  {
>  	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
> -	int idx = gc->irq_base >> 5;
> +	int idx = d->hwirq >> 5;
Good idea to address the virt irq_base issue.

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 07/16] dma: ipu: remove the use of ipu_platform_data

The struct ipu_platform_data is used by platform code to pass
MXC_IPU_IRQ_START to ipu-core driver.  We can save it by having
ipu-core driver call irq_alloc_descs to get the irq_base.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
Cc: Vinod Koul <vinod.koul <at> intel.com>
---
 arch/arm/mach-imx/devices-imx31.h               |    4 ++--
 arch/arm/mach-imx/devices-imx35.h               |    4 ++--
 arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c  |    6 +-----
 arch/arm/mach-imx/mach-armadillo5x0.c           |    6 +-----
 arch/arm/mach-imx/mach-mx31_3ds.c               |    6 +-----
 arch/arm/mach-imx/mach-mx31moboard.c            |    6 +-----
 arch/arm/mach-imx/mach-mx35_3ds.c               |   10 +---------
 arch/arm/mach-imx/mach-pcm037.c                 |    6 +-----
 arch/arm/mach-imx/mach-pcm043.c                 |    6 +-----
 arch/arm/mach-imx/mach-vpr200.c                 |    6 +-----
 arch/arm/mach-imx/mx31lilly-db.c                |    6 +-----
 arch/arm/plat-mxc/devices/platform-ipu-core.c   |    5 ++---
 arch/arm/plat-mxc/include/mach/devices-common.h |    4 +---
 arch/arm/plat-mxc/include/mach/ipu.h            |    4 ----
 drivers/dma/ipu/ipu_idmac.c                     |    8 +++-----
 drivers/dma/ipu/ipu_irq.c                       |   14 +++++++++-----
 16 files changed, 28 insertions(+), 73 deletions(-)

diff --git a/arch/arm/mach-imx/devices-imx31.h b/arch/arm/mach-imx/devices-imx31.h
index 488e241..911c2da 100644
--- a/arch/arm/mach-imx/devices-imx31.h
+++ b/arch/arm/mach-imx/devices-imx31.h
 <at>  <at>  -42,8 +42,8  <at>  <at>  extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[];
(Continue reading)

Vinod Koul | 14 Jun 2012 12:26
Picon

Re: [PATCH 07/16] dma: ipu: remove the use of ipu_platform_data

On Thu, 2012-06-14 at 13:59 +0800, Shawn Guo wrote:
> The struct ipu_platform_data is used by platform code to pass
> MXC_IPU_IRQ_START to ipu-core driver.  We can save it by having
> ipu-core driver call irq_alloc_descs to get the irq_base.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> Cc: Vinod Koul <vinod.koul <at> intel.com>
> ---
>  arch/arm/mach-imx/devices-imx31.h               |    4 ++--
>  arch/arm/mach-imx/devices-imx35.h               |    4 ++--
>  arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c  |    6 +-----
>  arch/arm/mach-imx/mach-armadillo5x0.c           |    6 +-----
>  arch/arm/mach-imx/mach-mx31_3ds.c               |    6 +-----
>  arch/arm/mach-imx/mach-mx31moboard.c            |    6 +-----
>  arch/arm/mach-imx/mach-mx35_3ds.c               |   10 +---------
>  arch/arm/mach-imx/mach-pcm037.c                 |    6 +-----
>  arch/arm/mach-imx/mach-pcm043.c                 |    6 +-----
>  arch/arm/mach-imx/mach-vpr200.c                 |    6 +-----
>  arch/arm/mach-imx/mx31lilly-db.c                |    6 +-----
>  arch/arm/plat-mxc/devices/platform-ipu-core.c   |    5 ++---
>  arch/arm/plat-mxc/include/mach/devices-common.h |    4 +---
>  arch/arm/plat-mxc/include/mach/ipu.h            |    4 ----
>  drivers/dma/ipu/ipu_idmac.c                     |    8 +++-----
>  drivers/dma/ipu/ipu_irq.c                       |   14 +++++++++-----
for drivers/dma/ipu*
Acked by: Vinod Koul <vinod.koul <at> linux.intel.com>

>  16 files changed, 28 insertions(+), 73 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/devices-imx31.h b/arch/arm/mach-imx/devices-imx31.h
(Continue reading)

Dong Aisheng | 15 Jun 2012 11:37
Favicon

Re: [PATCH 07/16] dma: ipu: remove the use of ipu_platform_data

On Thu, Jun 14, 2012 at 01:59:38PM +0800, Shawn Guo wrote:
.......
>  <at>  <at>  -354,10 +355,12  <at>  <at>  static struct irq_chip ipu_irq_chip = {
>  /* Install the IRQ handler */
>  int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
>  {
> -	struct ipu_platform_data *pdata = dev->dev.platform_data;
> -	unsigned int irq, irq_base, i;
> +	unsigned int irq, i;
> +	int irq_base = irq_alloc_descs(-1, 0, CONFIG_MX3_IPU_IRQS,
> +				       numa_node_id());
>  
> -	irq_base = pdata->irq_base;
> +	if (irq_base < 0)
> +		return irq_base;
>  
Need not add irqdomain for this irq range?
Can we still service this irq properly without irqdomain mapping?

Regards
Dong Aisheng
Shawn Guo | 16 Jun 2012 05:01
Favicon

Re: [PATCH 07/16] dma: ipu: remove the use of ipu_platform_data

On Fri, Jun 15, 2012 at 05:37:14PM +0800, Dong Aisheng wrote:
> On Thu, Jun 14, 2012 at 01:59:38PM +0800, Shawn Guo wrote:
> .......
> >  <at>  <at>  -354,10 +355,12  <at>  <at>  static struct irq_chip ipu_irq_chip = {
> >  /* Install the IRQ handler */
> >  int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
> >  {
> > -	struct ipu_platform_data *pdata = dev->dev.platform_data;
> > -	unsigned int irq, irq_base, i;
> > +	unsigned int irq, i;
> > +	int irq_base = irq_alloc_descs(-1, 0, CONFIG_MX3_IPU_IRQS,
> > +				       numa_node_id());
> >  
> > -	irq_base = pdata->irq_base;
> > +	if (irq_base < 0)
> > +		return irq_base;
> >  
> Need not add irqdomain for this irq range?
> Can we still service this irq properly without irqdomain mapping?
> 
Yes, I think it should still work, because the driver has the mapping
management on its own,  though someday we need to replace its own
mapping with irqdomain anyway when we move the driver to device tree.

--

-- 
Regards,
Shawn
Dong Aisheng | 18 Jun 2012 10:19
Favicon

Re: [PATCH 07/16] dma: ipu: remove the use of ipu_platform_data

On Sat, Jun 16, 2012 at 11:01:08AM +0800, Shawn Guo wrote:
> On Fri, Jun 15, 2012 at 05:37:14PM +0800, Dong Aisheng wrote:
> > On Thu, Jun 14, 2012 at 01:59:38PM +0800, Shawn Guo wrote:
> > .......
> > >  <at>  <at>  -354,10 +355,12  <at>  <at>  static struct irq_chip ipu_irq_chip = {
> > >  /* Install the IRQ handler */
> > >  int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
> > >  {
> > > -	struct ipu_platform_data *pdata = dev->dev.platform_data;
> > > -	unsigned int irq, irq_base, i;
> > > +	unsigned int irq, i;
> > > +	int irq_base = irq_alloc_descs(-1, 0, CONFIG_MX3_IPU_IRQS,
> > > +				       numa_node_id());
> > >  
> > > -	irq_base = pdata->irq_base;
> > > +	if (irq_base < 0)
> > > +		return irq_base;
> > >  
> > Need not add irqdomain for this irq range?
> > Can we still service this irq properly without irqdomain mapping?
> > 
> Yes, I think it should still work, because the driver has the mapping
> management on its own,  though someday we need to replace its own
> mapping with irqdomain anyway when we move the driver to device tree.
> 
Hmm, i'm wondering it may not make too much sense to alloc_descs without
using irqdomain since the allocated irqs are all virtual irqs.
Using private mapping is not recommended.
Maybe we can do it together with this patch since irqdomain support
does not depend on device tree.
(Continue reading)

Shawn Guo | 18 Jun 2012 16:02
Favicon

Re: [PATCH 07/16] dma: ipu: remove the use of ipu_platform_data

On Mon, Jun 18, 2012 at 04:19:44PM +0800, Dong Aisheng wrote:
> Hmm, i'm wondering it may not make too much sense to alloc_descs without
> using irqdomain since the allocated irqs are all virtual irqs.

It still makes much sense, because we are killing all those static
IRQ_START definitions here, so we need to get irq_base by calling
alloc_descs anyway.

> Using private mapping is not recommended.
> Maybe we can do it together with this patch since irqdomain support
> does not depend on device tree.
> What do you think?
> 
At this point, I would be conservative on that, since I do not have
the setup to test all the IPU irq handling.

--

-- 
Regards,
Shawn
Dong Aisheng | 19 Jun 2012 07:51
Favicon

Re: [PATCH 07/16] dma: ipu: remove the use of ipu_platform_data

On Mon, Jun 18, 2012 at 10:02:23PM +0800, Shawn Guo wrote:
> On Mon, Jun 18, 2012 at 04:19:44PM +0800, Dong Aisheng wrote:
...
> > Using private mapping is not recommended.
> > Maybe we can do it together with this patch since irqdomain support
> > does not depend on device tree.
> > What do you think?
> > 
> At this point, I would be conservative on that, since I do not have
> the setup to test all the IPU irq handling.
> 
I looked into the code a bit more, it seems ipu uses its own special irq mapping
between virt irq and hw/dma_chan irq itself and the mapping is dynamically
and limited to how many CONFIG_MX3_IPU_IRQS defined.
No sure it's so suitable to convert to irqdomain.
With adding irqdomain, i wonder we may need change this mechanism a bit.

For now, i'm ok to put that work in another patch later and using the original
way first since the later patch may need to do more things, so
Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 10/16] ARM: imx: add a legacy irqdomain for 3ds_debugboard

Call irq_alloc_descs to get the irq_base for 3ds_debugboard, and add
a legacy irqdomain using the irq_base, so that the mapping between
3ds_debugboard hardware irq and Linux irq number can be dynamically
handled by irqdomain.  As the result, the use of MXC_BOARD_IRQ_START
can be completely removed from 3ds_debugboard.c.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/plat-mxc/3ds_debugboard.c |   42 +++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/plat-mxc/3ds_debugboard.c
index 3b48a08..5c10ad0 100644
--- a/arch/arm/plat-mxc/3ds_debugboard.c
+++ b/arch/arm/plat-mxc/3ds_debugboard.c
 <at>  <at>  -12,9 +12,11  <at>  <at> 

 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/module.h>
 #include <linux/smsc911x.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
 <at>  <at>  -48,26 +50,22  <at>  <at> 
 /* CPU ID and Personality ID */
 #define MCU_BOARD_ID_REG	0x68
(Continue reading)

Dong Aisheng | 15 Jun 2012 14:22
Favicon

Re: [PATCH 10/16] ARM: imx: add a legacy irqdomain for 3ds_debugboard

On Thu, Jun 14, 2012 at 01:59:41PM +0800, Shawn Guo wrote:
> Call irq_alloc_descs to get the irq_base for 3ds_debugboard, and add
> a legacy irqdomain using the irq_base, so that the mapping between
> 3ds_debugboard hardware irq and Linux irq number can be dynamically
> handled by irqdomain.  As the result, the use of MXC_BOARD_IRQ_START
> can be completely removed from 3ds_debugboard.c.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> ---
>  arch/arm/plat-mxc/3ds_debugboard.c |   42 +++++++++++++++++++++--------------
>  1 files changed, 25 insertions(+), 17 deletions(-)
> 
Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 08/16] ARM: imx: leave irq_base of wm8350_platform_data uninitialized

With commit d1738ae (mfd: Allocate wm835x irq descs dynamically) being
in the tree, there is no need to initialize irq_base field of struct
wm8350_platform_data.  Remove it to save one reference to macro
MXC_BOARD_IRQ_START.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/mach-mx31ads.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index 6f19f98..a27a854 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
 <at>  <at>  -479,7 +479,6  <at>  <at>  static int mx31_wm8350_init(struct wm8350 *wm8350)

 static struct wm8350_platform_data __initdata mx31_wm8350_pdata = {
 	.init = mx31_wm8350_init,
-	.irq_base = MXC_BOARD_IRQ_START + MXC_MAX_EXP_IO_LINES,
 };
 #endif

--

-- 
1.7.5.4
Dong Aisheng | 15 Jun 2012 14:20
Favicon

Re: [PATCH 08/16] ARM: imx: leave irq_base of wm8350_platform_data uninitialized

On Thu, Jun 14, 2012 at 01:59:39PM +0800, Shawn Guo wrote:
> With commit d1738ae (mfd: Allocate wm835x irq descs dynamically) being
> in the tree, there is no need to initialize irq_base field of struct
> wm8350_platform_data.  Remove it to save one reference to macro
> MXC_BOARD_IRQ_START.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 06/16] ARM: imx: move irq_domain_add_legacy call into avic driver

Move irq_domain_add_legacy call from imx27-dt.c into avic init function
and have the avic driver adopt irqdomain support for both DT and non-DT
boot.

Now avic init function calls irq_alloc_descs to get irq_base and adds
a lenacy irqdomain with the irq_base, so that the mapping between avic
irq and Linux irq number can be handled by irqdomain.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/imx27-dt.c |   15 ---------------
 arch/arm/plat-mxc/avic.c     |   26 +++++++++++++++++++-------
 2 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index c734e56..5142ef0 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
 <at>  <at>  -10,7 +10,6  <at>  <at> 
  */

 #include <linux/irq.h>
-#include <linux/irqdomain.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <asm/mach/arch.h>
 <at>  <at>  -33,22 +32,8  <at>  <at>  static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
 	{ /* sentinel */ }
 };

(Continue reading)

Shawn Guo | 14 Jun 2012 09:13
Favicon

Re: [PATCH 06/16] ARM: imx: move irq_domain_add_legacy call into avic driver

On Thu, Jun 14, 2012 at 01:59:37PM +0800, Shawn Guo wrote:
> Move irq_domain_add_legacy call from imx27-dt.c into avic init function
> and have the avic driver adopt irqdomain support for both DT and non-DT
> boot.
> 
> Now avic init function calls irq_alloc_descs to get irq_base and adds
> a lenacy irqdomain with the irq_base, so that the mapping between avic
> irq and Linux irq number can be handled by irqdomain.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> ---
>  arch/arm/mach-imx/imx27-dt.c |   15 ---------------
>  arch/arm/plat-mxc/avic.c     |   26 +++++++++++++++++++-------
>  2 files changed, 19 insertions(+), 22 deletions(-)
> 
The following changes should be amended.

Regards,
Shawn

--8<---

diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/plat-mxc/avic.c
index 4fe1d9b..e612cc1 100644
--- a/arch/arm/plat-mxc/avic.c
+++ b/arch/arm/plat-mxc/avic.c
 <at>  <at>  -59,9 +59,12  <at>  <at>  static u32 avic_saved_mask_reg[2];
 #ifdef CONFIG_MXC_IRQ_PRIOR
 static int avic_irq_set_priority(unsigned char irq, unsigned char prio)
 {
(Continue reading)

Dong Aisheng | 15 Jun 2012 11:30
Favicon

Re: [PATCH 06/16] ARM: imx: move irq_domain_add_legacy call into avic driver

On Thu, Jun 14, 2012 at 03:13:28PM +0800, Shawn Guo wrote:
> On Thu, Jun 14, 2012 at 01:59:37PM +0800, Shawn Guo wrote:
> > Move irq_domain_add_legacy call from imx27-dt.c into avic init function
> > and have the avic driver adopt irqdomain support for both DT and non-DT
> > boot.
> > 
> > Now avic init function calls irq_alloc_descs to get irq_base and adds
> > a lenacy irqdomain with the irq_base, so that the mapping between avic
> > irq and Linux irq number can be handled by irqdomain.
> > 
> > Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> > ---
> >  arch/arm/mach-imx/imx27-dt.c |   15 ---------------
> >  arch/arm/plat-mxc/avic.c     |   26 +++++++++++++++++++-------
> >  2 files changed, 19 insertions(+), 22 deletions(-)
> > 
> The following changes should be amended.
> 

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Uwe Kleine-König | 6 Jul 2012 08:26
Picon
Favicon
Gravatar

[PATCH] ARM: imx: select IRQ_DOMAIN

Commit

      544496a (ARM: imx: move irq_domain_add_legacy call into avic driver)

introduced unconditional calls to irq_find_mapping and
irq_domain_add_legacy, but it's still possible to have a .config without
CONFIG_IRQ_DOMAIN=y resulting in

	  CC      arch/arm/plat-mxc/avic.o
	arch/arm/plat-mxc/avic.c: In function 'avic_handle_irq':
	arch/arm/plat-mxc/avic.c:172: error: implicit declaration of function 'irq_find_mapping'
	arch/arm/plat-mxc/avic.c: In function 'mxc_init_irq':
	arch/arm/plat-mxc/avic.c:207: error: implicit declaration of function 'irq_domain_add_legacy'
	arch/arm/plat-mxc/avic.c:208: error: 'irq_domain_simple_ops' undeclared (first use in this function)
	arch/arm/plat-mxc/avic.c:208: error: (Each undeclared identifier is reported only once
	arch/arm/plat-mxc/avic.c:208: error: for each function it appears in.)
	arch/arm/plat-mxc/avic.c:208: warning: assignment makes pointer from integer without a cast
	make[3]: *** [arch/arm/plat-mxc/avic.o] Error 1
	make[2]: *** [arch/arm/plat-mxc/avic.o] Error 2
	make[1]: *** [sub-make] Error 2
	make: *** [all] Error 2

Fix that by selecting CONFIG_IRQ_DOMAIN for ARCH_MXC.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig <at> pengutronix.de>
---
 arch/arm/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
(Continue reading)

Shawn Guo | 6 Jul 2012 09:05
Favicon

Re: [PATCH] ARM: imx: select IRQ_DOMAIN

On Fri, Jul 06, 2012 at 08:26:34AM +0200, Uwe Kleine-König wrote:
> Commit
> 
>       544496a (ARM: imx: move irq_domain_add_legacy call into avic driver)
> 
> introduced unconditional calls to irq_find_mapping and
> irq_domain_add_legacy, but it's still possible to have a .config without
> CONFIG_IRQ_DOMAIN=y resulting in
> 
> 	  CC      arch/arm/plat-mxc/avic.o
> 	arch/arm/plat-mxc/avic.c: In function 'avic_handle_irq':
> 	arch/arm/plat-mxc/avic.c:172: error: implicit declaration of function 'irq_find_mapping'
> 	arch/arm/plat-mxc/avic.c: In function 'mxc_init_irq':
> 	arch/arm/plat-mxc/avic.c:207: error: implicit declaration of function 'irq_domain_add_legacy'
> 	arch/arm/plat-mxc/avic.c:208: error: 'irq_domain_simple_ops' undeclared (first use in this function)
> 	arch/arm/plat-mxc/avic.c:208: error: (Each undeclared identifier is reported only once
> 	arch/arm/plat-mxc/avic.c:208: error: for each function it appears in.)
> 	arch/arm/plat-mxc/avic.c:208: warning: assignment makes pointer from integer without a cast
> 	make[3]: *** [arch/arm/plat-mxc/avic.o] Error 1
> 	make[2]: *** [arch/arm/plat-mxc/avic.o] Error 2
> 	make[1]: *** [sub-make] Error 2
> 	make: *** [all] Error 2
> 
> Fix that by selecting CONFIG_IRQ_DOMAIN for ARCH_MXC.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig <at> pengutronix.de>
> ---
>  arch/arm/Kconfig |    1 +
>  1 file changed, 1 insertion(+)
> 
(Continue reading)

Uwe Kleine-König | 6 Jul 2012 09:07
Picon
Favicon
Gravatar

Re: [PATCH] ARM: imx: select IRQ_DOMAIN

Hello,

On Fri, Jul 06, 2012 at 03:05:01PM +0800, Shawn Guo wrote:
> On Fri, Jul 06, 2012 at 08:26:34AM +0200, Uwe Kleine-König wrote:
> > Commit
> > 
> >       544496a (ARM: imx: move irq_domain_add_legacy call into avic driver)
> > 
> > introduced unconditional calls to irq_find_mapping and
> > irq_domain_add_legacy, but it's still possible to have a .config without
> > CONFIG_IRQ_DOMAIN=y resulting in
> > 
> > 	  CC      arch/arm/plat-mxc/avic.o
> > 	arch/arm/plat-mxc/avic.c: In function 'avic_handle_irq':
> > 	arch/arm/plat-mxc/avic.c:172: error: implicit declaration of function 'irq_find_mapping'
> > 	arch/arm/plat-mxc/avic.c: In function 'mxc_init_irq':
> > 	arch/arm/plat-mxc/avic.c:207: error: implicit declaration of function 'irq_domain_add_legacy'
> > 	arch/arm/plat-mxc/avic.c:208: error: 'irq_domain_simple_ops' undeclared (first use in this function)
> > 	arch/arm/plat-mxc/avic.c:208: error: (Each undeclared identifier is reported only once
> > 	arch/arm/plat-mxc/avic.c:208: error: for each function it appears in.)
> > 	arch/arm/plat-mxc/avic.c:208: warning: assignment makes pointer from integer without a cast
> > 	make[3]: *** [arch/arm/plat-mxc/avic.o] Error 1
> > 	make[2]: *** [arch/arm/plat-mxc/avic.o] Error 2
> > 	make[1]: *** [sub-make] Error 2
> > 	make: *** [all] Error 2
> > 
> > Fix that by selecting CONFIG_IRQ_DOMAIN for ARCH_MXC.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig <at> pengutronix.de>
> > ---
(Continue reading)

Sascha Hauer | 6 Jul 2012 09:12
Picon
Favicon

Re: [PATCH] ARM: imx: select IRQ_DOMAIN

On Fri, Jul 06, 2012 at 03:05:01PM +0800, Shawn Guo wrote:
> On Fri, Jul 06, 2012 at 08:26:34AM +0200, Uwe Kleine-König wrote:
> > ---
> >  arch/arm/Kconfig |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 84449dd..38b6b90 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> >  <at>  <at>  -446,6 +446,7  <at>  <at>  config ARCH_MXC
> >  	select CLKSRC_MMIO
> >  	select GENERIC_IRQ_CHIP
> >  	select MULTI_IRQ_HANDLER
> > +	select IRQ_DOMAIN
> 
> Right, I forgot that we haven't selected USE_OF for ARCH_MXC.  Can we
> do that instead of selecting IRQ_DOMAIN, since we are on the way to
> device tree?  Selecting USE_OF will save us a lot of #ifdef CONFIG_OF
> checks later when we add device tree support into more codes.

Fine with me.

Sascha

--

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
(Continue reading)

Uwe Kleine-König | 6 Jul 2012 09:18
Picon
Favicon
Gravatar

[PATCH] ARM: imx: select USE_OF

Commit

      544496a (ARM: imx: move irq_domain_add_legacy call into avic driver)

introduced unconditional calls to irq_find_mapping and
irq_domain_add_legacy, but it's still possible to have a .config without
CONFIG_IRQ_DOMAIN=y resulting in

	  CC      arch/arm/plat-mxc/avic.o
	arch/arm/plat-mxc/avic.c: In function 'avic_handle_irq':
	arch/arm/plat-mxc/avic.c:172: error: implicit declaration of function 'irq_find_mapping'
	arch/arm/plat-mxc/avic.c: In function 'mxc_init_irq':
	arch/arm/plat-mxc/avic.c:207: error: implicit declaration of function 'irq_domain_add_legacy'
	arch/arm/plat-mxc/avic.c:208: error: 'irq_domain_simple_ops' undeclared (first use in this function)
	arch/arm/plat-mxc/avic.c:208: error: (Each undeclared identifier is reported only once
	arch/arm/plat-mxc/avic.c:208: error: for each function it appears in.)
	arch/arm/plat-mxc/avic.c:208: warning: assignment makes pointer from integer without a cast
	make[3]: *** [arch/arm/plat-mxc/avic.o] Error 1
	make[2]: *** [arch/arm/plat-mxc/avic.o] Error 2
	make[1]: *** [sub-make] Error 2
	make: *** [all] Error 2

While selecting CONFIG_IRQ_DOMAIN would be enough, USE_OF is the future
and implies CONFIG_IRQ_DOMAIN. So select USE_OF for ARCH_MXC.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig <at> pengutronix.de>
---
 arch/arm/Kconfig |    1 +
 1 file changed, 1 insertion(+)

(Continue reading)

Shawn Guo | 6 Jul 2012 09:31
Favicon

Re: [PATCH] ARM: imx: select USE_OF

On Fri, Jul 06, 2012 at 09:18:05AM +0200, Uwe Kleine-König wrote:
> Commit
> 
>       544496a (ARM: imx: move irq_domain_add_legacy call into avic driver)
> 
> introduced unconditional calls to irq_find_mapping and
> irq_domain_add_legacy, but it's still possible to have a .config without
> CONFIG_IRQ_DOMAIN=y resulting in
> 
> 	  CC      arch/arm/plat-mxc/avic.o
> 	arch/arm/plat-mxc/avic.c: In function 'avic_handle_irq':
> 	arch/arm/plat-mxc/avic.c:172: error: implicit declaration of function 'irq_find_mapping'
> 	arch/arm/plat-mxc/avic.c: In function 'mxc_init_irq':
> 	arch/arm/plat-mxc/avic.c:207: error: implicit declaration of function 'irq_domain_add_legacy'
> 	arch/arm/plat-mxc/avic.c:208: error: 'irq_domain_simple_ops' undeclared (first use in this function)
> 	arch/arm/plat-mxc/avic.c:208: error: (Each undeclared identifier is reported only once
> 	arch/arm/plat-mxc/avic.c:208: error: for each function it appears in.)
> 	arch/arm/plat-mxc/avic.c:208: warning: assignment makes pointer from integer without a cast
> 	make[3]: *** [arch/arm/plat-mxc/avic.o] Error 1
> 	make[2]: *** [arch/arm/plat-mxc/avic.o] Error 2
> 	make[1]: *** [sub-make] Error 2
> 	make: *** [all] Error 2
> 
> While selecting CONFIG_IRQ_DOMAIN would be enough, USE_OF is the future
> and implies CONFIG_IRQ_DOMAIN. So select USE_OF for ARCH_MXC.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig <at> pengutronix.de>
> ---
>  arch/arm/Kconfig |    1 +
>  1 file changed, 1 insertion(+)
(Continue reading)

Uwe Kleine-König | 6 Jul 2012 09:47
Picon
Favicon
Gravatar

[PATCH v2] ARM: imx: select USE_OF

Commit

      544496a (ARM: imx: move irq_domain_add_legacy call into avic driver)

introduced unconditional calls to irq_find_mapping and
irq_domain_add_legacy, but it's still possible to have a .config without
CONFIG_IRQ_DOMAIN=y resulting in

	  CC      arch/arm/plat-mxc/avic.o
	arch/arm/plat-mxc/avic.c: In function 'avic_handle_irq':
	arch/arm/plat-mxc/avic.c:172: error: implicit declaration of function 'irq_find_mapping'
	arch/arm/plat-mxc/avic.c: In function 'mxc_init_irq':
	arch/arm/plat-mxc/avic.c:207: error: implicit declaration of function 'irq_domain_add_legacy'
	arch/arm/plat-mxc/avic.c:208: error: 'irq_domain_simple_ops' undeclared (first use in this function)
	arch/arm/plat-mxc/avic.c:208: error: (Each undeclared identifier is reported only once
	arch/arm/plat-mxc/avic.c:208: error: for each function it appears in.)
	arch/arm/plat-mxc/avic.c:208: warning: assignment makes pointer from integer without a cast
	make[3]: *** [arch/arm/plat-mxc/avic.o] Error 1
	make[2]: *** [arch/arm/plat-mxc/avic.o] Error 2
	make[1]: *** [sub-make] Error 2
	make: *** [all] Error 2

While selecting CONFIG_IRQ_DOMAIN would be enough, USE_OF is the future
and implies CONFIG_IRQ_DOMAIN. So select USE_OF for ARCH_MXC and drop
other explicit selects that are superflous now.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig <at> pengutronix.de>
---
 arch/arm/Kconfig          |    1 +
 arch/arm/mach-imx/Kconfig |    4 ----
(Continue reading)

Shawn Guo | 6 Jul 2012 10:04
Favicon

Re: [PATCH v2] ARM: imx: select USE_OF

On Fri, Jul 06, 2012 at 09:47:20AM +0200, Uwe Kleine-König wrote:
> Commit
> 
>       544496a (ARM: imx: move irq_domain_add_legacy call into avic driver)
> 
> introduced unconditional calls to irq_find_mapping and
> irq_domain_add_legacy, but it's still possible to have a .config without
> CONFIG_IRQ_DOMAIN=y resulting in
> 
> 	  CC      arch/arm/plat-mxc/avic.o
> 	arch/arm/plat-mxc/avic.c: In function 'avic_handle_irq':
> 	arch/arm/plat-mxc/avic.c:172: error: implicit declaration of function 'irq_find_mapping'
> 	arch/arm/plat-mxc/avic.c: In function 'mxc_init_irq':
> 	arch/arm/plat-mxc/avic.c:207: error: implicit declaration of function 'irq_domain_add_legacy'
> 	arch/arm/plat-mxc/avic.c:208: error: 'irq_domain_simple_ops' undeclared (first use in this function)
> 	arch/arm/plat-mxc/avic.c:208: error: (Each undeclared identifier is reported only once
> 	arch/arm/plat-mxc/avic.c:208: error: for each function it appears in.)
> 	arch/arm/plat-mxc/avic.c:208: warning: assignment makes pointer from integer without a cast
> 	make[3]: *** [arch/arm/plat-mxc/avic.o] Error 1
> 	make[2]: *** [arch/arm/plat-mxc/avic.o] Error 2
> 	make[1]: *** [sub-make] Error 2
> 	make: *** [all] Error 2
> 
> While selecting CONFIG_IRQ_DOMAIN would be enough, USE_OF is the future
> and implies CONFIG_IRQ_DOMAIN. So select USE_OF for ARCH_MXC and drop
> other explicit selects that are superflous now.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig <at> pengutronix.de>

Applied on top of imx/sparse-irq branch.  Thanks, Uwe.
(Continue reading)

Arnd Bergmann | 6 Jul 2012 21:15
Picon
Gravatar

Re: [PATCH v2] ARM: imx: select USE_OF

On Friday 06 July 2012, Shawn Guo wrote:
> The following changes since commit 6684294d27abb24e61916871c4ecfdaccc14eb03:
> 
>   ARM: imx: Fix build error due to missing irqs.h include (2012-07-04 11:19:40 +0800)
> 
> are available in the git repository at:
>   git://git.linaro.org/people/shawnguo/linux-2.6.git imx/sparse-irq
> 

Pulled, thanks!

	Arnd
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 11/16] ARM: imx: add a legacy irqdomain for mx31ads

Call irq_alloc_descs to get the irq_base for mx31ads, and add a legacy
irqdomain using the irq_base, so that the mapping between mx31ads
hardware irq and Linux irq number can be dynamically handled by
irqdomain.  As the result, the use of MXC_BOARD_IRQ_START can be
completely removed from mach-mx31ads.c.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/mach-mx31ads.c |   48 ++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index a27a854..d37f480 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
 <at>  <at>  -21,6 +21,7  <at>  <at> 
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>

 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 <at>  <at>  -63,18 +64,17  <at>  <at> 
 #define PBC_INTMASK_SET_REG	(PBC_INTMASK_SET + PBC_BASE_ADDRESS)
 #define PBC_INTMASK_CLEAR_REG	(PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)

-#define MXC_EXP_IO_BASE		MXC_BOARD_IRQ_START
-#define MXC_IRQ_TO_EXPIO(irq)	((irq) - MXC_EXP_IO_BASE)
-
(Continue reading)

Dong Aisheng | 18 Jun 2012 10:20
Favicon

Re: [PATCH 11/16] ARM: imx: add a legacy irqdomain for mx31ads

On Thu, Jun 14, 2012 at 01:59:42PM +0800, Shawn Guo wrote:
> Call irq_alloc_descs to get the irq_base for mx31ads, and add a legacy
> irqdomain using the irq_base, so that the mapping between mx31ads
> hardware irq and Linux irq number can be dynamically handled by
> irqdomain.  As the result, the use of MXC_BOARD_IRQ_START can be
> completely removed from mach-mx31ads.c.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> ---
>  arch/arm/mach-imx/mach-mx31ads.c |   48 ++++++++++++++++++++++++-------------
>  1 files changed, 31 insertions(+), 17 deletions(-)
> 

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 13/16] ARM: imx: remove unneeded mach/irq.h inclusion

Remove unneeded mach/irq.h inclusion from imx platform code.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/mach-apf9328.c  |    1 -
 arch/arm/mach-imx/mach-mx1ads.c   |    1 -
 arch/arm/mach-imx/mach-mx27_3ds.c |    1 -
 arch/arm/mach-imx/mach-mx31lite.c |    1 -
 arch/arm/mach-imx/mach-mx35_3ds.c |    1 -
 arch/arm/mach-imx/mach-pca100.c   |    1 -
 arch/arm/mach-imx/mach-qong.c     |    1 -
 arch/arm/mach-imx/mach-scb9328.c  |    1 -
 arch/arm/mach-imx/mach-vpr200.c   |    1 -
 arch/arm/mach-imx/mm-imx1.c       |    1 -
 arch/arm/mach-imx/mm-imx21.c      |    1 -
 arch/arm/mach-imx/mm-imx25.c      |    1 -
 arch/arm/mach-imx/mm-imx27.c      |    1 -
 arch/arm/mach-imx/mm-imx3.c       |    1 -
 14 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index 5062fcb..7b99a79 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
 <at>  <at>  -27,7 +27,6  <at>  <at> 

 #include <mach/common.h>
 #include <mach/hardware.h>
-#include <mach/irqs.h>
 #include <mach/iomux-mx1.h>
(Continue reading)

Dong Aisheng | 18 Jun 2012 10:21
Favicon

Re: [PATCH 13/16] ARM: imx: remove unneeded mach/irq.h inclusion

On Thu, Jun 14, 2012 at 01:59:44PM +0800, Shawn Guo wrote:
> Remove unneeded mach/irq.h inclusion from imx platform code.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>

Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 09/16] ARM: imx: pass gpio than irq number into mxc_expio_init

Change mxc_expio_init interface a little bit to have gpio than irq
number passed in.  With the change, gpio_to_irq can be called inside
mxc_expio_init to get irq number, so that MXC_IRQ_TO_GPIO can be
removed.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/mach-imx/mach-mx27_3ds.c               |    3 +--
 arch/arm/mach-imx/mach-mx31_3ds.c               |    3 +--
 arch/arm/mach-imx/mach-mx35_3ds.c               |    4 +---
 arch/arm/mach-imx/mach-mx51_3ds.c               |    3 +--
 arch/arm/plat-mxc/3ds_debugboard.c              |    8 ++++----
 arch/arm/plat-mxc/include/mach/3ds_debugboard.h |    2 +-
 6 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 18b9bca..eeff0b6 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
 <at>  <at>  -48,7 +48,6  <at>  <at> 
 #define SD1_EN_GPIO		IMX_GPIO_NR(2, 25)
 #define OTG_PHY_RESET_GPIO	IMX_GPIO_NR(2, 23)
 #define SPI2_SS0		IMX_GPIO_NR(4, 21)
-#define EXPIO_PARENT_INT	gpio_to_irq(IMX_GPIO_NR(3, 28))
 #define PMIC_INT		IMX_GPIO_NR(3, 14)
 #define SPI1_SS0		IMX_GPIO_NR(4, 28)
 #define SD1_CD			IMX_GPIO_NR(2, 26)
 <at>  <at>  -500,7 +499,7  <at>  <at>  static void __init mx27pdk_init(void)
 	spi_register_board_info(mx27_3ds_spi_devs,
 						ARRAY_SIZE(mx27_3ds_spi_devs));
(Continue reading)

Dong Aisheng | 15 Jun 2012 14:21
Favicon

Re: [PATCH 09/16] ARM: imx: pass gpio than irq number into mxc_expio_init

On Thu, Jun 14, 2012 at 01:59:40PM +0800, Shawn Guo wrote:
> Change mxc_expio_init interface a little bit to have gpio than irq
> number passed in.  With the change, gpio_to_irq can be called inside
> mxc_expio_init to get irq number, so that MXC_IRQ_TO_GPIO can be
> removed.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
>
Acked-by: Dong Aisheng <dong.aisheng <at> linaro.org>

Regards
Dong Aisheng
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

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)

Though FIQ_START is defined in above 5 platforms, a grep on the whole
tree only reports the following users of enable_fiq/disable_fiq.

  arch/arm/mach-rpc/dma.c
  drivers/media/video/mx1_camera.c
  sound/soc/fsl/imx-pcm-fiq.c

That said, only rpc and imx are actually using enable_fiq/disable_fiq.

The patch changes enable_fiq/disable_fiq a little bit to have the
(Continue reading)

Dong Aisheng | 18 Jun 2012 10:39
Favicon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Thu, Jun 14, 2012 at 01:59:46PM +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)
> 
> Though FIQ_START is defined in above 5 platforms, a grep on the whole
> tree only reports the following users of enable_fiq/disable_fiq.
> 
>   arch/arm/mach-rpc/dma.c
>   drivers/media/video/mx1_camera.c
>   sound/soc/fsl/imx-pcm-fiq.c
> 
> That said, only rpc and imx are actually using enable_fiq/disable_fiq.
> 
(Continue reading)

Shawn Guo | 18 Jun 2012 16:31
Favicon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

Hi Russell,

Do you have any comment, or may I have your ack on this patch?

Regards,
Shawn

On Thu, Jun 14, 2012 at 01:59:46PM +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)
> 
> Though FIQ_START is defined in above 5 platforms, a grep on the whole
> tree only reports the following users of enable_fiq/disable_fiq.
(Continue reading)

Russell King - ARM Linux | 18 Jun 2012 18:44
Picon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Mon, Jun 18, 2012 at 10:31:30PM +0800, Shawn Guo wrote:
> Hi Russell,
> 
> Do you have any comment, or may I have your ack on this patch?

Yes, I haven't seen it, and now that I have I don't like it.

FIQs should be an entirely separate number space from IRQs, as we
may want to totally decouple them from the IRQ stuff (we probably
should have already done this when genirq came along.)

About the only stuff FIQs use is the enable/disable_irq as a short
cut to dealing with the mask registers.
Shawn Guo | 19 Jun 2012 07:26
Favicon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Mon, Jun 18, 2012 at 05:44:02PM +0100, Russell King - ARM Linux wrote:
> FIQs should be an entirely separate number space from IRQs, as we
> may want to totally decouple them from the IRQ stuff (we probably
> should have already done this when genirq came along.)
> 
> About the only stuff FIQs use is the enable/disable_irq as a short
> cut to dealing with the mask registers.

I do not quite understand what you are asking for, but I'm guessing it
with the patch below.  Please elaborate it a little bit more if that's
not what you are asking for.

Regards,
Shawn

--8<---

diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index c32f845..dce12fb 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
 <at>  <at>  -39,6 +39,7  <at>  <at> 
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/seq_file.h>

 #include <asm/cacheflush.h>
 <at>  <at>  -124,12 +125,20  <at>  <at>  void release_fiq(struct fiq_handler *f)
(Continue reading)

Russell King - ARM Linux | 21 Jun 2012 00:55
Picon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Tue, Jun 19, 2012 at 01:26:56PM +0800, Shawn Guo wrote:
> On Mon, Jun 18, 2012 at 05:44:02PM +0100, Russell King - ARM Linux wrote:
> > FIQs should be an entirely separate number space from IRQs, as we
> > may want to totally decouple them from the IRQ stuff (we probably
> > should have already done this when genirq came along.)
> > 
> > About the only stuff FIQs use is the enable/disable_irq as a short
> > cut to dealing with the mask registers.
> 
> I do not quite understand what you are asking for, but I'm guessing it
> with the patch below.  Please elaborate it a little bit more if that's
> not what you are asking for.

I was thinking about moving entirely away from any bits of genirq for
this.  We shouldn't really be mixing these two things together by
nabbing some of the IRQ numberspace for this.

Looking at this code, I'm thinking about taking this further, and
santising the whole thing... though that's not going to be a quick
change.
Shawn Guo | 21 Jun 2012 01:40
Favicon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Wed, Jun 20, 2012 at 11:55:20PM +0100, Russell King - ARM Linux wrote:
> On Tue, Jun 19, 2012 at 01:26:56PM +0800, Shawn Guo wrote:
> > On Mon, Jun 18, 2012 at 05:44:02PM +0100, Russell King - ARM Linux wrote:
> > > FIQs should be an entirely separate number space from IRQs, as we
> > > may want to totally decouple them from the IRQ stuff (we probably
> > > should have already done this when genirq came along.)
> > > 
> > > About the only stuff FIQs use is the enable/disable_irq as a short
> > > cut to dealing with the mask registers.
> > 
> > I do not quite understand what you are asking for, but I'm guessing it
> > with the patch below.  Please elaborate it a little bit more if that's
> > not what you are asking for.
> 
> I was thinking about moving entirely away from any bits of genirq for
> this.  We shouldn't really be mixing these two things together by
> nabbing some of the IRQ numberspace for this.
> 
> Looking at this code, I'm thinking about taking this further, and
> santising the whole thing... though that's not going to be a quick
> change.

What I'm looking for is a quick and reasonable fixing for a compile
error when SPARSE_IRQ is enabled for imx.  Can we take the original
patch as it is and defer the whole cleanup to another series?

--

-- 
Regards,
Shawn
(Continue reading)

Shawn Guo | 21 Jun 2012 01:53
Favicon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Wed, Jun 20, 2012 at 11:55:20PM +0100, Russell King - ARM Linux wrote:
> On Tue, Jun 19, 2012 at 01:26:56PM +0800, Shawn Guo wrote:
> > On Mon, Jun 18, 2012 at 05:44:02PM +0100, Russell King - ARM Linux wrote:
> > > FIQs should be an entirely separate number space from IRQs, as we
> > > may want to totally decouple them from the IRQ stuff (we probably
> > > should have already done this when genirq came along.)
> > > 
> > > About the only stuff FIQs use is the enable/disable_irq as a short
> > > cut to dealing with the mask registers.
> > 
> > I do not quite understand what you are asking for, but I'm guessing it
> > with the patch below.  Please elaborate it a little bit more if that's
> > not what you are asking for.
> 
> I was thinking about moving entirely away from any bits of genirq for
> this.  We shouldn't really be mixing these two things together by
> nabbing some of the IRQ numberspace for this.
> 
> Looking at this code, I'm thinking about taking this further, and
> santising the whole thing... though that's not going to be a quick
> change.

What I'm looking for is a quick and safe fixing for a compile error
when SPARSE_IRQ enabled for imx.  Can we take the original patch as
it is and defer the whole cleanup to another series?

--

-- 
Regards,
Shawn
(Continue reading)

Russell King - ARM Linux | 21 Jun 2012 09:37
Picon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Thu, Jun 21, 2012 at 07:53:20AM +0800, Shawn Guo wrote:
> On Wed, Jun 20, 2012 at 11:55:20PM +0100, Russell King - ARM Linux wrote:
> > On Tue, Jun 19, 2012 at 01:26:56PM +0800, Shawn Guo wrote:
> > > On Mon, Jun 18, 2012 at 05:44:02PM +0100, Russell King - ARM Linux wrote:
> > > > FIQs should be an entirely separate number space from IRQs, as we
> > > > may want to totally decouple them from the IRQ stuff (we probably
> > > > should have already done this when genirq came along.)
> > > > 
> > > > About the only stuff FIQs use is the enable/disable_irq as a short
> > > > cut to dealing with the mask registers.
> > > 
> > > I do not quite understand what you are asking for, but I'm guessing it
> > > with the patch below.  Please elaborate it a little bit more if that's
> > > not what you are asking for.
> > 
> > I was thinking about moving entirely away from any bits of genirq for
> > this.  We shouldn't really be mixing these two things together by
> > nabbing some of the IRQ numberspace for this.
> > 
> > Looking at this code, I'm thinking about taking this further, and
> > santising the whole thing... though that's not going to be a quick
> > change.
> 
> What I'm looking for is a quick and safe fixing for a compile error
> when SPARSE_IRQ enabled for imx.  Can we take the original patch as
> it is and defer the whole cleanup to another series?

No, I don't want to make FIQ numbers somehow the same as IRQ numbers,
not even "temporarily".
(Continue reading)

Shawn Guo | 21 Jun 2012 10:50
Favicon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Wed, Jun 20, 2012 at 11:55:20PM +0100, Russell King - ARM Linux wrote:
> On Tue, Jun 19, 2012 at 01:26:56PM +0800, Shawn Guo wrote:
> > On Mon, Jun 18, 2012 at 05:44:02PM +0100, Russell King - ARM Linux wrote:
> > > FIQs should be an entirely separate number space from IRQs, as we
> > > may want to totally decouple them from the IRQ stuff (we probably
> > > should have already done this when genirq came along.)
> > > 
> > > About the only stuff FIQs use is the enable/disable_irq as a short
> > > cut to dealing with the mask registers.
> > 
> > I do not quite understand what you are asking for, but I'm guessing it
> > with the patch below.  Please elaborate it a little bit more if that's
> > not what you are asking for.
> 
> I was thinking about moving entirely away from any bits of genirq for
> this.  We shouldn't really be mixing these two things together by
> nabbing some of the IRQ numberspace for this.
> 
> Looking at this code, I'm thinking about taking this further, and
> santising the whole thing... though that's not going to be a quick
> change.

Reading the comment, I still do not have any picture about how to
decouple the FIQ from IRQ numberspace.  Could you take a few minutes
to educate specifically, so that I do not have to guess what's the
best way to do that?

--

-- 
Regards,
Shawn
(Continue reading)

Shawn Guo | 25 Jun 2012 18:10
Favicon

Re: [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number

On Wed, Jun 20, 2012 at 11:55:20PM +0100, Russell King - ARM Linux wrote:
> I was thinking about moving entirely away from any bits of genirq for
> this.  We shouldn't really be mixing these two things together by
> nabbing some of the IRQ numberspace for this.
> 
> Looking at this code, I'm thinking about taking this further, and
> santising the whole thing... though that's not going to be a quick
> change.

Would you mind giving a little more hints on how this should be done
properly?  Sorry for my dumb head.

--

-- 
Regards,
Shawn
Shawn Guo | 14 Jun 2012 07:59
Favicon

[PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

As all irqchips on imx have been changed to allocate their irq_descs,
and all unneeded mach/irqs.h inclusions on imx have been cleaned up,
now it's time to select SPARSE_IRQ for imx/mxc.

The SPARSE_IRQ support forces irqs allocation starting from 16.  All
those static irq number definition for SoCs need to shift 16 to keep
non-DT boot works.

With all those static IRQ number and start definitions removed from
mach/irqs.h, the header becomes just a container of a couple of
mach-imx specific irq/fiq calls.  Since mach/irqs.h is not included
by asm/irq.h now, the users of mxc_set_irq_fiq needs to explicitly
include mach/irqs.h themselves.

Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
---
 arch/arm/Kconfig                      |    1 +
 arch/arm/plat-mxc/include/mach/irqs.h |   44 -------
 arch/arm/plat-mxc/include/mach/mx1.h  |  111 +++++++++---------
 arch/arm/plat-mxc/include/mach/mx21.h |  107 ++++++++--------
 arch/arm/plat-mxc/include/mach/mx25.h |   72 ++++++-----
 arch/arm/plat-mxc/include/mach/mx27.h |  127 ++++++++++----------
 arch/arm/plat-mxc/include/mach/mx2x.h |   87 +++++++-------
 arch/arm/plat-mxc/include/mach/mx31.h |  118 +++++++++---------
 arch/arm/plat-mxc/include/mach/mx35.h |  109 +++++++++--------
 arch/arm/plat-mxc/include/mach/mx3x.h |   77 ++++++------
 arch/arm/plat-mxc/include/mach/mx50.h |  187 ++++++++++++++--------------
 arch/arm/plat-mxc/include/mach/mx51.h |  209 ++++++++++++++++----------------
 arch/arm/plat-mxc/include/mach/mx53.h |  217 +++++++++++++++++----------------
 drivers/media/video/mx1_camera.c      |    1 +
(Continue reading)

Haojian Zhuang | 14 Jun 2012 09:40
Picon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Thu, Jun 14, 2012 at 1:59 PM, Shawn Guo <shawn.guo <at> linaro.org> wrote:
> As all irqchips on imx have been changed to allocate their irq_descs,
> and all unneeded mach/irqs.h inclusions on imx have been cleaned up,
> now it's time to select SPARSE_IRQ for imx/mxc.
>
> The SPARSE_IRQ support forces irqs allocation starting from 16.  All
> those static irq number definition for SoCs need to shift 16 to keep
> non-DT boot works.
>
Do we really need to shift 16 to keep non-DT boot works?

I think that we can allocate "new irq numbers - NR_IRQS_LEGACY" in interrupt
controller in DT mode. And we needn't shift NR_IRQS_LEGACY in non-DT mode,
since irq numbers are already specified in .nr_irqs of machine description.

Maybe you can reference code in arch/arm/mach-mm/irq.c &
arch/arm/mach-mm/brownstone.c.

Regards
Haojian
Shawn Guo | 14 Jun 2012 09:55
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Thu, Jun 14, 2012 at 03:40:09PM +0800, Haojian Zhuang wrote:
> On Thu, Jun 14, 2012 at 1:59 PM, Shawn Guo <shawn.guo <at> linaro.org> wrote:
> > As all irqchips on imx have been changed to allocate their irq_descs,
> > and all unneeded mach/irqs.h inclusions on imx have been cleaned up,
> > now it's time to select SPARSE_IRQ for imx/mxc.
> >
> > The SPARSE_IRQ support forces irqs allocation starting from 16.  All
> > those static irq number definition for SoCs need to shift 16 to keep
> > non-DT boot works.
> >
> Do we really need to shift 16 to keep non-DT boot works?
> 
Yes, for my case.

> I think that we can allocate "new irq numbers - NR_IRQS_LEGACY" in interrupt
> controller in DT mode.

In DT mode, I need to do nothing about it, because with irqdomain
support, DT core will translate the hardware irq number encoded in
device tree to Linux irq.  That said, platform_get_irq will
automatically return me Linux irq number.

> And we needn't shift NR_IRQS_LEGACY in non-DT mode,
> since irq numbers are already specified in .nr_irqs of machine description.
> 
I took a different (IMO, cleaner) approach than setting .nr_irqs in
mach_desc.  With all irqdescs dynamically allocated, I do not need
to set .nr_irqs to have irq core preallocate all these irqs.  IMO,
that's the point of SPARSE_IRQ.  To me, the .nr_irqs approach is just a
quick and dirty path to SPARSE_IRQ, but we gain nothing from that
(Continue reading)

Dong Aisheng | 18 Jun 2012 10:48
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Thu, Jun 14, 2012 at 01:59:47PM +0800, Shawn Guo wrote:
> As all irqchips on imx have been changed to allocate their irq_descs,
> and all unneeded mach/irqs.h inclusions on imx have been cleaned up,
> now it's time to select SPARSE_IRQ for imx/mxc.
> 
> The SPARSE_IRQ support forces irqs allocation starting from 16.  All
> those static irq number definition for SoCs need to shift 16 to keep
> non-DT boot works.
> 
It seems shift 16 is to get the correct linux virt irq, right?
If yes, i do not like this approach very much since it's an implicit way
based on users know how legacy irqdomain works internally.

Ideally i would see we keep the code as before that still using hw irqs
for device resource definition, but convert to linux virt irq in a standard
irqdomain map way when adding devices by calling imx_add_platform_device.

Regards
Dong Aisheng

> With all those static IRQ number and start definitions removed from
> mach/irqs.h, the header becomes just a container of a couple of
> mach-imx specific irq/fiq calls.  Since mach/irqs.h is not included
> by asm/irq.h now, the users of mxc_set_irq_fiq needs to explicitly
> include mach/irqs.h themselves.
> 
> Signed-off-by: Shawn Guo <shawn.guo <at> linaro.org>
> ---
>  arch/arm/Kconfig                      |    1 +
>  arch/arm/plat-mxc/include/mach/irqs.h |   44 -------
(Continue reading)

Shawn Guo | 18 Jun 2012 17:04
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Mon, Jun 18, 2012 at 04:48:53PM +0800, Dong Aisheng wrote:
> On Thu, Jun 14, 2012 at 01:59:47PM +0800, Shawn Guo wrote:
> > As all irqchips on imx have been changed to allocate their irq_descs,
> > and all unneeded mach/irqs.h inclusions on imx have been cleaned up,
> > now it's time to select SPARSE_IRQ for imx/mxc.
> > 
> > The SPARSE_IRQ support forces irqs allocation starting from 16.  All
> > those static irq number definition for SoCs need to shift 16 to keep
> > non-DT boot works.
> > 
> It seems shift 16 is to get the correct linux virt irq, right?
Yes.

> If yes, i do not like this approach very much since it's an implicit way
> based on users know how legacy irqdomain works internally.
> 
I do not quite follow on this.  Users do not need to know how legacy
irqdomain works internally.  They are still using those static MX*_INT_*
macros.  All they need to know is there is a 16 shift between hardware
irq and Linux irq number when they look at /proc/interrupts.

> Ideally i would see we keep the code as before that still using hw irqs
> for device resource definition, but convert to linux virt irq in a standard
> irqdomain map way when adding devices by calling imx_add_platform_device.
> 
What's the point of hiding this irq number conversion in
imx_add_platform_device?  The irq number used in resource definition
should simply just be Linux irq.  Doing what you suggest here will
only confuse users when they look at /proc/interrupts and those static
IRQ definitions.
(Continue reading)

Dong Aisheng | 19 Jun 2012 08:16
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Mon, Jun 18, 2012 at 11:04:24PM +0800, Shawn Guo wrote:
> On Mon, Jun 18, 2012 at 04:48:53PM +0800, Dong Aisheng wrote:
> > On Thu, Jun 14, 2012 at 01:59:47PM +0800, Shawn Guo wrote:
> > > As all irqchips on imx have been changed to allocate their irq_descs,
> > > and all unneeded mach/irqs.h inclusions on imx have been cleaned up,
> > > now it's time to select SPARSE_IRQ for imx/mxc.
> > > 
> > > The SPARSE_IRQ support forces irqs allocation starting from 16.  All
> > > those static irq number definition for SoCs need to shift 16 to keep
> > > non-DT boot works.
> > > 
> > It seems shift 16 is to get the correct linux virt irq, right?
> Yes.
> 
> > If yes, i do not like this approach very much since it's an implicit way
> > based on users know how legacy irqdomain works internally.
> > 
> I do not quite follow on this.  Users do not need to know how legacy
> irqdomain works internally.  They are still using those static MX*_INT_*
> macros.  All they need to know is there is a 16 shift between hardware
> irq and Linux irq number when they look at /proc/interrupts.
> 
Hmm, i mean 'users' driver onwers here.
You shift 16 because you know after irqdomain map the virt irq will be shifting 16
according current status.
It may not always correct if something changes.
For example, if more irq ranges were pre-allocated except NR_IRQS_LEGACY by
someone else or if the irq domain type is changed by the driver.
In above case, i wonder the manual shifting may not work anymore.

(Continue reading)

Shawn Guo | 19 Jun 2012 08:47
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Tue, Jun 19, 2012 at 02:16:38PM +0800, Dong Aisheng wrote:
> > > Ideally i would see we keep the code as before that still using hw irqs
> > > for device resource definition, but convert to linux virt irq in a standard
> > > irqdomain map way when adding devices by calling imx_add_platform_device.
> > > 
> > What's the point of hiding this irq number conversion in
> > imx_add_platform_device?  
> It's standard and safe way.
> 
Why do you think it's standard?  Care to show me a couple of examples
that make this conversion when adding platform device?

> > The irq number used in resource definition
> > should simply just be Linux irq.  Doing what you suggest here will
> No, it's should be hw irq.

You are simply wrong here.  Nothing more to respond on this.

--

-- 
Regards,
Shawn
Dong Aisheng | 19 Jun 2012 09:21
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Tue, Jun 19, 2012 at 02:47:44PM +0800, Shawn Guo wrote:
> On Tue, Jun 19, 2012 at 02:16:38PM +0800, Dong Aisheng wrote:
> > > > Ideally i would see we keep the code as before that still using hw irqs
> > > > for device resource definition, but convert to linux virt irq in a standard
> > > > irqdomain map way when adding devices by calling imx_add_platform_device.
> > > > 
> > > What's the point of hiding this irq number conversion in
> > > imx_add_platform_device?  
> > It's standard and safe way.
> > 
> Why do you think it's standard?
Why do you think using irq_find_mapping to get the linux virt irq is not
standard way?

> Care to show me a couple of examples
> that make this conversion when adding platform device?
> 
I did not search any example, currently it's just my idea based on my understanding
on irq domain design. Maybe i should give a patch to describe my idea,
then we can discuss on the patch.

Or did you see any example on using shift way to define device irq resource?
Then i can look at it.

> > > The irq number used in resource definition
> > > should simply just be Linux irq.  Doing what you suggest here will
> > No, it's should be hw irq.
> 
> You are simply wrong here.  Nothing more to respond on this.
>
(Continue reading)

Shawn Guo | 19 Jun 2012 09:43
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Tue, Jun 19, 2012 at 03:21:11PM +0800, Dong Aisheng wrote:
> On Tue, Jun 19, 2012 at 02:47:44PM +0800, Shawn Guo wrote:
> > On Tue, Jun 19, 2012 at 02:16:38PM +0800, Dong Aisheng wrote:
> > > > > Ideally i would see we keep the code as before that still using hw irqs
> > > > > for device resource definition, but convert to linux virt irq in a standard
> > > > > irqdomain map way when adding devices by calling imx_add_platform_device.
> > > > > 
> > > > What's the point of hiding this irq number conversion in
> > > > imx_add_platform_device?  
> > > It's standard and safe way.
> > > 
> > Why do you think it's standard?
> Why do you think using irq_find_mapping to get the linux virt irq is not
> standard way?
> 
I never said using irq_find_mapping to get the linux irq is not
standard way.  What I said is using it during adding platform_device
is nothing standard.

> > Care to show me a couple of examples
> > that make this conversion when adding platform device?
> > 
> I did not search any example, currently it's just my idea based on my understanding
> on irq domain design. Maybe i should give a patch to describe my idea,
> then we can discuss on the patch.
> 
I understand your idea, and I just do not think it's a good/right one.

> Or did you see any example on using shift way to define device irq resource?
> Then i can look at it.
(Continue reading)

Dong Aisheng | 19 Jun 2012 15:01
Favicon

Re: [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform

On Tue, Jun 19, 2012 at 03:43:00PM +0800, Shawn Guo wrote:
> On Tue, Jun 19, 2012 at 03:21:11PM +0800, Dong Aisheng wrote:
> > On Tue, Jun 19, 2012 at 02:47:44PM +0800, Shawn Guo wrote:
> > > On Tue, Jun 19, 2012 at 02:16:38PM +0800, Dong Aisheng wrote:
> > > > > > Ideally i would see we keep the code as before that still using hw irqs
> > > > > > for device resource definition, but convert to linux virt irq in a standard
> > > > > > irqdomain map way when adding devices by calling imx_add_platform_device.
> > > > > > 
> > > > > What's the point of hiding this irq number conversion in
> > > > > imx_add_platform_device?  
> > > > It's standard and safe way.
> > > > 
> > > Why do you think it's standard?
> > Why do you think using irq_find_mapping to get the linux virt irq is not
> > standard way?
> > 
> I never said using irq_find_mapping to get the linux irq is not
> standard way.  What I said is using it during adding platform_device
> is nothing standard.
> 
> > > Care to show me a couple of examples
> > > that make this conversion when adding platform device?
> > > 
> > I did not search any example, currently it's just my idea based on my understanding
> > on irq domain design. Maybe i should give a patch to describe my idea,
> > then we can discuss on the patch.
> > 
> I understand your idea, and I just do not think it's a good/right one.
> 
Can you tell the reasons?
(Continue reading)

Dong Aisheng | 19 Jun 2012 15:19
Favicon

[RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx

After adding irqdomain support for both tzic and avic irq chip,
the original defined hw irq number in <soc>.h file like mx53.h
can not be directly used by the driver anymore.
This issue can be found when enable SPARSE_IRQ because when
SPARSE_IRQ is enabled the linux virtual irq and hw irq is not the same
anymore even using legacy irqdomain after mapping.
User should always call irq_find_mapping() to get the correct linux virtual
irq number to use in driver level.

Tested on i.MX53 LOCO.

Signed-off-by: Dong Aisheng <dong.aisheng <at> linaro.org>
---
 arch/arm/Kconfig                                |    1 +
 arch/arm/mach-imx/clk-imx21.c                   |    3 +-
 arch/arm/mach-imx/clk-imx27.c                   |    3 +-
 arch/arm/mach-imx/clk-imx31.c                   |    3 +-
 arch/arm/mach-imx/clk-imx35.c                   |    6 +-
 arch/arm/mach-imx/clk-imx51-imx53.c             |    7 +-
 arch/arm/mach-imx/mm-imx1.c                     |    8 +-
 arch/arm/mach-imx/mm-imx21.c                    |   14 +++--
 arch/arm/mach-imx/mm-imx25.c                    |   15 +++--
 arch/arm/mach-imx/mm-imx27.c                    |   14 +++--
 arch/arm/mach-imx/mm-imx3.c                     |   24 +++++---
 arch/arm/mach-imx/mm-imx5.c                     |   74 +++++++++++++++++------
 arch/arm/plat-mxc/avic.c                        |   13 +++-
 arch/arm/plat-mxc/include/mach/common.h         |    3 +
 arch/arm/plat-mxc/include/mach/devices-common.h |   28 ++++++++-
 arch/arm/plat-mxc/include/mach/irqs.h           |   44 -------------
 arch/arm/plat-mxc/irq-common.h                  |    3 +
(Continue reading)

Shawn Guo | 19 Jun 2012 16:06
Favicon

Re: [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx

On Tue, Jun 19, 2012 at 09:19:53PM +0800, Dong Aisheng wrote:
> After adding irqdomain support for both tzic and avic irq chip,
> the original defined hw irq number in <soc>.h file like mx53.h
> can not be directly used by the driver anymore.
> This issue can be found when enable SPARSE_IRQ because when
> SPARSE_IRQ is enabled the linux virtual irq and hw irq is not the same
> anymore even using legacy irqdomain after mapping.
> User should always call irq_find_mapping() to get the correct linux virtual
> irq number to use in driver level.
> 
> Tested on i.MX53 LOCO.
> 
> Signed-off-by: Dong Aisheng <dong.aisheng <at> linaro.org>

NAK.

I have been keeping saying that the irq number used in resource should
always be Linux irq.  Unfortunately, you are not listening.

> ---
>  arch/arm/Kconfig                                |    1 +
>  arch/arm/mach-imx/clk-imx21.c                   |    3 +-
>  arch/arm/mach-imx/clk-imx27.c                   |    3 +-
>  arch/arm/mach-imx/clk-imx31.c                   |    3 +-
>  arch/arm/mach-imx/clk-imx35.c                   |    6 +-
>  arch/arm/mach-imx/clk-imx51-imx53.c             |    7 +-
>  arch/arm/mach-imx/mm-imx1.c                     |    8 +-
>  arch/arm/mach-imx/mm-imx21.c                    |   14 +++--
>  arch/arm/mach-imx/mm-imx25.c                    |   15 +++--
>  arch/arm/mach-imx/mm-imx27.c                    |   14 +++--
(Continue reading)

Dong Aisheng | 20 Jun 2012 04:23
Favicon

Re: [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx

On Tue, Jun 19, 2012 at 10:06:15PM +0800, Shawn Guo wrote:
> On Tue, Jun 19, 2012 at 09:19:53PM +0800, Dong Aisheng wrote:
> > After adding irqdomain support for both tzic and avic irq chip,
> > the original defined hw irq number in <soc>.h file like mx53.h
> > can not be directly used by the driver anymore.
> > This issue can be found when enable SPARSE_IRQ because when
> > SPARSE_IRQ is enabled the linux virtual irq and hw irq is not the same
> > anymore even using legacy irqdomain after mapping.
> > User should always call irq_find_mapping() to get the correct linux virtual
> > irq number to use in driver level.
> > 
> > Tested on i.MX53 LOCO.
> > 
> > Signed-off-by: Dong Aisheng <dong.aisheng <at> linaro.org>
> 
> NAK.
> 
> I have been keeping saying that the irq number used in resource should
> always be Linux irq.  Unfortunately, you are not listening.
> 
I did see what you said, but you did not go with reasons and that was not so
convinced to me
Can you explain more why you choose linux virt irq and how about the real exist
potential issues i raised before?

> > ---
> >  arch/arm/Kconfig                                |    1 +
> >  arch/arm/mach-imx/clk-imx21.c                   |    3 +-
> >  arch/arm/mach-imx/clk-imx27.c                   |    3 +-
> >  arch/arm/mach-imx/clk-imx31.c                   |    3 +-
(Continue reading)

Shawn Guo | 20 Jun 2012 07:40
Favicon

Re: [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx

On Wed, Jun 20, 2012 at 10:23:15AM +0800, Dong Aisheng wrote:
> I did see what you said, but you did not go with reasons and that was not so
> convinced to me
> Can you explain more why you choose linux virt irq and how about the real exist
> potential issues i raised before?
> 
It's not my choice.  Instead, this is how struct resource defined in
Linux.  What more reasons do you need to understand that?

I do not take the thing you raised as issues, because in the end all
these static definitions will be removed after we move over to device
tree.

> Hmm, it's not driver code.
> And i did see a lot of such code in mach-specific file.

That does not mean you are encouraged to add more.  We are trying to
remove them.

> If wrong, any other better way to distinguish the different SoCs?
> 
There are certainly better way, since we have soc specific
initialization to do all the soc specific setup.  That said, we do
not have to necessarily use all those ugly cpu_is_xxx and #ifdef.

> That is a way, but i would prefer to do it in mach-specific code first

No.  Do not make imx special on this.  We would like to use resource
definition in the way how it's defined and how everyone else use it.

(Continue reading)

Dong Aisheng | 20 Jun 2012 08:40
Favicon

Re: [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx

On Wed, Jun 20, 2012 at 01:40:17PM +0800, Shawn Guo wrote:
> On Wed, Jun 20, 2012 at 10:23:15AM +0800, Dong Aisheng wrote:
> > I did see what you said, but you did not go with reasons and that was not so
> > convinced to me
> > Can you explain more why you choose linux virt irq and how about the real exist
> > potential issues i raised before?
> > 
> It's not my choice.  Instead, this is how struct resource defined in
> Linux.  What more reasons do you need to understand that?
> 
It's not about how struct resource defined.
It's about why you directly define linux irq for device rather than
using standard api irq_find_mapping to get the correct linux virt irq
for device after using irqdomain.

> I do not take the thing you raised as issues, because in the end all
> these static definitions will be removed after we move over to device
> tree.
So you agree they're issues for non-dt?
IMHO moving to dt is not an excuse to do wrong things for non-dt.

> 
> > Hmm, it's not driver code.
> > And i did see a lot of such code in mach-specific file.
> 
> That does not mean you are encouraged to add more.  We are trying to
> remove them.
> 
> > If wrong, any other better way to distinguish the different SoCs?
> > 
(Continue reading)

Shawn Guo | 20 Jun 2012 14:57
Favicon

Re: [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx

The conversation becomes really tedious.  I promise this is my last
round reply to this.  In any case, what you proposed here is nothing
imx specific.  If you want to go this way, please have it supported
at driver core level.

On Wed, Jun 20, 2012 at 02:40:00PM +0800, Dong Aisheng wrote:
> It's not about how struct resource defined.
> It's about why you directly define linux irq for device rather than
> using standard api irq_find_mapping to get the correct linux virt irq
> for device after using irqdomain.
> 
It's all about that the irq in resource is defined as Linux irq.
Whether you like it or not, that's a fact of Linux today.  I do not
think I can repeat myself any more.

> So you agree they're issues for non-dt?

No, not at all, because:

* non-DT should always use legacy domain.

  http://thread.gmane.org/gmane.linux.ports.arm.kernel/151860/focus=152072

* The SoC internal IRQs will always be allocated right after the
  preallocated ones.

So the only thing that could impact those Linux irq numbering is the
irqs preallocated by irq core.  I do not see why that preallocated
number need to change from time to time.  The bottom line is that
all those Linux irqs are not open-coded but macros, which can be
(Continue reading)

Dong Aisheng | 20 Jun 2012 16:45
Favicon

Re: [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx

On Wed, Jun 20, 2012 at 08:57:21PM +0800, Shawn Guo wrote:
> The conversation becomes really tedious.  I promise this is my last
> round reply to this.  In any case, what you proposed here is nothing
> imx specific.  If you want to go this way, please have it supported
> at driver core level.
> 
Anyway, i appreciate to your replies on my questions.
I will consider support in driver core level.

> On Wed, Jun 20, 2012 at 02:40:00PM +0800, Dong Aisheng wrote:
> > It's not about how struct resource defined.
> > It's about why you directly define linux irq for device rather than
> > using standard api irq_find_mapping to get the correct linux virt irq
> > for device after using irqdomain.
> > 
> It's all about that the irq in resource is defined as Linux irq.
> Whether you like it or not, that's a fact of Linux today.  I do not
> think I can repeat myself any more.
> 
I'm afraid you're missing my point.
I never said the irq in resource shouldn't be defined as linux irq.
My point is that irq number should be get via standard irqdomain api
rather than directly defining it yourself.

> > So you agree they're issues for non-dt?
> 
> No, not at all, because:
> 
> * non-DT should always use legacy domain.
> 
(Continue reading)

Sascha Hauer | 14 Jun 2012 10:00
Picon
Favicon

Re: [PATCH 00/16] Enable SPARSE_IRQ support for imx

On Thu, Jun 14, 2012 at 01:59:31PM +0800, Shawn Guo wrote:
> It seems that the lack of SPARSE_IRQ support becomes the last blocker
> for imx being built with multi-platform.  The series is to enable
> SPARSE_IRQ for imx by having all the irqchips allocate their irq_descs.
> Along with the change, a legacy irqdomain is added for each of these
> irqchips (except ipu_irq) to help the mapping between hardware irq and
> Linux irq number, which is required by DT boot but also benefits non-DT.
> 
> Based on v3.5-rc2.  Boot tested on imx3, imx5 and imx6, and compile
> tested with imx_v4_v5_defconfig.

I gave it a test on i.MX1 and i.MX27, so

Tested-by: Sascha Hauer <s.hauer <at> pengutronix.de>

Also, nice move ;)

Acked-by: Sascha Hauer <s.hauer <at> pengutronix.de>

Sascha

> 
> Shawn Guo (16):
>   ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
>   ARM: imx: eliminate macro IOMUX_TO_IRQ()
>   ARM: imx: eliminate macro IRQ_GPIOx()
>   gpio/mxc: move irq_domain_add_legacy call into gpio driver
>   ARM: imx: move irq_domain_add_legacy call into tzic driver
>   ARM: imx: move irq_domain_add_legacy call into avic driver
>   dma: ipu: remove the use of ipu_platform_data
(Continue reading)


Gmane