From: Thierry Reding <thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
To: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "Tony Lindgren" <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
"Catalin Marinas" <catalin.marinas-5wv7dgnIgG8@public.gmane.org>,
"Daniel Walker" <dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org>,
"Russell King" <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
"Uwe Kleine-König"
<u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
"David Brown" <davidb-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"open list:ARM/QUALCOMM MSM..."
<linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
"Rob Herring"
<rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
"Barry Song" <baohua.song-kQvG35nSl+M@public.gmane.org>,
"Thomas Gleixner" <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
"open list:OMAP SUPPORT"
<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Andrew Victor" <linux-PelNFVqkFnVyf+4FbqDuWQ@public.gmane.org>,
"open list:ARM/ATMEL AT91RM9..."
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"open list"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Bryan Huntsman" <bryanh-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
"Richard Zhao"
<richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
"Sascha Hauer" <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
"David Woodhouse" <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Subject: Re: [PATCH] irqdomain: Initialize number of IRQs for simple domains
Date: Sat, 7 Jan 2012 12:47:01 +0100 [thread overview]
Message-ID: <20120107114701.GA3698@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <20120107055817.GG4790-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2822 bytes --]
* Shawn Guo wrote:
> On Fri, Jan 06, 2012 at 03:28:25PM +0100, Thierry Reding wrote:
[...]
> > diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> > index c257281..9ed7812 100644
> > --- a/arch/arm/mach-imx/mach-imx6q.c
> > +++ b/arch/arm/mach-imx/mach-imx6q.c
> > @@ -95,9 +95,11 @@ static int __init imx6q_gpio_add_irq_domain(struct device_node *np,
> > struct device_node *interrupt_parent)
> > {
> > static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
> > + struct irq_domain *domain;
> >
> > gpio_irq_base -= 32;
> > - irq_domain_add_simple(np, gpio_irq_base);
> > + domain = irq_domain_add_simple(np, gpio_irq_base, 32);
> > + WARN_ON(IS_ERR(domain));
>
> Why do we handle the error in a different pattern that is used for
> all above?
Because I wasn't paying attention =) It should be returning an error of
course. With the changes that Grant requested, domain will be NULL on error
and I guess returning -ENOMEM would be fine here (and in the above hunks).
It is of course different behaviour because the code would previously
continue execution and ignore the error, but I guess that's okay since
without the IRQ domain being registered the board will not work properly
anyway.
> I just made a small change on top of yours. Can you please consider
> to amend it to your patch if it looks sane to you?
>
> diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
> index 2fda5aa..70376e0 100644
> --- a/arch/arm/plat-mxc/include/mach/irqs.h
> +++ b/arch/arm/plat-mxc/include/mach/irqs.h
> @@ -13,19 +13,20 @@
>
> #include <asm-generic/gpio.h>
>
> +#define GIC_NUM_IRQS 160
> +#define TZIC_NUM_IRQS 128
> +#define AVIC_NUM_IRQS 64
> +
> /*
> - * SoCs with GIC interrupt controller have 160 IRQs, those with TZIC
> - * have 128 IRQs, and those with AVIC have 64.
> - *
> * To support single image, the biggest number should be defined on
> * top of the list.
> */
> #if defined CONFIG_ARM_GIC
> -#define MXC_INTERNAL_IRQS 160
> +#define MXC_INTERNAL_IRQS GIC_NUM_IRQS
> #elif defined CONFIG_MXC_TZIC
> -#define MXC_INTERNAL_IRQS 128
> +#define MXC_INTERNAL_IRQS TZIC_NUM_IRQS
> #else
> -#define MXC_INTERNAL_IRQS 64
> +#define MXC_INTERNAL_IRQS AVIC_NUM_IRQS
> #endif
>
> #define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS
> @@ -54,7 +55,6 @@
> /* REVISIT: Add IPU irqs on IMX51 */
>
> #define NR_IRQS (MXC_IPU_IRQ_START + MX3_IPU_IRQS)
> -#define TZIC_NUM_IRQS 128
>
> extern int imx_irq_set_priority(unsigned char irq, unsigned char prio);
>
Looks good. I'll add it to the patch along with the other requested changes.
Thanks,
Thierry
[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
WARNING: multiple messages have this Message-ID (diff)
From: thierry.reding@avionic-design.de (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] irqdomain: Initialize number of IRQs for simple domains
Date: Sat, 7 Jan 2012 12:47:01 +0100 [thread overview]
Message-ID: <20120107114701.GA3698@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <20120107055817.GG4790@S2101-09.ap.freescale.net>
* Shawn Guo wrote:
> On Fri, Jan 06, 2012 at 03:28:25PM +0100, Thierry Reding wrote:
[...]
> > diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> > index c257281..9ed7812 100644
> > --- a/arch/arm/mach-imx/mach-imx6q.c
> > +++ b/arch/arm/mach-imx/mach-imx6q.c
> > @@ -95,9 +95,11 @@ static int __init imx6q_gpio_add_irq_domain(struct device_node *np,
> > struct device_node *interrupt_parent)
> > {
> > static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
> > + struct irq_domain *domain;
> >
> > gpio_irq_base -= 32;
> > - irq_domain_add_simple(np, gpio_irq_base);
> > + domain = irq_domain_add_simple(np, gpio_irq_base, 32);
> > + WARN_ON(IS_ERR(domain));
>
> Why do we handle the error in a different pattern that is used for
> all above?
Because I wasn't paying attention =) It should be returning an error of
course. With the changes that Grant requested, domain will be NULL on error
and I guess returning -ENOMEM would be fine here (and in the above hunks).
It is of course different behaviour because the code would previously
continue execution and ignore the error, but I guess that's okay since
without the IRQ domain being registered the board will not work properly
anyway.
> I just made a small change on top of yours. Can you please consider
> to amend it to your patch if it looks sane to you?
>
> diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
> index 2fda5aa..70376e0 100644
> --- a/arch/arm/plat-mxc/include/mach/irqs.h
> +++ b/arch/arm/plat-mxc/include/mach/irqs.h
> @@ -13,19 +13,20 @@
>
> #include <asm-generic/gpio.h>
>
> +#define GIC_NUM_IRQS 160
> +#define TZIC_NUM_IRQS 128
> +#define AVIC_NUM_IRQS 64
> +
> /*
> - * SoCs with GIC interrupt controller have 160 IRQs, those with TZIC
> - * have 128 IRQs, and those with AVIC have 64.
> - *
> * To support single image, the biggest number should be defined on
> * top of the list.
> */
> #if defined CONFIG_ARM_GIC
> -#define MXC_INTERNAL_IRQS 160
> +#define MXC_INTERNAL_IRQS GIC_NUM_IRQS
> #elif defined CONFIG_MXC_TZIC
> -#define MXC_INTERNAL_IRQS 128
> +#define MXC_INTERNAL_IRQS TZIC_NUM_IRQS
> #else
> -#define MXC_INTERNAL_IRQS 64
> +#define MXC_INTERNAL_IRQS AVIC_NUM_IRQS
> #endif
>
> #define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS
> @@ -54,7 +55,6 @@
> /* REVISIT: Add IPU irqs on IMX51 */
>
> #define NR_IRQS (MXC_IPU_IRQ_START + MX3_IPU_IRQS)
> -#define TZIC_NUM_IRQS 128
>
> extern int imx_irq_set_priority(unsigned char irq, unsigned char prio);
>
Looks good. I'll add it to the patch along with the other requested changes.
Thanks,
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120107/e9cc369f/attachment-0001.sig>
next prev parent reply other threads:[~2012-01-07 11:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 14:28 [PATCH] irqdomain: Initialize number of IRQs for simple domains Thierry Reding
2012-01-06 14:28 ` Thierry Reding
2012-01-06 16:07 ` David Brown
2012-01-06 16:07 ` David Brown
[not found] ` <20120106160744.GA7687-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2012-01-06 16:12 ` Thierry Reding
2012-01-06 16:12 ` Thierry Reding
2012-01-06 16:26 ` Rob Herring
2012-01-06 16:26 ` Rob Herring
[not found] ` <4F0720A9.8070400-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-01-06 18:52 ` David Brown
2012-01-06 18:52 ` David Brown
[not found] ` <1325860112-22051-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-01-06 14:36 ` Nicolas Ferre
2012-01-06 14:36 ` Nicolas Ferre
2012-01-06 15:04 ` Grant Likely
2012-01-06 15:04 ` Grant Likely
2012-01-06 16:20 ` Thierry Reding
2012-01-06 16:20 ` Thierry Reding
[not found] ` <20120106162016.GB5593-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-01-06 21:34 ` Grant Likely
2012-01-06 21:34 ` Grant Likely
[not found] ` <20120106213422.GF7457-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-07 11:40 ` Thierry Reding
2012-01-07 11:40 ` Thierry Reding
2012-01-06 16:58 ` Cousson, Benoit
2012-01-06 16:58 ` Cousson, Benoit
2012-01-06 16:58 ` Cousson, Benoit
2012-01-09 9:03 ` Thierry Reding
2012-01-09 9:03 ` Thierry Reding
2012-01-09 9:03 ` Thierry Reding
2012-01-07 5:58 ` Shawn Guo
2012-01-07 5:58 ` Shawn Guo
[not found] ` <20120107055817.GG4790-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-01-07 11:47 ` Thierry Reding [this message]
2012-01-07 11:47 ` Thierry Reding
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=20120107114701.GA3698@avionic-0098.mockup.avionic-design.de \
--to=thierry.reding-rm9k5ik7kjkj5m59nbduvrnah6klmebb@public.gmane.org \
--cc=baohua.song-kQvG35nSl+M@public.gmane.org \
--cc=bryanh-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
--cc=davidb-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-PelNFVqkFnVyf+4FbqDuWQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
--cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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.