* [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in Feature Reporting Register
@ 2008-05-21 20:59 Kumar Gala
2008-05-21 21:01 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2008-05-21 20:59 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
Some chips (like the SoCs from Freescale) report the wrong value in NIRQ
and this causes issues if its doesn't match or exceed the value of
irq_count.
Add a flag that board code can set to just use irq_count instead of
FRR[NIRQ]. Eventually we'll add a device tree property with the number
of sources.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
Screw up with git on the first version.
- k
arch/powerpc/sysdev/mpic.c | 9 ++++++---
include/asm-powerpc/mpic.h | 2 ++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 8619f2a..12e285d 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1144,9 +1144,12 @@ struct mpic * __init mpic_alloc(struct device_node *node,
mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
>> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
if (isu_size == 0)
- mpic->num_sources =
- ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
- >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
+ if (flags & MPIC_BROKEN_FRR_NIRQS)
+ mpic->num_sources = mpic->irq_count;
+ else
+ mpic->num_sources =
+ ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
+ >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
/* Map the per-CPU registers */
for (i = 0; i < mpic->num_cpus; i++) {
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index 943c5a3..6802570 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -353,6 +353,8 @@ struct mpic
#define MPIC_ENABLE_MCK 0x00000200
/* Disable bias among target selection, spread interrupts evenly */
#define MPIC_NO_BIAS 0x00000400
+/* Ignore NIRQS as reported by FRR */
+#define MPIC_BROKEN_FRR_NIRQS 0x00000800
/* MPIC HW modification ID */
#define MPIC_REGSET_MASK 0xf0000000
--
1.5.4.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in Feature Reporting Register
2008-05-21 20:59 [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in Feature Reporting Register Kumar Gala
@ 2008-05-21 21:01 ` Benjamin Herrenschmidt
2008-05-23 2:15 ` [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in FeatureReporting Register Jin Zhengxiong
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-05-21 21:01 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
On Wed, 2008-05-21 at 15:59 -0500, Kumar Gala wrote:
> Some chips (like the SoCs from Freescale) report the wrong value in NIRQ
> and this causes issues if its doesn't match or exceed the value of
> irq_count.
>
> Add a flag that board code can set to just use irq_count instead of
> FRR[NIRQ]. Eventually we'll add a device tree property with the number
> of sources.
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> Screw up with git on the first version.
>
> - k
>
> arch/powerpc/sysdev/mpic.c | 9 ++++++---
> include/asm-powerpc/mpic.h | 2 ++
> 2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index 8619f2a..12e285d 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -1144,9 +1144,12 @@ struct mpic * __init mpic_alloc(struct device_node *node,
> mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
> >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
> if (isu_size == 0)
> - mpic->num_sources =
> - ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
> - >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
> + if (flags & MPIC_BROKEN_FRR_NIRQS)
> + mpic->num_sources = mpic->irq_count;
> + else
> + mpic->num_sources =
> + ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
> + >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
>
> /* Map the per-CPU registers */
> for (i = 0; i < mpic->num_cpus; i++) {
> diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
> index 943c5a3..6802570 100644
> --- a/include/asm-powerpc/mpic.h
> +++ b/include/asm-powerpc/mpic.h
> @@ -353,6 +353,8 @@ struct mpic
> #define MPIC_ENABLE_MCK 0x00000200
> /* Disable bias among target selection, spread interrupts evenly */
> #define MPIC_NO_BIAS 0x00000400
> +/* Ignore NIRQS as reported by FRR */
> +#define MPIC_BROKEN_FRR_NIRQS 0x00000800
>
> /* MPIC HW modification ID */
> #define MPIC_REGSET_MASK 0xf0000000
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in FeatureReporting Register
2008-05-21 21:01 ` Benjamin Herrenschmidt
@ 2008-05-23 2:15 ` Jin Zhengxiong
2008-05-23 3:31 ` Kumar Gala
0 siblings, 1 reply; 5+ messages in thread
From: Jin Zhengxiong @ 2008-05-23 2:15 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
Hi, Kumar,
So I should change the MSI hwirq num according to this change, The
patches
will be send after this changes updated to your tree. How about applying
the MSI=20
driver firstly?
Jason
> -----Original Message-----
> From: linuxppc-dev-bounces+jinzhengxiong=3Dgmail.com@ozlabs.org=20
> [mailto:linuxppc-dev-bounces+jinzhengxiong=3Dgmail.com@ozlabs.or
> g] On Behalf Of Benjamin Herrenschmidt
> Sent: Thursday, May 22, 2008 5:02 AM
> To: Kumar Gala
> Cc: linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ=20
> in FeatureReporting Register
>=20
>=20
> On Wed, 2008-05-21 at 15:59 -0500, Kumar Gala wrote:
> > Some chips (like the SoCs from Freescale) report the wrong value in=20
> > NIRQ and this causes issues if its doesn't match or exceed=20
> the value=20
> > of irq_count.
> >=20
> > Add a flag that board code can set to just use irq_count instead of=20
> > FRR[NIRQ]. Eventually we'll add a device tree property with the=20
> > number of sources.
> >=20
> > Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>=20
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>=20
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in FeatureReporting Register
2008-05-23 2:15 ` [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in FeatureReporting Register Jin Zhengxiong
@ 2008-05-23 3:31 ` Kumar Gala
2008-05-23 8:34 ` Jin Zhengxiong
0 siblings, 1 reply; 5+ messages in thread
From: Kumar Gala @ 2008-05-23 3:31 UTC (permalink / raw)
To: Jin Zhengxiong; +Cc: linuxppc-dev
On May 22, 2008, at 9:15 PM, Jin Zhengxiong wrote:
> Hi, Kumar,
>
> So I should change the MSI hwirq num according to this change, The
> patches
> will be send after this changes updated to your tree. How about
> applying
> the MSI
> driver firstly?
I've asked Paul to pick up this patch for powerpc-next. If you can
rework the MSI patches with this patch applied and just change the
board support for mpc85xx_ds and 8610 to set the flag.
- k
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in FeatureReporting Register
2008-05-23 3:31 ` Kumar Gala
@ 2008-05-23 8:34 ` Jin Zhengxiong
0 siblings, 0 replies; 5+ messages in thread
From: Jin Zhengxiong @ 2008-05-23 8:34 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
=20
> On May 22, 2008, at 9:15 PM, Jin Zhengxiong wrote:
>=20
> > Hi, Kumar,
> >
> > So I should change the MSI hwirq num according to this change, The=20
> > patches will be send after this changes updated to your tree. How=20
> > about applying the MSI driver firstly?
>=20
> I've asked Paul to pick up this patch for powerpc-next. If=20
> you can rework the MSI patches with this patch applied and=20
> just change the board support for mpc85xx_ds and 8610 to set the flag.
>=20
Ok, Please find the patchset in the following mail. I'll resend the MSI
driver in this send.
Jason
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-23 8:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 20:59 [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in Feature Reporting Register Kumar Gala
2008-05-21 21:01 ` Benjamin Herrenschmidt
2008-05-23 2:15 ` [PATCH v2] [POWERPC] mpic: deal with bogus NIRQ in FeatureReporting Register Jin Zhengxiong
2008-05-23 3:31 ` Kumar Gala
2008-05-23 8:34 ` Jin Zhengxiong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).