From: aisheng.dong@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx
Date: Wed, 20 Jun 2012 10:23:15 +0800 [thread overview]
Message-ID: <20120620022313.GE10387@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <20120619140613.GH21951@S2101-09.ap.freescale.net>
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@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 +-
> > 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 +
> > arch/arm/plat-mxc/tzic.c | 13 +++-
> > drivers/media/video/mx1_camera.c | 1 +
> > sound/soc/fsl/imx-pcm-fiq.c | 1 +
> > 20 files changed, 168 insertions(+), 110 deletions(-)
>
> ...
>
> > static inline struct platform_device *imx_add_platform_device_dmamask(
> > const char *name, int id,
> > - const struct resource *res, unsigned int num_resources,
> > + struct resource *res, unsigned int num_resources,
> > const void *data, size_t size_data, u64 dmamask)
> > {
> > struct platform_device_info pdevinfo = {
> > @@ -28,12 +30,34 @@ static inline struct platform_device *imx_add_platform_device_dmamask(
> > .size_data = size_data,
> > .dma_mask = dmamask,
> > };
> > +
> > + int i;
> > +
> > + /* convert to linux virtual irq for driver to use */
> > + for (i = 0; i < num_resources; i++) {
> > + if (res[i].flags & IORESOURCE_IRQ) {
> > +#ifdef CONFIG_MXC_AVIC
> > + if (cpu_is_mx1() || cpu_is_mx21()
> > + || cpu_is_mx25() || cpu_is_mx27()
> > + || cpu_is_mx31() || cpu_is_mx35())
> > + res[i].start = avic_irq_find_mapping(res[i].start);
> > +#endif
> > +
> > +#ifdef CONFIG_MXC_TZIC
> > + if (cpu_is_mx50() || cpu_is_mx51() || cpu_is_mx53())
> > + res[i].start = tzic_irq_find_mapping(res[i].start);
> > +#endif
> > + WARN_ON(!res[i].start);
> > + res[i].end = res[i].start;
> > + }
> > + }
> > +
> What a "beautiful" hacking! I'm so familiar with such kind of code,
> because I have been working for long time to kill them.
>
Hmm, it's not driver code.
And i did see a lot of such code in mach-specific file.
If wrong, any other better way to distinguish the different SoCs?
> As I said, not every single imx device is added by calling
> imx_add_platform_device. And if you really want to do this conversion,
> the right place should be platform_device_add_resources(), so that no
That is a way, but i would prefer to do it in mach-specific code first
since i'm not sure if other people will also like that.
If they will, we definite could discuss on doing it in common device
structure.
> one could possibly be missed, and we do not have imx be so unique on
> this conversion. If you can do that, I would be happy to ACK it.
> But I guess you will have a "little" problem with doing that.
>
I cannot understand, can you say it clearly?
Regards
Dong Aisheng
next prev parent reply other threads:[~2012-06-20 2:23 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 5:59 [PATCH 00/16] Enable SPARSE_IRQ support for imx Shawn Guo
2012-06-14 5:59 ` Shawn Guo
2012-06-14 5:59 ` [PATCH 01/16] ARM: imx: eliminate macro IMX_GPIO_TO_IRQ() Shawn Guo
2012-06-14 7:31 ` Dong Aisheng
2012-06-14 7:39 ` Shawn Guo
2012-06-14 8:04 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 02/16] ARM: imx: eliminate macro IOMUX_TO_IRQ() Shawn Guo
2012-06-14 7:59 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 03/16] ARM: imx: eliminate macro IRQ_GPIOx() Shawn Guo
2012-06-15 9:23 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 04/16] gpio/mxc: move irq_domain_add_legacy call into gpio driver Shawn Guo
2012-06-15 9:26 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 05/16] ARM: imx: move irq_domain_add_legacy call into tzic driver Shawn Guo
2012-06-15 9:29 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 06/16] ARM: imx: move irq_domain_add_legacy call into avic driver Shawn Guo
2012-06-14 7:13 ` Shawn Guo
2012-06-15 9:30 ` Dong Aisheng
2012-07-06 6:26 ` [PATCH] ARM: imx: select IRQ_DOMAIN Uwe Kleine-König
2012-07-06 7:05 ` Shawn Guo
2012-07-06 7:07 ` Uwe Kleine-König
2012-07-06 7:12 ` Sascha Hauer
2012-07-06 7:18 ` [PATCH] ARM: imx: select USE_OF Uwe Kleine-König
2012-07-06 7:31 ` Shawn Guo
2012-07-06 7:47 ` [PATCH v2] " Uwe Kleine-König
2012-07-06 8:04 ` Shawn Guo
2012-07-06 19:15 ` Arnd Bergmann
2012-06-14 5:59 ` [PATCH 07/16] dma: ipu: remove the use of ipu_platform_data Shawn Guo
2012-06-14 10:26 ` Vinod Koul
2012-06-15 9:37 ` Dong Aisheng
2012-06-16 3:01 ` Shawn Guo
2012-06-18 8:19 ` Dong Aisheng
2012-06-18 14:02 ` Shawn Guo
2012-06-19 5:51 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 08/16] ARM: imx: leave irq_base of wm8350_platform_data uninitialized Shawn Guo
2012-06-15 12:20 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 09/16] ARM: imx: pass gpio than irq number into mxc_expio_init Shawn Guo
2012-06-15 12:21 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 10/16] ARM: imx: add a legacy irqdomain for 3ds_debugboard Shawn Guo
2012-06-15 12:22 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 11/16] ARM: imx: add a legacy irqdomain for mx31ads Shawn Guo
2012-06-18 8:20 ` Dong Aisheng
[not found] ` <1339653587-4832-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-06-14 5:59 ` [PATCH 12/16] i2c: imx: remove unneeded mach/irqs.h inclusion Shawn Guo
2012-06-14 5:59 ` Shawn Guo
[not found] ` <1339653587-4832-13-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-06-14 7:30 ` Wolfram Sang
2012-06-14 7:30 ` Wolfram Sang
2012-06-18 8:20 ` Dong Aisheng
2012-06-18 8:20 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 13/16] ARM: imx: remove unneeded mach/irq.h inclusion Shawn Guo
2012-06-18 8:21 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 14/16] tty: serial: imx: remove the use of MXC_INTERNAL_IRQS Shawn Guo
2012-06-14 5:59 ` Shawn Guo
2012-06-14 15:37 ` Greg Kroah-Hartman
2012-06-14 15:37 ` Greg Kroah-Hartman
2012-06-18 8:22 ` Dong Aisheng
2012-06-18 8:22 ` Dong Aisheng
2012-06-14 5:59 ` [PATCH 15/16] ARM: fiq: save FIQ_START by passing absolute fiq number Shawn Guo
2012-06-18 8:39 ` Dong Aisheng
2012-06-18 14:31 ` Shawn Guo
2012-06-18 16:44 ` Russell King - ARM Linux
2012-06-19 5:26 ` Shawn Guo
2012-06-20 22:55 ` Russell King - ARM Linux
2012-06-20 23:40 ` Shawn Guo
2012-06-20 23:53 ` Shawn Guo
2012-06-21 7:37 ` Russell King - ARM Linux
2012-06-21 8:50 ` Shawn Guo
2012-06-25 16:10 ` Shawn Guo
2012-06-14 5:59 ` [PATCH 16/16] ARM: imx: enable SPARSE_IRQ for imx platform Shawn Guo
2012-06-14 7:40 ` Haojian Zhuang
2012-06-14 7:55 ` Shawn Guo
2012-06-18 8:48 ` Dong Aisheng
2012-06-18 15:04 ` Shawn Guo
2012-06-19 6:16 ` Dong Aisheng
2012-06-19 6:47 ` Shawn Guo
2012-06-19 7:21 ` Dong Aisheng
2012-06-19 7:43 ` Shawn Guo
2012-06-19 13:01 ` Dong Aisheng
2012-06-19 13:19 ` [RFC PATCH 1/1] ARM: imx: enable SPARSE_IRQ for imx Dong Aisheng
2012-06-19 14:06 ` Shawn Guo
2012-06-20 2:23 ` Dong Aisheng [this message]
2012-06-20 5:40 ` Shawn Guo
2012-06-20 6:40 ` Dong Aisheng
2012-06-20 12:57 ` Shawn Guo
2012-06-20 14:45 ` Dong Aisheng
2012-06-14 8:00 ` [PATCH 00/16] Enable SPARSE_IRQ support " Sascha Hauer
2012-06-14 8:00 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120620022313.GE10387@shlinux2.ap.freescale.net \
--to=aisheng.dong@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.