LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] net/fec_mpc52xx: Fix kernel panic on FEC error
From: Wolfgang Grandegger @ 2009-10-14 19:11 UTC (permalink / raw)
  To: Grant Likely; +Cc: John Bonesio, netdev, linuxppc-dev, davem
In-Reply-To: <20091014174224.29221.18830.stgit@angua>

Grant Likely wrote:
> From: John Bonesio <bones@secretlab.ca>
> 
> The MDIO bus cannot be accessed at interrupt context, but on an FEC
> error, the fec_mpc52xx driver reset function also tries to reset the
> PHY.  Since the error is detected at IRQ context, and the PHY functions
> try to sleep, the kernel ends up panicking.
> 
> Resetting the PHY on an FEC error isn't even necessary.  This patch
> solves the problem by removing the PHY reset entirely.

There is also no need to free and re-allocate the RX buffers in
mpc52xx_fec_reset().

Wolfgang.

^ permalink raw reply

* Re: [PATCH 4/8] 8xx: Fixup DAR from buggy dcbX instructions.
From: Joakim Tjernlund @ 2009-10-14 19:05 UTC (permalink / raw)
  To: Scott Wood; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <20091014172003.GD21215@loki.buserror.net>

Scott Wood <scottwood@freescale.com> wrote on 14/10/2009 19:20:03:
>
> On Sun, Oct 11, 2009 at 06:35:08PM +0200, Joakim Tjernlund wrote:
> > This is an assembler version to fixup DAR not being set
> > by dcbX, icbi instructions. There are two versions, one
> > uses selfmodifing code, the other uses a
> > jump table but is much bigger(default).
> > ---
> >  arch/powerpc/kernel/head_8xx.S |  146 +++++++++++++++++++++++++++++++++++++++-
> >  1 files changed, 145 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
> > index 093176c..9839e79 100644
> > --- a/arch/powerpc/kernel/head_8xx.S
> > +++ b/arch/powerpc/kernel/head_8xx.S
> > @@ -494,7 +494,8 @@ DataTLBError:
> >
> >     mfspr   r10, SPRN_DAR
> >     cmpwi   cr0, r10, 0x00f0
> > -   beq-   2f   /* must be a buggy dcbX, icbi insn. */
> > +   beq-   FixDAR   /* must be a buggy dcbX, icbi insn. */
> > +DARFix:   /* Return from dcbx instruction bug workaround, r10 holds value of DAR */
>
> Both FixDAR and DARFix?  Could we make the labels a little clearer?

Yes, need to come up with better names :)

>
> > +/* This is the procedure to calculate the data EA for buggy dcbx,dcbi instructions
> > + * by decoding the registers used by the dcbx instruction and adding them.
> > + * DAR is set to the calculated address and r10 also holds the EA on exit.
> > + */
>
> How often does this happen?  Could we just do it in C code after saving all
> the registers, and avoid the self modifying stuff (or the big switch
> statement equivalent)?

I had some problems with the C-version. I got lots of extra TLB errors for the same address
so I am not confident it will work in the long run.

BTW, you could add a test and printk in do_page_fault on address 0x000000f0.
if that ever hits there is a problem with dcbX fixup.

^ permalink raw reply

* Re: [PATCH 3/6] powerpc: Remove get_irq_desc()
From: Grant Likely @ 2009-10-14 19:02 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <a78e4bb1b3a65314dd4bd0c253a0abf242bd34a6.1255499081.git.michael@ellerman.id.au>

On Tue, Oct 13, 2009 at 11:44 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> get_irq_desc() is a powerpc-specific version of irq_to_desc(). That
> is reason enough to remove it, but it also doesn't know about sparse
> irq_desc support which irq_to_desc() does (when we enable it).
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
> =A0arch/powerpc/include/asm/irq.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =
=A0 =A02 -
> =A0arch/powerpc/kernel/crash.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =
=A0 =A02 +-
> =A0arch/powerpc/kernel/irq.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
| =A0 28 ++++++++++++----------
> =A0arch/powerpc/platforms/512x/mpc5121_ads_cpld.c =A0| =A0 =A02 +-
> =A0arch/powerpc/platforms/52xx/media5200.c =A0 =A0 =A0 =A0 | =A0 =A02 +-
> =A0arch/powerpc/platforms/82xx/pq2ads-pci-pic.c =A0 =A0| =A0 =A02 +-
> =A0arch/powerpc/platforms/85xx/socrates_fpga_pic.c | =A0 =A02 +-
> =A0arch/powerpc/platforms/86xx/gef_pic.c =A0 =A0 =A0 =A0 =A0 | =A0 =A02 +=
-
> =A0arch/powerpc/platforms/cell/beat_interrupt.c =A0 =A0| =A0 =A02 +-
> =A0arch/powerpc/platforms/cell/spider-pic.c =A0 =A0 =A0 =A0| =A0 =A04 +-
> =A0arch/powerpc/platforms/iseries/irq.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02=
 +-
> =A0arch/powerpc/platforms/powermac/pic.c =A0 =A0 =A0 =A0 =A0 | =A0 =A08 +=
++---
> =A0arch/powerpc/platforms/pseries/xics.c =A0 =A0 =A0 =A0 =A0 | =A0 =A08 +=
++---
> =A0arch/powerpc/sysdev/cpm1.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
| =A0 =A02 +-
> =A0arch/powerpc/sysdev/cpm2_pic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =
=A0 10 +++++---
> =A0arch/powerpc/sysdev/fsl_msi.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =
=A0 =A02 +-
> =A0arch/powerpc/sysdev/i8259.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =
=A0 =A04 +-
> =A0arch/powerpc/sysdev/ipic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
| =A0 =A02 +-
> =A0arch/powerpc/sysdev/mpc8xx_pic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =
=A02 +-
> =A0arch/powerpc/sysdev/mpic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
| =A0 18 +++++++-------
> =A0arch/powerpc/sysdev/mv64x60_pic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =
=A02 +-
> =A0arch/powerpc/sysdev/qe_lib/qe_ic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =
=A04 +-
> =A0arch/powerpc/sysdev/tsi108_pci.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =
=A02 +-
> =A0arch/powerpc/sysdev/uic.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
| =A0 =A06 ++--
> =A0arch/powerpc/sysdev/xilinx_intc.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =
=A02 +-
> =A025 files changed, 62 insertions(+), 60 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/ir=
q.h
> index b83fcc8..03dc28c 100644
> --- a/arch/powerpc/include/asm/irq.h
> +++ b/arch/powerpc/include/asm/irq.h
> @@ -17,8 +17,6 @@
> =A0#include <asm/atomic.h>
>
>
> -#define get_irq_desc(irq) (&irq_desc[(irq)])
> -
> =A0/* Define a way to iterate across irqs. */
> =A0#define for_each_irq(i) \
> =A0 =A0 =A0 =A0for ((i) =3D 0; (i) < NR_IRQS; ++(i))
> diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
> index 0a8439a..6f4613d 100644
> --- a/arch/powerpc/kernel/crash.c
> +++ b/arch/powerpc/kernel/crash.c
> @@ -373,7 +373,7 @@ void default_machine_crash_shutdown(struct pt_regs *r=
egs)
> =A0 =A0 =A0 =A0hard_irq_disable();
>
> =A0 =A0 =A0 =A0for_each_irq(i) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct irq_desc *desc =3D irq_desc + i;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(i);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (desc->status & IRQ_INPROGRESS)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0desc->chip->eoi(i);
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index e5d1211..6563221 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -190,7 +190,7 @@ int show_interrupts(struct seq_file *p, void *v)
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0if (i < NR_IRQS) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D get_irq_desc(i);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D irq_to_desc(i);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0spin_lock_irqsave(&desc->lock, flags);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0action =3D desc->action;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!action || !action->handler)
> @@ -230,23 +230,25 @@ skip:
> =A0#ifdef CONFIG_HOTPLUG_CPU
> =A0void fixup_irqs(cpumask_t map)
> =A0{
> + =A0 =A0 =A0 struct irq_desc *desc;
> =A0 =A0 =A0 =A0unsigned int irq;
> =A0 =A0 =A0 =A0static int warned;
>
> =A0 =A0 =A0 =A0for_each_irq(irq) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpumask_t mask;
>
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (irq_desc[irq].status & IRQ_PER_CPU)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D irq_to_desc(irq);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (desc && desc->status & IRQ_PER_CPU)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;
>
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpumask_and(&mask, irq_desc[irq].affinity, =
&map);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpumask_and(&mask, desc->affinity, &map);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (any_online_cpu(mask) =3D=3D NR_CPUS) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk("Breaking affinity =
for irq %i\n", irq);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mask =3D map;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (irq_desc[irq].chip->set_affinity)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_desc[irq].chip->set_aff=
inity(irq, &mask);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 else if (irq_desc[irq].action && !(warned++=
))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (desc->chip->set_affinity)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc->chip->set_affinity(ir=
q, &mask);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 else if (desc->action && !(warned++))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk("Cannot set affinit=
y for irq %i\n", irq);
> =A0 =A0 =A0 =A0}
>
> @@ -273,7 +275,7 @@ static inline void handle_one_irq(unsigned int irq)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return;
> =A0 =A0 =A0 =A0}
>
> - =A0 =A0 =A0 desc =3D irq_desc + irq;
> + =A0 =A0 =A0 desc =3D irq_to_desc(irq);
> =A0 =A0 =A0 =A0saved_sp_limit =3D current->thread.ksp_limit;
>
> =A0 =A0 =A0 =A0irqtp->task =3D curtp->task;
> @@ -535,7 +537,7 @@ struct irq_host *irq_alloc_host(struct device_node *o=
f_node,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0smp_wmb();
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Clear norequest flags *=
/
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 get_irq_desc(i)->status &=
=3D ~IRQ_NOREQUEST;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_to_desc(i)->status &=3D=
 ~IRQ_NOREQUEST;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Legacy flags are left t=
o default at this point,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * one can then use irq_cr=
eate_mapping() to
> @@ -602,7 +604,7 @@ static int irq_setup_virq(struct irq_host *host, unsi=
gned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq_hw_number_t hw=
irq)
> =A0{
> =A0 =A0 =A0 =A0/* Clear IRQ_NOREQUEST flag */
> - =A0 =A0 =A0 get_irq_desc(virq)->status &=3D ~IRQ_NOREQUEST;
> + =A0 =A0 =A0 irq_to_desc(virq)->status &=3D ~IRQ_NOREQUEST;
>
> =A0 =A0 =A0 =A0/* map it */
> =A0 =A0 =A0 =A0smp_wmb();
> @@ -732,7 +734,7 @@ unsigned int irq_create_of_mapping(struct device_node=
 *controller,
>
> =A0 =A0 =A0 =A0/* Set type if specified and different than the current on=
e */
> =A0 =A0 =A0 =A0if (type !=3D IRQ_TYPE_NONE &&
> - =A0 =A0 =A0 =A0 =A0 type !=3D (get_irq_desc(virq)->status & IRQF_TRIGGE=
R_MASK))
> + =A0 =A0 =A0 =A0 =A0 type !=3D (irq_to_desc(virq)->status & IRQF_TRIGGER=
_MASK))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0set_irq_type(virq, type);
> =A0 =A0 =A0 =A0return virq;
> =A0}
> @@ -804,7 +806,7 @@ void irq_dispose_mapping(unsigned int virq)
> =A0 =A0 =A0 =A0irq_map[virq].hwirq =3D host->inval_irq;
>
> =A0 =A0 =A0 =A0/* Set some flags */
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_NOREQUEST;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_NOREQUEST;
>
> =A0 =A0 =A0 =A0/* Free it */
> =A0 =A0 =A0 =A0irq_free_virt(virq, 1);
> @@ -1001,7 +1003,7 @@ void irq_early_init(void)
> =A0 =A0 =A0 =A0unsigned int i;
>
> =A0 =A0 =A0 =A0for (i =3D 0; i < NR_IRQS; i++)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 get_irq_desc(i)->status |=3D IRQ_NOREQUEST;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_to_desc(i)->status |=3D IRQ_NOREQUEST;
> =A0}
>
> =A0/* We need to create the radix trees late */
> @@ -1064,7 +1066,7 @@ static int virq_debug_show(struct seq_file *m, void=
 *private)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"chip name", "host name");
>
> =A0 =A0 =A0 =A0for (i =3D 1; i < NR_IRQS; i++) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D get_irq_desc(i);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D irq_to_desc(i);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0spin_lock_irqsave(&desc->lock, flags);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (desc->action && desc->action->handler)=
 {
> diff --git a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c b/arch/powerp=
c/platforms/512x/mpc5121_ads_cpld.c
> index a6ce805..cd70ee1 100644
> --- a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
> +++ b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
> @@ -132,7 +132,7 @@ static int
> =A0cpld_pic_host_map(struct irq_host *h, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_hw_number_t h=
w)
> =A0{
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, &cpld_pic, handle_level_irq=
);
> =A0 =A0 =A0 =A0return 0;
> =A0}
> diff --git a/arch/powerpc/platforms/52xx/media5200.c b/arch/powerpc/platf=
orms/52xx/media5200.c
> index 68e4f16..4780203 100644
> --- a/arch/powerpc/platforms/52xx/media5200.c
> +++ b/arch/powerpc/platforms/52xx/media5200.c
> @@ -114,7 +114,7 @@ void media5200_irq_cascade(unsigned int virq, struct =
irq_desc *desc)
> =A0static int media5200_irq_map(struct irq_host *h, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_hw_number_t h=
w)
> =A0{
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
>
> =A0 =A0 =A0 =A0pr_debug("%s: h=3D%p, virq=3D%i, hwirq=3D%i\n", __func__, =
h, virq, (int)hw);
> =A0 =A0 =A0 =A0set_irq_chip_data(virq, &media5200_irq);
> diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/=
platforms/82xx/pq2ads-pci-pic.c
> index 7ee979f..a682331 100644
> --- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
> +++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
> @@ -107,7 +107,7 @@ static void pq2ads_pci_irq_demux(unsigned int irq, st=
ruct irq_desc *desc)
> =A0static int pci_pic_host_map(struct irq_host *h, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq_hw_number_t hw=
)
> =A0{
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_data(virq, h->host_data);
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, &pq2ads_pci_ic, handle_leve=
l_irq);
> =A0 =A0 =A0 =A0return 0;
> diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/power=
pc/platforms/85xx/socrates_fpga_pic.c
> index 60edf63..e59920a 100644
> --- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
> +++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
> @@ -245,7 +245,7 @@ static int socrates_fpga_pic_host_map(struct irq_host=
 *h, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq_hw_number_t hwirq)
> =A0{
> =A0 =A0 =A0 =A0/* All interrupts are LEVEL sensitive */
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, &socrates_fpga_pic_chip,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handle_fasteoi_irq);
>
> diff --git a/arch/powerpc/platforms/86xx/gef_pic.c b/arch/powerpc/platfor=
ms/86xx/gef_pic.c
> index 50d0a2b..978d6cb 100644
> --- a/arch/powerpc/platforms/86xx/gef_pic.c
> +++ b/arch/powerpc/platforms/86xx/gef_pic.c
> @@ -163,7 +163,7 @@ static int gef_pic_host_map(struct irq_host *h, unsig=
ned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq_hw_number_t hwirq)
> =A0{
> =A0 =A0 =A0 =A0/* All interrupts are LEVEL sensitive */
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, &gef_pic_chip, handle_level=
_irq);
>
> =A0 =A0 =A0 =A0return 0;
> diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/=
platforms/cell/beat_interrupt.c
> index 7225484..4a2bbff 100644
> --- a/arch/powerpc/platforms/cell/beat_interrupt.c
> +++ b/arch/powerpc/platforms/cell/beat_interrupt.c
> @@ -136,7 +136,7 @@ static void beatic_pic_host_unmap(struct irq_host *h,=
 unsigned int virq)
> =A0static int beatic_pic_host_map(struct irq_host *h, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_hw_number=
_t hw)
> =A0{
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0int64_t err;
>
> =A0 =A0 =A0 =A0err =3D beat_construct_and_connect_irq_plug(virq, hw);
> diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/plat=
forms/cell/spider-pic.c
> index 4e56556..9dd63c5 100644
> --- a/arch/powerpc/platforms/cell/spider-pic.c
> +++ b/arch/powerpc/platforms/cell/spider-pic.c
> @@ -102,7 +102,7 @@ static void spider_ack_irq(unsigned int virq)
>
> =A0 =A0 =A0 =A0/* Reset edge detection logic if necessary
> =A0 =A0 =A0 =A0 */
> - =A0 =A0 =A0 if (get_irq_desc(virq)->status & IRQ_LEVEL)
> + =A0 =A0 =A0 if (irq_to_desc(virq)->status & IRQ_LEVEL)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return;
>
> =A0 =A0 =A0 =A0/* Only interrupts 47 to 50 can be set to edge */
> @@ -119,7 +119,7 @@ static int spider_set_irq_type(unsigned int virq, uns=
igned int type)
> =A0 =A0 =A0 =A0struct spider_pic *pic =3D spider_virq_to_pic(virq);
> =A0 =A0 =A0 =A0unsigned int hw =3D irq_map[virq].hwirq;
> =A0 =A0 =A0 =A0void __iomem *cfg =3D spider_get_irq_config(pic, hw);
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0u32 old_mask;
> =A0 =A0 =A0 =A0u32 ic;
>
> diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platform=
s/iseries/irq.c
> index 94f4447..f8446ea 100644
> --- a/arch/powerpc/platforms/iseries/irq.c
> +++ b/arch/powerpc/platforms/iseries/irq.c
> @@ -214,7 +214,7 @@ void __init iSeries_activate_IRQs()
> =A0 =A0 =A0 =A0unsigned long flags;
>
> =A0 =A0 =A0 =A0for_each_irq (irq) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(irq)=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(irq);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (desc && desc->chip && desc->chip->star=
tup) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0spin_lock_irqsave(&desc->l=
ock, flags);
> diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platfor=
ms/powermac/pic.c
> index d212006..484d21e 100644
> --- a/arch/powerpc/platforms/powermac/pic.c
> +++ b/arch/powerpc/platforms/powermac/pic.c
> @@ -152,12 +152,12 @@ static unsigned int pmac_startup_irq(unsigned int v=
irq)
> =A0 =A0 =A0 =A0 unsigned long bit =3D 1UL << (src & 0x1f);
> =A0 =A0 =A0 =A0 int i =3D src >> 5;
>
> - =A0 =A0 =A0 spin_lock_irqsave(&pmac_pic_lock, flags);
> - =A0 =A0 =A0 if ((irq_desc[virq].status & IRQ_LEVEL) =3D=3D 0)
> + =A0 =A0 =A0 spin_lock_irqsave(&pmac_pic_lock, flags);
> + =A0 =A0 =A0 if ((irq_to_desc(virq)->status & IRQ_LEVEL) =3D=3D 0)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0out_le32(&pmac_irq_hw[i]->ack, bit);
> =A0 =A0 =A0 =A0 __set_bit(src, ppc_cached_irq_mask);
> =A0 =A0 =A0 =A0 __pmac_set_irq_mask(src, 0);
> - =A0 =A0 =A0 spin_unlock_irqrestore(&pmac_pic_lock, flags);
> + =A0 =A0 =A0 spin_unlock_irqrestore(&pmac_pic_lock, flags);
>
> =A0 =A0 =A0 =A0return 0;
> =A0}
> @@ -285,7 +285,7 @@ static int pmac_pic_host_match(struct irq_host *h, st=
ruct device_node *node)
> =A0static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_hw_number_t h=
w)
> =A0{
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0int level;
>
> =A0 =A0 =A0 =A0if (hw >=3D max_irqs)
> diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platfor=
ms/pseries/xics.c
> index 419f8a6..75935ae 100644
> --- a/arch/powerpc/platforms/pseries/xics.c
> +++ b/arch/powerpc/platforms/pseries/xics.c
> @@ -156,7 +156,7 @@ static int get_irq_server(unsigned int virq, unsigned=
 int strict_check)
> =A0 =A0 =A0 =A0cpumask_t cpumask;
> =A0 =A0 =A0 =A0cpumask_t tmp =3D CPU_MASK_NONE;
>
> - =A0 =A0 =A0 cpumask_copy(&cpumask, irq_desc[virq].affinity);
> + =A0 =A0 =A0 cpumask_copy(&cpumask, irq_to_desc(virq)->affinity);
> =A0 =A0 =A0 =A0if (!distribute_irqs)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return default_server;
>
> @@ -419,7 +419,7 @@ static int xics_host_map(struct irq_host *h, unsigned=
 int virq,
> =A0 =A0 =A0 =A0/* Insert the interrupt mapping into the radix tree for fa=
st lookup */
> =A0 =A0 =A0 =A0irq_radix_revmap_insert(xics_host, virq, hw);
>
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, xics_irq_chip, handle_faste=
oi_irq);
> =A0 =A0 =A0 =A0return 0;
> =A0}
> @@ -843,7 +843,7 @@ void xics_migrate_irqs_away(void)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* We need to get IPIs still. */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (irq =3D=3D XICS_IPI || irq =3D=3D XICS=
_IRQ_SPURIOUS)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D irq_to_desc(virq);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* We only need to migrate enabled IRQS */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (desc =3D=3D NULL || desc->chip =3D=3D =
NULL
> @@ -872,7 +872,7 @@ void xics_migrate_irqs_away(void)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 virq, cpu);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Reset affinity to all cpus */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpumask_setall(irq_desc[virq].affinity);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpumask_setall(irq_to_desc(virq)->affinity)=
;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0desc->chip->set_affinity(virq, cpu_all_mas=
k);
> =A0unlock:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0spin_unlock_irqrestore(&desc->lock, flags)=
;
> diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c
> index 82424cd..5235373 100644
> --- a/arch/powerpc/sysdev/cpm1.c
> +++ b/arch/powerpc/sysdev/cpm1.c
> @@ -102,7 +102,7 @@ static int cpm_pic_host_map(struct irq_host *h, unsig=
ned int virq,
> =A0{
> =A0 =A0 =A0 =A0pr_debug("cpm_pic_host_map(%d, 0x%lx)\n", virq, hw);
>
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, &cpm_pic, handle_fasteoi_ir=
q);
> =A0 =A0 =A0 =A0return 0;
> =A0}
> diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pi=
c.c
> index 78f1f7c..722cf72 100644
> --- a/arch/powerpc/sysdev/cpm2_pic.c
> +++ b/arch/powerpc/sysdev/cpm2_pic.c
> @@ -115,11 +115,13 @@ static void cpm2_ack(unsigned int virq)
>
> =A0static void cpm2_end_irq(unsigned int virq)
> =A0{
> + =A0 =A0 =A0 struct irq_desc *desc;
> =A0 =A0 =A0 =A0int =A0 =A0 bit, word;
> =A0 =A0 =A0 =A0unsigned int irq_nr =3D virq_to_hw(virq);
>
> - =A0 =A0 =A0 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRES=
S))
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && irq_desc[irq_nr].action)=
 {
> + =A0 =A0 =A0 desc =3D irq_to_desc(irq_nr);
> + =A0 =A0 =A0 if (!(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && desc->action) {
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bit =3D irq_to_siubit[irq_nr];
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0word =3D irq_to_siureg[irq_nr];
> @@ -138,7 +140,7 @@ static void cpm2_end_irq(unsigned int virq)
> =A0static int cpm2_set_irq_type(unsigned int virq, unsigned int flow_type=
)
> =A0{
> =A0 =A0 =A0 =A0unsigned int src =3D virq_to_hw(virq);
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0unsigned int vold, vnew, edibit;
>
> =A0 =A0 =A0 =A0if (flow_type =3D=3D IRQ_TYPE_NONE)
> @@ -210,7 +212,7 @@ static int cpm2_pic_host_map(struct irq_host *h, unsi=
gned int virq,
> =A0{
> =A0 =A0 =A0 =A0pr_debug("cpm2_pic_host_map(%d, 0x%lx)\n", virq, hw);
>
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, &cpm2_pic, handle_level_irq=
);
> =A0 =A0 =A0 =A0return 0;
> =A0}
> diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.=
c
> index da38a1f..7174374 100644
> --- a/arch/powerpc/sysdev/fsl_msi.c
> +++ b/arch/powerpc/sysdev/fsl_msi.c
> @@ -55,7 +55,7 @@ static int fsl_msi_host_map(struct irq_host *h, unsigne=
d int virq,
> =A0{
> =A0 =A0 =A0 =A0struct irq_chip *chip =3D &fsl_msi_chip;
>
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_TYPE_EDGE_FALLING;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_TYPE_EDGE_FALLING;
>
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, chip, handle_edge_irq);
>
> diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
> index a96584a..78ed945 100644
> --- a/arch/powerpc/sysdev/i8259.c
> +++ b/arch/powerpc/sysdev/i8259.c
> @@ -175,12 +175,12 @@ static int i8259_host_map(struct irq_host *h, unsig=
ned int virq,
>
> =A0 =A0 =A0 =A0/* We block the internal cascade */
> =A0 =A0 =A0 =A0if (hw =3D=3D 2)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_NOREQUE=
ST;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_NOREQUES=
T;
>
> =A0 =A0 =A0 =A0/* We use the level handler only for now, we might want to
> =A0 =A0 =A0 =A0 * be more cautious here but that works for now
> =A0 =A0 =A0 =A0 */
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, &i8259_pic, handle_level_ir=
q);
> =A0 =A0 =A0 =A0return 0;
> =A0}
> diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
> index cb7689c..f042c1d 100644
> --- a/arch/powerpc/sysdev/ipic.c
> +++ b/arch/powerpc/sysdev/ipic.c
> @@ -605,7 +605,7 @@ static int ipic_set_irq_type(unsigned int virq, unsig=
ned int flow_type)
> =A0{
> =A0 =A0 =A0 =A0struct ipic *ipic =3D ipic_from_irq(virq);
> =A0 =A0 =A0 =A0unsigned int src =3D ipic_irq_to_hw(virq);
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0unsigned int vold, vnew, edibit;
>
> =A0 =A0 =A0 =A0if (flow_type =3D=3D IRQ_TYPE_NONE)
> diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8x=
x_pic.c
> index 5d2d552..0117958 100644
> --- a/arch/powerpc/sysdev/mpc8xx_pic.c
> +++ b/arch/powerpc/sysdev/mpc8xx_pic.c
> @@ -72,7 +72,7 @@ static void mpc8xx_end_irq(unsigned int virq)
>
> =A0static int mpc8xx_set_irq_type(unsigned int virq, unsigned int flow_ty=
pe)
> =A0{
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
>
> =A0 =A0 =A0 =A0desc->status &=3D ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
> =A0 =A0 =A0 =A0desc->status |=3D flow_type & IRQ_TYPE_SENSE_MASK;
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index 30c44e6..4fd57ab 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -572,7 +572,7 @@ static int irq_choose_cpu(unsigned int virt_irq)
> =A0 =A0 =A0 =A0cpumask_t mask;
> =A0 =A0 =A0 =A0int cpuid;
>
> - =A0 =A0 =A0 cpumask_copy(&mask, irq_desc[virt_irq].affinity);
> + =A0 =A0 =A0 cpumask_copy(&mask, irq_to_desc(virt_irq)->affinity);
> =A0 =A0 =A0 =A0if (cpus_equal(mask, CPU_MASK_ALL)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0static int irq_rover;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0static DEFINE_SPINLOCK(irq_rover_lock);
> @@ -621,7 +621,7 @@ static struct mpic *mpic_find(unsigned int irq)
> =A0 =A0 =A0 =A0if (irq < NUM_ISA_INTERRUPTS)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NULL;
>
> - =A0 =A0 =A0 return irq_desc[irq].chip_data;
> + =A0 =A0 =A0 return irq_to_desc(irq)->chip_data;
> =A0}
>
> =A0/* Determine if the linux irq is an IPI */
> @@ -648,14 +648,14 @@ static inline u32 mpic_physmask(u32 cpumask)
> =A0/* Get the mpic structure from the IPI number */
> =A0static inline struct mpic * mpic_from_ipi(unsigned int ipi)
> =A0{
> - =A0 =A0 =A0 return irq_desc[ipi].chip_data;
> + =A0 =A0 =A0 return irq_to_desc(ipi)->chip_data;
> =A0}
> =A0#endif
>
> =A0/* Get the mpic structure from the irq number */
> =A0static inline struct mpic * mpic_from_irq(unsigned int irq)
> =A0{
> - =A0 =A0 =A0 return irq_desc[irq].chip_data;
> + =A0 =A0 =A0 return irq_to_desc(irq)->chip_data;
> =A0}
>
> =A0/* Send an EOI */
> @@ -735,7 +735,7 @@ static void mpic_unmask_ht_irq(unsigned int irq)
>
> =A0 =A0 =A0 =A0mpic_unmask_irq(irq);
>
> - =A0 =A0 =A0 if (irq_desc[irq].status & IRQ_LEVEL)
> + =A0 =A0 =A0 if (irq_to_desc(irq)->status & IRQ_LEVEL)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mpic_ht_end_irq(mpic, src);
> =A0}
>
> @@ -745,7 +745,7 @@ static unsigned int mpic_startup_ht_irq(unsigned int =
irq)
> =A0 =A0 =A0 =A0unsigned int src =3D mpic_irq_to_hw(irq);
>
> =A0 =A0 =A0 =A0mpic_unmask_irq(irq);
> - =A0 =A0 =A0 mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status);
> + =A0 =A0 =A0 mpic_startup_ht_interrupt(mpic, src, irq_to_desc(irq)->stat=
us);
>
> =A0 =A0 =A0 =A0return 0;
> =A0}
> @@ -755,7 +755,7 @@ static void mpic_shutdown_ht_irq(unsigned int irq)
> =A0 =A0 =A0 =A0struct mpic *mpic =3D mpic_from_irq(irq);
> =A0 =A0 =A0 =A0unsigned int src =3D mpic_irq_to_hw(irq);
>
> - =A0 =A0 =A0 mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status)=
;
> + =A0 =A0 =A0 mpic_shutdown_ht_interrupt(mpic, src, irq_to_desc(irq)->sta=
tus);
> =A0 =A0 =A0 =A0mpic_mask_irq(irq);
> =A0}
>
> @@ -772,7 +772,7 @@ static void mpic_end_ht_irq(unsigned int irq)
> =A0 =A0 =A0 =A0 * latched another edge interrupt coming in anyway
> =A0 =A0 =A0 =A0 */
>
> - =A0 =A0 =A0 if (irq_desc[irq].status & IRQ_LEVEL)
> + =A0 =A0 =A0 if (irq_to_desc(irq)->status & IRQ_LEVEL)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mpic_ht_end_irq(mpic, src);
> =A0 =A0 =A0 =A0mpic_eoi(mpic);
> =A0}
> @@ -856,7 +856,7 @@ int mpic_set_irq_type(unsigned int virq, unsigned int=
 flow_type)
> =A0{
> =A0 =A0 =A0 =A0struct mpic *mpic =3D mpic_from_irq(virq);
> =A0 =A0 =A0 =A0unsigned int src =3D mpic_irq_to_hw(virq);
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0unsigned int vecpri, vold, vnew;
>
> =A0 =A0 =A0 =A0DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%=
x)\n",
> diff --git a/arch/powerpc/sysdev/mv64x60_pic.c b/arch/powerpc/sysdev/mv64=
x60_pic.c
> index 2aa4ed0..485b924 100644
> --- a/arch/powerpc/sysdev/mv64x60_pic.c
> +++ b/arch/powerpc/sysdev/mv64x60_pic.c
> @@ -213,7 +213,7 @@ static int mv64x60_host_map(struct irq_host *h, unsig=
ned int virq,
> =A0{
> =A0 =A0 =A0 =A0int level1;
>
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
>
> =A0 =A0 =A0 =A0level1 =3D (hwirq & MV64x60_LEVEL1_MASK) >> MV64x60_LEVEL1=
_OFFSET;
> =A0 =A0 =A0 =A0BUG_ON(level1 > MV64x60_LEVEL1_GPP);
> diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_=
lib/qe_ic.c
> index 3faa42e..fc09874 100644
> --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
> +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
> @@ -189,7 +189,7 @@ static inline void qe_ic_write(volatile __be32 =A0__i=
omem * base, unsigned int reg
>
> =A0static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
> =A0{
> - =A0 =A0 =A0 return irq_desc[virq].chip_data;
> + =A0 =A0 =A0 return irq_to_desc(virq)->chip_data;
> =A0}
>
> =A0#define virq_to_hw(virq) =A0 =A0 =A0 ((unsigned int)irq_map[virq].hwir=
q)
> @@ -263,7 +263,7 @@ static int qe_ic_host_map(struct irq_host *h, unsigne=
d int virq,
> =A0 =A0 =A0 =A0chip =3D &qe_ic->hc_irq;
>
> =A0 =A0 =A0 =A0set_irq_chip_data(virq, qe_ic);
> - =A0 =A0 =A0 get_irq_desc(virq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 irq_to_desc(virq)->status |=3D IRQ_LEVEL;
>
> =A0 =A0 =A0 =A0set_irq_chip_and_handler(virq, chip, handle_level_irq);
>
> diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi10=
8_pci.c
> index cf244a4..02f6009 100644
> --- a/arch/powerpc/sysdev/tsi108_pci.c
> +++ b/arch/powerpc/sysdev/tsi108_pci.c
> @@ -398,7 +398,7 @@ static int pci_irq_host_map(struct irq_host *h, unsig=
ned int virq,
> =A0 =A0 =A0 =A0DBG("%s(%d, 0x%lx)\n", __func__, virq, hw);
> =A0 =A0 =A0 =A0if ((virq >=3D 1) && (virq <=3D 4)){
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq =3D virq + IRQ_PCI_INTAD_BASE - 1;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 get_irq_desc(irq)->status |=3D IRQ_LEVEL;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_to_desc(irq)->status |=3D IRQ_LEVEL;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0set_irq_chip(irq, &tsi108_pci_irq);
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0return 0;
> diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
> index 466ce9a..cf97935 100644
> --- a/arch/powerpc/sysdev/uic.c
> +++ b/arch/powerpc/sysdev/uic.c
> @@ -57,7 +57,7 @@ struct uic {
>
> =A0static void uic_unmask_irq(unsigned int virq)
> =A0{
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0struct uic *uic =3D get_irq_chip_data(virq);
> =A0 =A0 =A0 =A0unsigned int src =3D uic_irq_to_hw(virq);
> =A0 =A0 =A0 =A0unsigned long flags;
> @@ -101,7 +101,7 @@ static void uic_ack_irq(unsigned int virq)
>
> =A0static void uic_mask_ack_irq(unsigned int virq)
> =A0{
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0struct uic *uic =3D get_irq_chip_data(virq);
> =A0 =A0 =A0 =A0unsigned int src =3D uic_irq_to_hw(virq);
> =A0 =A0 =A0 =A0unsigned long flags;
> @@ -129,7 +129,7 @@ static int uic_set_irq_type(unsigned int virq, unsign=
ed int flow_type)
> =A0{
> =A0 =A0 =A0 =A0struct uic *uic =3D get_irq_chip_data(virq);
> =A0 =A0 =A0 =A0unsigned int src =3D uic_irq_to_hw(virq);
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
> =A0 =A0 =A0 =A0unsigned long flags;
> =A0 =A0 =A0 =A0int trigger, polarity;
> =A0 =A0 =A0 =A0u32 tr, pr, mask;
> diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xili=
nx_intc.c
> index 40edad5..ab74371 100644
> --- a/arch/powerpc/sysdev/xilinx_intc.c
> +++ b/arch/powerpc/sysdev/xilinx_intc.c
> @@ -79,7 +79,7 @@ static void xilinx_intc_mask(unsigned int virq)
>
> =A0static int xilinx_intc_set_type(unsigned int virq, unsigned int flow_t=
ype)
> =A0{
> - =A0 =A0 =A0 struct irq_desc *desc =3D get_irq_desc(virq);
> + =A0 =A0 =A0 struct irq_desc *desc =3D irq_to_desc(virq);
>
> =A0 =A0 =A0 =A0desc->status &=3D ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
> =A0 =A0 =A0 =A0desc->status |=3D flow_type & IRQ_TYPE_SENSE_MASK;
> --
> 1.6.2.1
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 1/6] powerpc: Make NR_IRQS a CONFIG option
From: Grant Likely @ 2009-10-14 18:59 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <a6fc612b826ff12628e62601203d565df00c6436.1255499081.git.michael@ellerman.id.au>

On Tue, Oct 13, 2009 at 11:44 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> The irq_desc array consumes quite a lot of space, and for systems
> that don't need or can't have 512 irqs it's just wasted space.
>
> The first 16 are reserved for ISA, so the minimum of 32 is really
> 16 - and no one has asked for more than 512 so leave that as the
> maximum.

Does it really make sense to have this as a user twiddlable value?
Especially when many users just don't have the background to know what
an appropriate value is here and will get it wrong?  I believe your
sparse IRQ patch has a bigger impact anyway on systems where memory is
tight.

g.

>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> =A0arch/powerpc/Kconfig =A0 =A0 =A0 =A0 =A0 | =A0 10 ++++++++++
> =A0arch/powerpc/include/asm/irq.h | =A0 =A04 ++--
> =A02 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 10a0a54..2230e75 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -56,6 +56,16 @@ config IRQ_PER_CPU
> =A0 =A0 =A0 =A0bool
> =A0 =A0 =A0 =A0default y
>
> +config NR_IRQS
> + =A0 =A0 =A0 int "Number of virtual interrupt numbers"
> + =A0 =A0 =A0 range 32 512
> + =A0 =A0 =A0 default "512"
> + =A0 =A0 =A0 help
> + =A0 =A0 =A0 =A0 This defines the number of virtual interrupt numbers th=
e kernel
> + =A0 =A0 =A0 =A0 can manage. Virtual interrupt numbers are what you see =
in
> + =A0 =A0 =A0 =A0 /proc/interrupts. If you configure your system to have =
too few,
> + =A0 =A0 =A0 =A0 drivers will fail to load or worse - handle with care.
> +
> =A0config STACKTRACE_SUPPORT
> =A0 =A0 =A0 =A0bool
> =A0 =A0 =A0 =A0default y
> diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/ir=
q.h
> index bbcd1aa..b83fcc8 100644
> --- a/arch/powerpc/include/asm/irq.h
> +++ b/arch/powerpc/include/asm/irq.h
> @@ -34,8 +34,8 @@ extern atomic_t ppc_n_lost_interrupts;
> =A0*/
> =A0#define NO_IRQ_IGNORE =A0 =A0 =A0 =A0 =A0((unsigned int)-1)
>
> -/* Total number of virq in the platform (make it a CONFIG_* option ? */
> -#define NR_IRQS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0512
> +/* Total number of virq in the platform */
> +#define NR_IRQS =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0CONFIG_NR_IRQS
>
> =A0/* Number of irqs reserved for the legacy controller */
> =A0#define NUM_ISA_INTERRUPTS =A0 =A0 16
> --
> 1.6.2.1
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 0/8] Fix 8xx MMU/TLB.
From: Joakim Tjernlund @ 2009-10-14 18:46 UTC (permalink / raw)
  To: Scott Wood; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <20091014172351.GE21215@loki.buserror.net>

Scott Wood <scottwood@freescale.com> wrote on 14/10/2009 19:23:51:
>
> On Sun, Oct 11, 2009 at 06:35:04PM +0200, Joakim Tjernlund wrote:
> > This is the latest batch of mu 8xx MMU/TLB rework.
> > I think this is complete now and will relax with
> > other work the next few days. I hope I can get some
> > testing from Scott and Rex during this time.
>
> I applied this stack plus "Remove DIRTY pte handling in DTLB Error" (fixing
> up conflicts again, as well as the noted build errors), and got this:

Sorry about the build problems, will fixup.

Don't know what is causing the error though, works just fine on 2.4 :(

Assuming you fixup this error:
 arch/powerpc/kernel/head_8xx.S:577: undefined reference to `DARfix'
with a "b DARFix" I can only guess and I don't have a good guess even :(

You could back out
8xx: start using dcbX instructions in various copy routines
to see if it is the dcbX insn that is causing the error.


>
> INIT: version 2.85 booting
> Mounting /proc and /sys
> Starting the hotplug events dispatcher udevd
> udevd[177]: add_to_rules: unknown key 'MODALIAS' in /etc/udev/rules.d/60-pcmcia.rules:4
> udevd[177]: add_to_rules: unknown key 'MODALIAS' in /etc/udev/rules.d/60-pcmcia.rules:10
> udevd[177]: add_to_rules: unknown key 'MODALIAS' in /etc/udev/rules.d/60-pcmcia.rules:14
> Synthesizing initial hotplug events
> /etc/rc.d/init.d/udev: line 41:   187 Segmentation fault      udevsettle --timeout=300

This looks like the first error?

> Setting the hostname to 8xx
> Running depmod
> WARNING: Couldn't open directory /lib/modules/2.6.31-08384-g2cb4b47-dirty: No
> such file or directory
> FATAL: Could not open /lib/modules/2.6.31-08384-g2cb4b47-dirty/
> modules.dep.tempfor writing: No such file or directory
> Mounting filesystems
> BUG: soft lockup - CPU#0 stuck for 61s! [cat:265]

Perhaps it is looping on the same TLB Error, caused by dcbX insn?

> NIP: c000f160 LR: c000f160 CTR: 00000007
> REGS: c3919c70 TRAP: 0901   Not tainted  (2.6.31-08384-g2cb4b47-dirty)
> MSR: 00009032 <EE,ME,IR,DR>  CR: 88008424  XER: 00000000
> TASK = c3944bd0[265] 'cat' THREAD: c3918000
> GPR00: c000f160 c3919d20 c3944bd0 00000000 100180fc 00000000 00000000 00000001
> GPR08: c393e700 00000000 03ca9d21 00000001 48000428
> NIP [c000f160] do_page_fault+0x188/0x49c
> LR [c000f160] do_page_fault+0x188/0x49c
> Call Trace:
> [c3919d20] [c000f160] do_page_fault+0x188/0x49c (unreliable)
> [c3919dd0] [c000e3f0] handle_page_fault+0xc/0x80
> [c3919e90] [c008910c] seq_read+0x2a4/0x558
> [c3919ee0] [c00ab7c0] proc_reg_read+0x4c/0x70
> [c3919ef0] [c006f47c] vfs_read+0xb4/0x158
> [c3919f10] [c006f78c] sys_read+0x4c/0x90
> [c3919f40] [c000dfc0] ret_from_syscall+0x0/0x38
> Instruction dump:
> 2f990000 419e01f0 801f0014 700a0002 418201f8 7c1900d0 541e0ffe 7fe4fb78
> 7f85e378 7fc6f378 7f63db78 4804c31d <70690003> 7c601b78 40820230 70690004
>
> -Scott
>
>

^ permalink raw reply

* Re: [PATCH 6/6] powerpc: Enable sparse irq_descs on powerpc
From: Grant Likely @ 2009-10-14 18:44 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <91cec5c64da4ca31a025fc7c45d9f1b93c8b98da.1255499081.git.michael@ellerman.id.au>

On Tue, Oct 13, 2009 at 11:45 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> Defining CONFIG_SPARSE_IRQ enables generic code that gets rid of the
> static irq_desc array, and replaces it with an array of pointers to
> irq_descs.
>
> It also allows node local allocation of irq_descs, however we
> currently don't have the information available to do that, so we just
> allocate them on all on node 0.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Why not make sparse IRQs manditory for all platforms?  Is there a
performance concern with doing so?  From a maintenance perspective,
I'd rather see IRQ descs manged in one way only to keep the code
simple.

Cheers,
g.

> ---
> =A0arch/powerpc/Kconfig =A0 =A0 =A0 =A0 =A0 =A0| =A0 13 ++++++++++++
> =A0arch/powerpc/include/asm/irq.h =A0| =A0 =A03 ++
> =A0arch/powerpc/kernel/irq.c =A0 =A0 =A0 | =A0 40 +++++++++++++++++++++++=
+++++++++------
> =A0arch/powerpc/kernel/ppc_ksyms.c | =A0 =A01 -
> =A0arch/powerpc/kernel/setup_64.c =A0| =A0 =A05 ----
> =A05 files changed, 49 insertions(+), 13 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 2230e75..825d889 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -388,6 +388,19 @@ config IRQ_ALL_CPUS
> =A0 =A0 =A0 =A0 =A0CPU. =A0Generally saying Y is safe, although some prob=
lems have been
> =A0 =A0 =A0 =A0 =A0reported with SMP Power Macintoshes with this option e=
nabled.
>
> +config SPARSE_IRQ
> + =A0 =A0 =A0 bool "Support sparse irq numbering"
> + =A0 =A0 =A0 default y
> + =A0 =A0 =A0 help
> + =A0 =A0 =A0 =A0 This enables support for sparse irqs. This is useful fo=
r distro
> + =A0 =A0 =A0 =A0 kernels that want to define a high CONFIG_NR_CPUS value=
 but still
> + =A0 =A0 =A0 =A0 want to have low kernel memory footprint on smaller mac=
hines.
> +
> + =A0 =A0 =A0 =A0 ( Sparse IRQs can also be beneficial on NUMA boxes, as =
they spread
> + =A0 =A0 =A0 =A0 =A0 out the irq_desc[] array in a more NUMA-friendly wa=
y. )
> +
> + =A0 =A0 =A0 =A0 If you don't know what to do here, say Y.
> +
> =A0config NUMA
> =A0 =A0 =A0 =A0bool "NUMA support"
> =A0 =A0 =A0 =A0depends on PPC64
> diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/ir=
q.h
> index 03dc28c..c85a32f 100644
> --- a/arch/powerpc/include/asm/irq.h
> +++ b/arch/powerpc/include/asm/irq.h
> @@ -38,6 +38,9 @@ extern atomic_t ppc_n_lost_interrupts;
> =A0/* Number of irqs reserved for the legacy controller */
> =A0#define NUM_ISA_INTERRUPTS =A0 =A0 16
>
> +/* Same thing, used by the generic IRQ code */
> +#define NR_IRQS_LEGACY =A0 =A0 =A0 =A0 NUM_ISA_INTERRUPTS
> +
> =A0/* This type is the placeholder for a hardware interrupt number. It ha=
s to
> =A0* be big enough to enclose whatever representation is used by a given
> =A0* platform.
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 63e27d5..eba5392 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -85,7 +85,10 @@ extern int tau_interrupts(int);
> =A0#endif /* CONFIG_PPC32 */
>
> =A0#ifdef CONFIG_PPC64
> +
> +#ifndef CONFIG_SPARSE_IRQ
> =A0EXPORT_SYMBOL(irq_desc);
> +#endif
>
> =A0int distribute_irqs =3D 1;
>
> @@ -613,8 +616,16 @@ void irq_set_virq_count(unsigned int count)
> =A0static int irq_setup_virq(struct irq_host *host, unsigned int virq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq_hw_number_t hw=
irq)
> =A0{
> + =A0 =A0 =A0 struct irq_desc *desc;
> +
> + =A0 =A0 =A0 desc =3D irq_to_desc_alloc_node(virq, 0);
> + =A0 =A0 =A0 if (!desc) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 pr_debug("irq: -> allocating desc failed\n"=
);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> + =A0 =A0 =A0 }
> +
> =A0 =A0 =A0 =A0/* Clear IRQ_NOREQUEST flag */
> - =A0 =A0 =A0 irq_to_desc(virq)->status &=3D ~IRQ_NOREQUEST;
> + =A0 =A0 =A0 desc->status &=3D ~IRQ_NOREQUEST;
>
> =A0 =A0 =A0 =A0/* map it */
> =A0 =A0 =A0 =A0smp_wmb();
> @@ -623,11 +634,14 @@ static int irq_setup_virq(struct irq_host *host, un=
signed int virq,
>
> =A0 =A0 =A0 =A0if (host->ops->map(host, virq, hwirq)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pr_debug("irq: -> mapping failed, freeing\=
n");
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_free_virt(virq, 1);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0return 0;
> +
> +error:
> + =A0 =A0 =A0 irq_free_virt(virq, 1);
> + =A0 =A0 =A0 return -1;
> =A0}
>
> =A0unsigned int irq_create_direct_mapping(struct irq_host *host)
> @@ -1008,12 +1022,24 @@ void irq_free_virt(unsigned int virq, unsigned in=
t count)
> =A0 =A0 =A0 =A0spin_unlock_irqrestore(&irq_big_lock, flags);
> =A0}
>
> -void irq_early_init(void)
> +int arch_early_irq_init(void)
> =A0{
> - =A0 =A0 =A0 unsigned int i;
> + =A0 =A0 =A0 struct irq_desc *desc;
> + =A0 =A0 =A0 int i;
>
> - =A0 =A0 =A0 for (i =3D 0; i < NR_IRQS; i++)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 irq_to_desc(i)->status |=3D IRQ_NOREQUEST;
> + =A0 =A0 =A0 for (i =3D 0; i < NR_IRQS; i++) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D irq_to_desc(i);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (desc)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc->status |=3D IRQ_NOREQ=
UEST;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 return 0;
> +}
> +
> +int arch_init_chip_data(struct irq_desc *desc, int node)
> +{
> + =A0 =A0 =A0 desc->status |=3D IRQ_NOREQUEST;
> + =A0 =A0 =A0 return 0;
> =A0}
>
> =A0/* We need to create the radix trees late */
> diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ks=
yms.c
> index c8b27bb..07115d6 100644
> --- a/arch/powerpc/kernel/ppc_ksyms.c
> +++ b/arch/powerpc/kernel/ppc_ksyms.c
> @@ -162,7 +162,6 @@ EXPORT_SYMBOL(screen_info);
>
> =A0#ifdef CONFIG_PPC32
> =A0EXPORT_SYMBOL(timer_interrupt);
> -EXPORT_SYMBOL(irq_desc);
> =A0EXPORT_SYMBOL(tb_ticks_per_jiffy);
> =A0EXPORT_SYMBOL(cacheable_memcpy);
> =A0EXPORT_SYMBOL(cacheable_memzero);
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_6=
4.c
> index 797ea95..8e5ec92 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -357,11 +357,6 @@ void __init setup_system(void)
> =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0initialize_cache_info();
>
> - =A0 =A0 =A0 /*
> - =A0 =A0 =A0 =A0* Initialize irq remapping subsystem
> - =A0 =A0 =A0 =A0*/
> - =A0 =A0 =A0 irq_early_init();
> -
> =A0#ifdef CONFIG_PPC_RTAS
> =A0 =A0 =A0 =A0/*
> =A0 =A0 =A0 =A0 * Initialize RTAS if available
> --
> 1.6.2.1
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 5/6] powerpc: Rearrange and fix show_interrupts() for sparse irq_descs
From: Grant Likely @ 2009-10-14 18:37 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <1dec053fee540bd474f88d4850d4ab213ea7215d.1255499081.git.michael@ellerman.id.au>

On Tue, Oct 13, 2009 at 11:45 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> Move the default case out of the if, ie. when we're just displaying
> an irq. And consolidate all the odd cases at the top, ie. printing
> the header and footer.
>
> And in the process cope with sparse irq_descs.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Looks reasonable to me
Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
> =A0arch/powerpc/kernel/irq.c | =A0 64 ++++++++++++++++++++++++++---------=
----------
> =A01 files changed, 37 insertions(+), 27 deletions(-)
>
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index baa49eb..63e27d5 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -187,33 +187,7 @@ int show_interrupts(struct seq_file *p, void *v)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for_each_online_cpu(j)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0seq_printf(p, "CPU%d =A0 =
=A0 =A0 ", j);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0seq_putc(p, '\n');
> - =A0 =A0 =A0 }
> -
> - =A0 =A0 =A0 if (i < NR_IRQS) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 desc =3D irq_to_desc(i);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 spin_lock_irqsave(&desc->lock, flags);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 action =3D desc->action;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!action || !action->handler)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto skip;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, "%3d: ", i);
> -#ifdef CONFIG_SMP
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 for_each_online_cpu(j)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, "%10u ", ksta=
t_irqs_cpu(i, j));
> -#else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, "%10u ", kstat_irqs(i));
> -#endif /* CONFIG_SMP */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (desc->chip)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, " %s ", desc-=
>chip->typename);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_puts(p, " =A0None =A0 =
=A0 =A0");
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, "%s", (desc->status & IRQ_LEV=
EL) ? "Level " : "Edge =A0");
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, " =A0 =A0%s", action->name);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 for (action =3D action->next; action; actio=
n =3D action->next)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, ", %s", actio=
n->name);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_putc(p, '\n');
> -skip:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 spin_unlock_irqrestore(&desc->lock, flags);
> - =A0 =A0 =A0 } else if (i =3D=3D NR_IRQS) {
> + =A0 =A0 =A0 } else if (i =3D=3D nr_irqs) {
> =A0#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (tau_initialized){
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0seq_puts(p, "TAU: ");
> @@ -223,7 +197,43 @@ skip:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0#endif /* CONFIG_PPC32 && CONFIG_TAU_INT*/
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0seq_printf(p, "BAD: %10u\n", ppc_spurious_=
interrupts);
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0;
> =A0 =A0 =A0 =A0}
> +
> + =A0 =A0 =A0 desc =3D irq_to_desc(i);
> + =A0 =A0 =A0 if (!desc)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0;
> +
> + =A0 =A0 =A0 spin_lock_irqsave(&desc->lock, flags);
> +
> + =A0 =A0 =A0 action =3D desc->action;
> + =A0 =A0 =A0 if (!action || !action->handler)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto skip;
> +
> + =A0 =A0 =A0 seq_printf(p, "%3d: ", i);
> +#ifdef CONFIG_SMP
> + =A0 =A0 =A0 for_each_online_cpu(j)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)=
);
> +#else
> + =A0 =A0 =A0 seq_printf(p, "%10u ", kstat_irqs(i));
> +#endif /* CONFIG_SMP */
> +
> + =A0 =A0 =A0 if (desc->chip)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, " %s ", desc->chip->typename)=
;
> + =A0 =A0 =A0 else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_puts(p, " =A0None =A0 =A0 =A0");
> +
> + =A0 =A0 =A0 seq_printf(p, "%s", (desc->status & IRQ_LEVEL) ? "Level " :=
 "Edge =A0");
> + =A0 =A0 =A0 seq_printf(p, " =A0 =A0%s", action->name);
> +
> + =A0 =A0 =A0 for (action =3D action->next; action; action =3D action->ne=
xt)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 seq_printf(p, ", %s", action->name);
> + =A0 =A0 =A0 seq_putc(p, '\n');
> +
> +skip:
> + =A0 =A0 =A0 spin_unlock_irqrestore(&desc->lock, flags);
> +
> =A0 =A0 =A0 =A0return 0;
> =A0}
>
> --
> 1.6.2.1
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 4/6] powerpc: Make virq_debug_show() cope with sparse irq_descs
From: Grant Likely @ 2009-10-14 18:34 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <a9e38f55dcc6487125ca1ab1f455b58d565fd397.1255499081.git.michael@ellerman.id.au>

On Tue, Oct 13, 2009 at 11:44 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
> =A0arch/powerpc/kernel/irq.c | =A0 =A05 ++++-
> =A01 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 6563221..baa49eb 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -1065,8 +1065,11 @@ static int virq_debug_show(struct seq_file *m, voi=
d *private)
> =A0 =A0 =A0 =A0seq_printf(m, "%-5s =A0%-7s =A0%-15s =A0%s\n", "virq", "hw=
irq",
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"chip name", "host name");
>
> - =A0 =A0 =A0 for (i =3D 1; i < NR_IRQS; i++) {
> + =A0 =A0 =A0 for (i =3D 1; i < nr_irqs; i++) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0desc =3D irq_to_desc(i);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!desc)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue;
> +
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0spin_lock_irqsave(&desc->lock, flags);
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (desc->action && desc->action->handler)=
 {
> --
> 1.6.2.1
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 2/6] powerpc/pseries: Use irq_has_action() in eeh_disable_irq()
From: Grant Likely @ 2009-10-14 18:33 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <1dc0d81f3202c61cbd1bb1508cb3a2ed04dc036a.1255499081.git.michael@ellerman.id.au>

On Tue, Oct 13, 2009 at 11:44 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> Rather than open-coding our own check, use irq_has_action()
> to check if an irq has an action - ie. is "in use".
>
> irq_has_action() doesn't take the descriptor lock, but it
> shouldn't matter - we're just using it as an indicator
> that the irq is in use. disable_irq_nosync() will take
> the descriptor lock before doing anything also.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Looks good to me
Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
> =A0arch/powerpc/platforms/pseries/eeh_driver.c | =A0 18 +----------------=
-
> =A01 files changed, 1 insertions(+), 17 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/p=
latforms/pseries/eeh_driver.c
> index 0e8db67..ef8e454 100644
> --- a/arch/powerpc/platforms/pseries/eeh_driver.c
> +++ b/arch/powerpc/platforms/pseries/eeh_driver.c
> @@ -63,22 +63,6 @@ static void print_device_node_tree(struct pci_dn *pdn,=
 int dent)
> =A0}
> =A0#endif
>
> -/**
> - * irq_in_use - return true if this irq is being used
> - */
> -static int irq_in_use(unsigned int irq)
> -{
> - =A0 =A0 =A0 int rc =3D 0;
> - =A0 =A0 =A0 unsigned long flags;
> - =A0 struct irq_desc *desc =3D irq_desc + irq;
> -
> - =A0 =A0 =A0 spin_lock_irqsave(&desc->lock, flags);
> - =A0 =A0 =A0 if (desc->action)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rc =3D 1;
> - =A0 =A0 =A0 spin_unlock_irqrestore(&desc->lock, flags);
> - =A0 =A0 =A0 return rc;
> -}
> -
> =A0/**
> =A0* eeh_disable_irq - disable interrupt for the recovering device
> =A0*/
> @@ -93,7 +77,7 @@ static void eeh_disable_irq(struct pci_dev *dev)
> =A0 =A0 =A0 =A0if (dev->msi_enabled || dev->msix_enabled)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return;
>
> - =A0 =A0 =A0 if (!irq_in_use(dev->irq))
> + =A0 =A0 =A0 if (!irq_has_action(dev->irq))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return;
>
> =A0 =A0 =A0 =A0PCI_DN(dn)->eeh_mode |=3D EEH_MODE_IRQ_DISABLED;
> --
> 1.6.2.1
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: MPC5200B and USB
From: Grant Likely @ 2009-10-14 18:21 UTC (permalink / raw)
  To: FIXED-TERM Seeh Thomas (BEG/EMS1); +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <6E9D235B18CE694399D781F05D9C42E7A035ADDD@SI-MBX11.de.bosch.com>

On Wed, Oct 14, 2009 at 6:57 AM, FIXED-TERM Seeh Thomas (BEG/EMS1)
<fixed-term.Thomas.Seeh@de.bosch.com> wrote:
> Hello everyone,
>
> I'm working on a project to get USB ready on a MPC5200B based board.
> On this board I'm not using Linux (but MQX), but my question is not related
> to Linux.
> It's more specific to USB and OHCI.
> I will communicate with a Mass Storage Device and therefor the control
> transfer works fine.
> The Mass Storage Device has two endpoints for bulk transfer, one IN (from
> device to host) and
> one OUT (from host to device).
>
> If I want to communicate with the device should I have two endpoints on the
> host side too?

Sounds like you need to brush up on how USB works.  The host
controller can talk to any endpoint on any device, and it schedules
the transfers for them.  There are no host-side endpoints like there
are on the device.

This question is very off-topic for this list.  You should refer to
the USB standards documentation or look for a USB specific mailing
list.  Please don't ask non-Linux questions on a Linux mailing list.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: UBIFS problem on MPC8536DS
From: Scott Wood @ 2009-10-14 18:13 UTC (permalink / raw)
  To: Felix Radensky
  Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org,
	Adrian Hunter
In-Reply-To: <4AD60EF4.4080306@embedded-sol.com>

Felix Radensky wrote:
> Yes, NAND and NOR are on the same local bus controller.
> 
> Maybe powerpc folks can provide some insight here.
> Is it possible that simultaneous access to NOR and NAND
> on MPC8536 can result in NAND timeouts ?

I've heard other reports of such problems with eLBC, but was unable to 
reproduce it myself last time I tried.  Could you reduce this down to a 
minimal set of specific reproduction instructions (e.g. eliminate UBI if 
possible, or else explain how to set up UBI)?

-Scott

^ permalink raw reply

* Re: UBIFS problem on MPC8536DS
From: Felix Radensky @ 2009-10-14 17:48 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org
In-Reply-To: <4AD5FFE7.7080703@nokia.com>



Adrian Hunter wrote:
> Felix Radensky wrote:
>> Adrian Hunter wrote:
>>> Felix Radensky wrote:
>>>> Hi,
>>>>
>>>> I have a strange problem in linux-2.6.31 running on MPC8536DS board.
>>>> It is 100% reproducible, by opening a 350MB tar file into ubifs volume
>>>> on NAND flash, and starting erase of NOR flash partition right after 
>>>> that.
>>>>
>>>> If I don't start  NOR erase, everything works fine. Also, If I run 
>>>> sync after
>>>> tar, no problem occurs.  The NOR flash is 32MB  Spansion, NAND is
>>>> 4GB Samsung.
>>>>
>>>> The error messages are as follows:
>>>>
>>>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 
>>>> 5812:12288, written 0 bytes
>>>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5812
>>>> UBI: recover PEB 5812, move data to PEB 19400
>>>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 
>>>> 5812:512, read 512 bytes
>>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>>> 19400:512, written 0 bytes
>>>> UBI warning: recover_peb: failed to write to PEB 19400
>>>> UBI: try again
>>>> UBI: recover PEB 5812, move data to PEB 19401
>>>> UBI: run torture test for PEB 19400
>>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>>> 19401:512, written 0 bytes
>>>> UBI warning: recover_peb: failed to write to PEB 19401
>>>> UBI: try again
>>>> UBI: recover PEB 5812, move data to PEB 19402
>>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>>> 19402:512, written 0 bytes
>>>> UBI warning: recover_peb: failed to write to PEB 19402
>>>> UBI: try again
>>>> UBI: recover PEB 5812, move data to PEB 19403
>>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>>> 19403:512, written 0 bytes
>>>> UBI warning: recover_peb: failed to write to PEB 19403
>>>> UBI warning: ubi_ro_mode: switch to read-only mode
>>>> UBIFS error (pid 1149): ubifs_wbuf_write_nolock: cannot write 2522 
>>>> bytes to LEB 389:10240, error -5
>>>> UBIFS warning (pid 1149): ubifs_ro_mode: switched to read-only mode, 
>>>> error -5
>>>> UBIFS error (pid 1149): do_writepage: cannot write page 0 of inode 
>>>> 30708, error -5
>>>> UBIFS error (pid 1149): make_reservation: cannot reserve 858 bytes 
>>>> in jhead 2, error -30
>>>> UBIFS error (pid 1149): do_writepage: cannot write page 2 of inode 
>>>> 29486, error -30
>>>> UBIFS error (pid 1149): make_reservation: cannot reserve 721 bytes 
>>>> in jhead 2, error -30
>>>> UBIFS error (pid 1149): do_writepage: cannot write page 1 of inode 
>>>> 30070, error -30
>>>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 
>>>> 5022:88064, written 0 bytes
>>>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5022
>>>> UBI: recover PEB 5022, move data to PEB 19404
>>>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 
>>>> 5022:512, read 512 bytes
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19404
>>>> UBI: try again
>>>> UBI: recover PEB 5022, move data to PEB 19405
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19405
>>>> UBI: try again
>>>> UBI: recover PEB 5022, move data to PEB 19406
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19406
>>>> UBI: try again
>>>> UBI: recover PEB 5022, move data to PEB 19407
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19407
>>>> UBIFS error (pid 1044): ubifs_wbuf_sync_nolock: cannot write 2048 
>>>> bytes to LEB 788:86016
>>>> UBIFS error (pid 1044): ubifs_bg_wbufs_sync: cannot sync 
>>>> write-buffer, error -30
>>>> UBIFS warning (pid 1044): ubifs_ro_mode: switched to read-only mode, 
>>>> error -30
>>>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 
>>>> 5817:26624, written 0 bytes
>>>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5817
>>>> UBI: recover PEB 5817, move data to PEB 19408
>>>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 
>>>> 5817:512, read 512 bytes
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19408
>>>> UBI: try again
>>>> UBI: recover PEB 5817, move data to PEB 19409
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19409
>>>> UBI: try again
>>>> UBI: recover PEB 5817, move data to PEB 19410
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19410
>>>> UBI: try again
>>>> UBI: recover PEB 5817, move data to PEB 19411
>>>> UBI error: ubi_io_write: read-only mode
>>>> UBI warning: recover_peb: failed to write to PEB 19411
>>>> UBIFS error (pid 1047): ubifs_wbuf_sync_nolock: cannot write 2048 
>>>> bytes to LEB 385:24576
>>>> UBIFS error (pid 1047): ubifs_bg_wbufs_sync: cannot sync 
>>>> write-buffer, error -30
>>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes 
>>>> in jhead 1, error -30
>>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30709, 
>>>> error -30
>>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes 
>>>> in jhead 1, error -30
>>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30710, 
>>>> error -30
>>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes 
>>>> in jhead 1, error -30
>>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30698, 
>>>> error -30
>>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes 
>>>> in jhead 1, error -30
>>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30711, 
>>>> error -30
>>>>
>>>> I'd appreciate any hints on what can cause this. Is it a hardware 
>>>> problem, mtd layer problem
>>>> or UBI problem ?
>>> It sounds like you are saying one MTD partition somehow affects another.
>>> You should check the MTD partitions are set up correctly.  Are you using
>>> tools that make assumptions about which mtd partition is which?
>>>
>>> How do you erase the NOR flash?  Is the device node (/dev/mtd...) 
>>> correct?
>> I can also reproduce the problem by reading from NOR, i.e.
>>
>> dd if=/dev/mtd4 of=/dev/null
> 
> I doubt the problem is in UBI or UBIFS, and plenty of people use multiple
> MTD partitions with no problem.
> 
> Do the NAND and NOR use the same memory controller?
> 
> I don't think I can be much help I'm afraid.
> 

Yes, NAND and NOR are on the same local bus controller.

Maybe powerpc folks can provide some insight here.
Is it possible that simultaneous access to NOR and NAND
on MPC8536 can result in NAND timeouts ?

Felix.

^ permalink raw reply

* [PATCH v2] net/fec_mpc52xx: Fix kernel panic on FEC error
From: Grant Likely @ 2009-10-14 17:43 UTC (permalink / raw)
  To: linuxppc-dev, netdev, davem; +Cc: John Bonesio

From: John Bonesio <bones@secretlab.ca>

The MDIO bus cannot be accessed at interrupt context, but on an FEC
error, the fec_mpc52xx driver reset function also tries to reset the
PHY.  Since the error is detected at IRQ context, and the PHY functions
try to sleep, the kernel ends up panicking.

Resetting the PHY on an FEC error isn't even necessary.  This patch
solves the problem by removing the PHY reset entirely.

Signed-off-by: John Bonesio <bones@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

v2: fixed stupid misspelling of John's email address.  No changes to content.

 drivers/net/fec_mpc52xx.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index c40113f..66dace6 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -759,12 +759,6 @@ static void mpc52xx_fec_reset(struct net_device *dev)
 
 	mpc52xx_fec_hw_init(dev);
 
-	if (priv->phydev) {
-		phy_stop(priv->phydev);
-		phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
-		phy_start(priv->phydev);
-	}
-
 	bcom_fec_rx_reset(priv->rx_dmatsk);
 	bcom_fec_tx_reset(priv->tx_dmatsk);
 

^ permalink raw reply related

* [PATCH] net/fec_mpc52xx: Fix kernel panic on FEC error
From: Grant Likely @ 2009-10-14 17:40 UTC (permalink / raw)
  To: linuxppc-dev, netdev, davem; +Cc: John Bonesio

From: John Bonesio <bonesio@secretlab.ca>

The MDIO bus cannot be accessed at interrupt context, but on an FEC
error, the fec_mpc52xx driver reset function also tries to reset the
PHY.  Since the error is detected at IRQ context, and the PHY functions
try to sleep, the kernel ends up panicking.

Resetting the PHY on an FEC error isn't even necessary.  This patch
solves the problem by removing the PHY reset entirely.

Signed-off-by: John Bonesio <bonesio@secretlab.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

Hi David,

This patch is a bug fix that definitely needs to go in for 2.6.32.
I'll also be asking Greg to pick it up for the stable tree once it
is in mainline.

Thanks,
g.

 drivers/net/fec_mpc52xx.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index c40113f..66dace6 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -759,12 +759,6 @@ static void mpc52xx_fec_reset(struct net_device *dev)
 
 	mpc52xx_fec_hw_init(dev);
 
-	if (priv->phydev) {
-		phy_stop(priv->phydev);
-		phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
-		phy_start(priv->phydev);
-	}
-
 	bcom_fec_rx_reset(priv->rx_dmatsk);
 	bcom_fec_tx_reset(priv->tx_dmatsk);
 

^ permalink raw reply related

* Re: [PATCH 0/8] Fix 8xx MMU/TLB.
From: Scott Wood @ 2009-10-14 17:23 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <1255278912-8042-1-git-send-email-Joakim.Tjernlund@transmode.se>

On Sun, Oct 11, 2009 at 06:35:04PM +0200, Joakim Tjernlund wrote:
> This is the latest batch of mu 8xx MMU/TLB rework.
> I think this is complete now and will relax with
> other work the next few days. I hope I can get some
> testing from Scott and Rex during this time.

I applied this stack plus "Remove DIRTY pte handling in DTLB Error" (fixing
up conflicts again, as well as the noted build errors), and got this:

INIT: version 2.85 booting
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
udevd[177]: add_to_rules: unknown key 'MODALIAS' in /etc/udev/rules.d/60-pcmcia.rules:4
udevd[177]: add_to_rules: unknown key 'MODALIAS' in /etc/udev/rules.d/60-pcmcia.rules:10
udevd[177]: add_to_rules: unknown key 'MODALIAS' in /etc/udev/rules.d/60-pcmcia.rules:14
Synthesizing initial hotplug events
/etc/rc.d/init.d/udev: line 41:   187 Segmentation fault      udevsettle --timeout=300
Setting the hostname to 8xx
Running depmod
WARNING: Couldn't open directory /lib/modules/2.6.31-08384-g2cb4b47-dirty: No such file or directory
FATAL: Could not open /lib/modules/2.6.31-08384-g2cb4b47-dirty/modules.dep.tempfor writing: No such file or directory
Mounting filesystems
BUG: soft lockup - CPU#0 stuck for 61s! [cat:265]
NIP: c000f160 LR: c000f160 CTR: 00000007
REGS: c3919c70 TRAP: 0901   Not tainted  (2.6.31-08384-g2cb4b47-dirty)
MSR: 00009032 <EE,ME,IR,DR>  CR: 88008424  XER: 00000000
TASK = c3944bd0[265] 'cat' THREAD: c3918000
GPR00: c000f160 c3919d20 c3944bd0 00000000 100180fc 00000000 00000000 00000001
GPR08: c393e700 00000000 03ca9d21 00000001 48000428
NIP [c000f160] do_page_fault+0x188/0x49c
LR [c000f160] do_page_fault+0x188/0x49c
Call Trace:
[c3919d20] [c000f160] do_page_fault+0x188/0x49c (unreliable)
[c3919dd0] [c000e3f0] handle_page_fault+0xc/0x80
[c3919e90] [c008910c] seq_read+0x2a4/0x558
[c3919ee0] [c00ab7c0] proc_reg_read+0x4c/0x70
[c3919ef0] [c006f47c] vfs_read+0xb4/0x158
[c3919f10] [c006f78c] sys_read+0x4c/0x90
[c3919f40] [c000dfc0] ret_from_syscall+0x0/0x38
Instruction dump:
2f990000 419e01f0 801f0014 700a0002 418201f8 7c1900d0 541e0ffe 7fe4fb78
7f85e378 7fc6f378 7f63db78 4804c31d <70690003> 7c601b78 40820230 70690004

-Scott

^ permalink raw reply

* Re: [PATCH 4/8] 8xx: Fixup DAR from buggy dcbX instructions.
From: Scott Wood @ 2009-10-14 17:20 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <1255278912-8042-5-git-send-email-Joakim.Tjernlund@transmode.se>

On Sun, Oct 11, 2009 at 06:35:08PM +0200, Joakim Tjernlund wrote:
> This is an assembler version to fixup DAR not being set
> by dcbX, icbi instructions. There are two versions, one
> uses selfmodifing code, the other uses a
> jump table but is much bigger(default).
> ---
>  arch/powerpc/kernel/head_8xx.S |  146 +++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 145 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
> index 093176c..9839e79 100644
> --- a/arch/powerpc/kernel/head_8xx.S
> +++ b/arch/powerpc/kernel/head_8xx.S
> @@ -494,7 +494,8 @@ DataTLBError:
>  
>  	mfspr	r10, SPRN_DAR
>  	cmpwi	cr0, r10, 0x00f0
> -	beq-	2f	/* must be a buggy dcbX, icbi insn. */
> +	beq-	FixDAR	/* must be a buggy dcbX, icbi insn. */
> +DARFix:	/* Return from dcbx instruction bug workaround, r10 holds value of DAR */

Both FixDAR and DARFix?  Could we make the labels a little clearer?

> +/* This is the procedure to calculate the data EA for buggy dcbx,dcbi instructions
> + * by decoding the registers used by the dcbx instruction and adding them.
> + * DAR is set to the calculated address and r10 also holds the EA on exit.
> + */

How often does this happen?  Could we just do it in C code after saving all
the registers, and avoid the self modifying stuff (or the big switch
statement equivalent)?

-Scott

^ permalink raw reply

* Re: MPC5200B panics with high ethernet rx traffic
From: Grant Likely @ 2009-10-14 17:07 UTC (permalink / raw)
  To: Asier Llano Palacios; +Cc: linuxppc-dev
In-Reply-To: <1255538154.26753.13.camel@allano>

On Wed, Oct 14, 2009 at 10:35 AM, Asier Llano Palacios <a.llano@ziv.es> wrote:
> Hi,
>
> I've found a very simple way to create a kernel panic, that's happening
> to our MPC5200B based boards. The issue was that when our boards
> received a burst of ethernet packets had a kernel panic.

This looks familiar.  Look in drivers/net/fec_mpc52xx.c and find the
function mpc52xx_fec_reset().  Remove the calls to phy_stop(),
phy_write() and phy_start().  See if that helps.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH 5/8] 8xx: dcbst sets store bit in DTLB error, workaround.
From: Scott Wood @ 2009-10-14 17:02 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <1255278912-8042-6-git-send-email-Joakim.Tjernlund@transmode.se>

On Sun, Oct 11, 2009 at 06:35:09PM +0200, Joakim Tjernlund wrote:
>  DARFix:	/* Return from dcbx instruction bug workaround, r10 holds value of DAR */
[snip]
> +	b	DARfix		/* Nope, go back to normal TLB processing */

arch/powerpc/kernel/head_8xx.S:577: undefined reference to `DARfix'

-Scott

^ permalink raw reply

* Re: [PATCH 2/8] 8xx: Update TLB asm so it behaves as linux mm expects.
From: Scott Wood @ 2009-10-14 16:57 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <1255278912-8042-3-git-send-email-Joakim.Tjernlund@transmode.se>

On Sun, Oct 11, 2009 at 06:35:06PM +0200, Joakim Tjernlund wrote:
> +	mfspr	r11, SRR1
> +	/* clear all error bits as TLB Miss
> +	 * sets a few unconditionally
> +	*/
> +	rlwinm	r11, r11, 0, 0xffff
> +	mtspr	SRR1, r11

arch/powerpc/kernel/head_8xx.S:369: Error: unsupported relocation against SRR1
arch/powerpc/kernel/head_8xx.S:374: Error: unsupported relocation against SRR1

-Scott

^ permalink raw reply

* Re: [PATCH 1/8] 8xx: invalidate non present TLBs
From: Scott Wood @ 2009-10-14 16:56 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: Rex Feany, linuxppc-dev@ozlabs.org
In-Reply-To: <1255278912-8042-2-git-send-email-Joakim.Tjernlund@transmode.se>

On Sun, Oct 11, 2009 at 06:35:05PM +0200, Joakim Tjernlund wrote:
> 8xx sometimes need to load a invalid/non-present TLBs in
> it DTLB asm handler.
> These must be invalidated separaly as linux mm don't.
> ---
>  arch/powerpc/mm/fault.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
> index 7699394..72941c7 100644
> --- a/arch/powerpc/mm/fault.c
> +++ b/arch/powerpc/mm/fault.c
> @@ -39,7 +39,7 @@
>  #include <asm/uaccess.h>
>  #include <asm/tlbflush.h>
>  #include <asm/siginfo.h>
> -
> +#include <mm/mmu_decl.h>
>  
>  #ifdef CONFIG_KPROBES
>  static inline int notify_page_fault(struct pt_regs *regs)
> @@ -243,6 +243,12 @@ good_area:
>  		goto bad_area;
>  #endif /* CONFIG_6xx */
>  #if defined(CONFIG_8xx)
> +	/* 8xx sometimes need to load a invalid/non-present TLBs.
> +	 * These must be invalidated separately as linux mm don't.
> +	 */
> +	if (error_code & 0x40000000) /* no translation? */
> +		_tlbil_va(address);

arch/powerpc/mm/fault.c:253: error: too few arguments to function ‘_tlbil_va’

-Scott

^ permalink raw reply

* MPC5200B panics with high ethernet rx traffic
From: Asier Llano Palacios @ 2009-10-14 16:35 UTC (permalink / raw)
  To: linuxppc-dev, Grant Likely

[-- Attachment #1: Type: text/plain, Size: 3081 bytes --]

Hi,

I've found a very simple way to create a kernel panic, that's happening
to our MPC5200B based boards. The issue was that when our boards
received a burst of ethernet packets had a kernel panic.

It does also happen to a lite5200b evaluation board, and it is really
simple to reproduce:
 Step 1: Configure the jumpers of the board as:
    CFG 4: L
    CFG 3: L
    CFG 2: H
    CFG 1: L
    CFG 0: L
    --------
    XLB:   L
    SYS:   L
    FVCO:  L
    MG:    L
    LF:    L
    HI/LO: L (but it depends on where do you have the bootloader)
    WAIT:  H
    SWAP:  L
    WIDE:  L
    MUXED: L
 Step 2: Connect an ethernet cable from the board to a 100Mbit
         ethernet switch.
 Step 3: Make a loop in the switch connecting two other ports together
         (I know this is weird but it is the simplest way I know
          to generate an intensive traffic).
 Step 4: Power up the board
 Step 5: ifconfig 192.168.0.1
 Step 6: ping 192.168.0.123

The ping generates an ARP packet (which is broadcast), then with the
loop of the switch the board will receive a storm of ARP packets
(probably near 100Mbits). Then the board configured with 266MHz core
will panic.

It happens to me in Linux versions from 2.6.22 to 2.6.28, with
bootloaders from 1.1.6 to 2009.08. It doesn't happen if you change the
jumpers (CFG 3: H, CFG 1: H) increasing the Core frequency. I'm planning
to test it with 2.6.31 but I still have another issues to test this.

I provide a log with the kernel panic.

We could assume that the CPU usage goes really high. We could also
assume that the packets that cannot be processed are dropped. We cannot
assume a kernel panic because during one second the reception traffic in
the ethernet was too high.

If you want more information or want us to perform more testing I would
gladly try to help. Maybe you can test it with your versions of software
and your board.

Your help would be greatly appreciated,
Asier 
 
----------------------------------------- PLEASE NOTE -------------------------------------------
This message, along with any attachments, may be confidential or legally privileged. 
It is intended only for the named person(s), who is/are the only authorized recipients.
If this message has reached you in error, kindly destroy it without review and notify the sender immediately.
Thank you for your help.
ZIV uses virus scanning software but excludes any liability for viruses contained in any attachment.
 
------------------------------------ ROGAMOS LEA ESTE TEXTO -------------------------------
Este mensaje y sus anexos pueden contener información confidencial y/o con derecho legal. 
Está dirigido únicamente a la/s persona/s o entidad/es reseñadas como único destinatario autorizado.
Si este mensaje le hubiera llegado por error, por favor elimínelo sin revisarlo ni reenviarlo y notifíquelo inmediatamente al remitente. Gracias por su colaboración.  
ZIV utiliza software antivirus, pero no se hace responsable de los virus contenidos en los ficheros anexos.

[-- Attachment #2: kernel_log.txt --]
[-- Type: text/plain, Size: 7486 bytes --]

U-Boot 2009.08 (oct 14 2009 - 13:00:56)

CPU:   MPC5200B v2.2, Core v1.4 at 330 MHz
       Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
Board: Freescale Lite5200B
I2C:   85 kHz, ready
DRAM:  256 MB
FLASH: 32 MB
*** Warning - bad CRC, using default environment

PCI:   Bus Dev VenId DevId Class Int
        00  1a  1057  5809  0680  00
In:    serial
Out:   serial
Err:   serial
Net:   FEC ETHERNET
IDE:   Bus 0: OK 
  Device 0: not available
  Device 1: not available

Type "run flash_nfs" to mount root filesystem over NFS

Hit any key to stop autoboot:  0 
## Booting kernel from Legacy Image at ff042000 ...
   Image Name:   linux-2.6.28.10
   Created:      2009-10-14  11:01:27 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1045251 Bytes = 1020.8 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at ff040000
   Booting using the fdt blob at 0xff040000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 007fb000, end 007ff68d ... OK
Using lite5200 machine description
Linux version 2.6.28.10-uSysCom (asier@allano) (gcc version 4.3.4 (GCC) ) #7 PREEMPT Wed Oct 14 13:01:26 CEST 2009
Top of RAM: 0x1000000, Total RAM: 0x1000000
Memory hole size: 0MB
Zone PFN ranges:
  DMA      0x00000000 -> 0x00001000
  Normal   0x00001000 -> 0x00001000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00001000
On node 0 totalpages: 4096
free_area_init_node: node 0, pgdat c0231850, node_mem_map c025c000
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 0 pages used for memmap
  Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
Kernel command line: console=ttyPSC0,115200 root=/dev/mtdblock3 rw irqpoll mtdparts=physmap-flash.0:192k(boot),64k(conf),1280k(linux),-(root)
Misrouted IRQ fixup and polling support enabled
This may significantly impact system performance
MPC52xx PIC is up and running!
PID hash table entries: 64 (order: 6, 256 bytes)
time_init: decrementer frequency = 33.000000 MHz
time_init: processor frequency   = 330.000000 MHz
clocksource: timebase mult[79364d9] shift[22] registered
clockevent: decrementer mult[872] shift[16] cpu[0]
console [ttyPSC0] enabled
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 13808k/16384k available (2136k kernel code, 2576k reserved, 116k data, 120k bss, 148k init)
Calibrating delay loop... 65.79 BogoMIPS (lpj=32896)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
DMA: MPC52xx BestComm driver
DMA: MPC52xx BestComm engine @f0001200 ok !
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
mpc5200_gpio_legacy: Freescale MPC5200 GPIO legacy Driver
MPC5200 WKUP GPIOs mapped
MPC5200 Simple GPIOs mapped
MPC5200 GPT0 GPIO mapped
MPC5200 GPT1 GPIO mapped
MPC5200 GPT2 GPIO mapped
MPC5200 GPT3 GPIO mapped
MPC5200 GPT4 GPIO mapped
MPC5200 GPT5 GPIO mapped
MPC5200 GPT6 GPIO mapped
MPC5200 GPT7 GPIO mapped
mpc5200_gpio_legacy: got dynamic major 254
squashfs: version 3.4 (2008/08/26) Phillip Lougher
msgmni has been set to 26
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered (default)
Serial: MPC52xx PSC UART driver
f0002000.serial: ttyPSC0 at MMIO 0xf0002000 (irq = 129) is a MPC52xx PSC
brd: module loaded
loop: module loaded
mpc52xx MII bus: probed
mpc52xx-fec: miibus_handle found
mpc52xx-fec: miibus_node found
net eth0: Fixed speed MII link: 100FD
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
physmap platform flash device: 01000000 at ff000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 8-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
physmap-flash.0: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
4 cmdlinepart partitions found on MTD device physmap-flash.0
Creating 4 MTD partitions on "physmap-flash.0":
0x00000000-0x00030000 : "boot"
mtd: partition "boot" doesn't end on an erase block -- force read-only
0x00030000-0x00040000 : "conf"
mtd: partition "conf" doesn't start on an erase block boundary -- force read-only
0x00040000-0x00180000 : "linux"
0x00180000-0x01000000 : "root"
i2c /dev entries driver
Driver for 1-wire Dallas network protocol.
MC33701 Watchdog Timer Driver v0.1
i2c-adapter i2c-0: Invalid probe address 0x78
i2c-adapter i2c-1: Invalid probe address 0x78
nf_conntrack version 0.5.0 (256 buckets, 1024 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 15
VFS: Mounted root (squashfs filesystem) readonly.
Freeing unused kernel memory: 148k init
init started: BusyBox v1.14.4 (2009-09-29 12:25:23 CEST)
starting pid 202, tty '/dev/ttyPSC0': '/etc/rcS'
+ /bin/sleep 5
+ /sbin/ifconfig eth0 192.168.0.1 up
mpc52xx-fec: Trying ot access the MDIO bus
+ /bin/ping 192.168.0.5
PING 192.168.0.5 (192.168.0.5): 56 data bytes
net eth0: FEC_IEVENT_RFIFO_ERROR
Unable to handle kernel paging request for data at address 0x000001b8
Faulting instruction address: 0xc01adfe8
Oops: Kernel access of bad area, sig: 11 [#1]
PREEMPT lite5200
Modules linked in:
NIP: c01adfe8 LR: c00f7a64 CTR: c000fb88
REGS: c0235ad0 TRAP: 0300   Not tainted  (2.6.28.10-uSysCom)
MSR: 00009032 <EE,ME,IR,DR>  CR: 22008082  XER: 20000000
DAR: 000001b8, DSISR: 20000000
TASK = c0218580[0] 'swapper' THREAD: c0234000
GPR00: c00fa928 c0235b80 c0218580 000001b8 c0d0bec0 00000000 00000002 00000000 
GPR08: 000005f8 c208a000 000000c0 c025c000 42008084 7ffffdff 0ffb9000 0ffae948 
GPR16: 0ffae96c 0ff45ccc 0ff45dcc 0ff45be9 c0246ed0 c01d24d4 c021a9cc c023c21c 
GPR24: c07ee2bc c0219598 c07ee380 c07ee000 c07ee380 c208a000 000001b8 00000000 
Call Trace:
[c0235b80] [c208a000] 0xc208a000 (unreliable)
[c0235b90] [c00fa928] 0xc00fa928
[c0235bb0] [c00fab14] 0xc00fab14
[c0235bc8] [c00436e8] 0xc00436e8
[c0235be0] [c0045694] 0xc0045694
[c0235bf8] [c0006160] 0xc0006160
[c0235c08] [c0010a34] 0xc0010a34
--- Exception: 501 at 0xc00645b8
    LR = 0xc00645a8
[c0235ce0] [c0126fdc] 0xc0126fdc
[c0235d00] [c0127a20] 0xc0127a20
[c0235d08] [c00fb630] 0xc00fb630
[c0235d50] [c00436e8] 0xc00436e8
[c0235d68] [c0045694] 0xc0045694
[c0235d80] [c0006160] 0xc0006160
[c0235d90] [c0010a34] 0xc0010a34
--- Exception: 501 at 0xc012bd50
    LR = 0xc0023104
[c0235e50] [00000102] 0x000102 (unreliable)
[c0235e70] [c0023104] 0xc0023104
[c0235ea8] [c00060d0] 0xc00060d0
[c0235eb8] [c0022d78] 0xc0022d78
[c0235ec0] [c000d63c] 0xc000d63c
[c0235ed0] [c0010a34] 0xc0010a34
--- Exception: 901 at 0xc0008f70
    LR = 0xc0008f70
[c0235f90] [c0008fb8] 0xc0008fb8 (unreliable)
[c0235fa8] [c01af91c] 0xc01af91c
[c0235fc0] [c01f177c] 0xc01f177c
[c0235ff0] [00003438] 0x003438
Instruction dump:
812b000c 3929ffff 912b000c 800b0034 70090004 41a20008 4bfff4c9 8001003c 
bb21001c 38210038 7c0803a6 4e800020 <7c001828> 3000ffff 7c00192d 40a2fff4 
Kernel panic - not syncing: Fatal exception in interrupt
Rebooting in 180 seconds..


^ permalink raw reply

* Re: UBIFS problem on MPC8536DS
From: Adrian Hunter @ 2009-10-14 16:44 UTC (permalink / raw)
  To: Felix Radensky; +Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org
In-Reply-To: <4AD5D053.9000901@embedded-sol.com>

Felix Radensky wrote:
> Adrian Hunter wrote:
>> Felix Radensky wrote:
>>> Hi,
>>>
>>> I have a strange problem in linux-2.6.31 running on MPC8536DS board.
>>> It is 100% reproducible, by opening a 350MB tar file into ubifs volume
>>> on NAND flash, and starting erase of NOR flash partition right after 
>>> that.
>>>
>>> If I don't start  NOR erase, everything works fine. Also, If I run 
>>> sync after
>>> tar, no problem occurs.  The NOR flash is 32MB  Spansion, NAND is
>>> 4GB Samsung.
>>>
>>> The error messages are as follows:
>>>
>>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 
>>> 5812:12288, written 0 bytes
>>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5812
>>> UBI: recover PEB 5812, move data to PEB 19400
>>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 
>>> 5812:512, read 512 bytes
>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>> 19400:512, written 0 bytes
>>> UBI warning: recover_peb: failed to write to PEB 19400
>>> UBI: try again
>>> UBI: recover PEB 5812, move data to PEB 19401
>>> UBI: run torture test for PEB 19400
>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>> 19401:512, written 0 bytes
>>> UBI warning: recover_peb: failed to write to PEB 19401
>>> UBI: try again
>>> UBI: recover PEB 5812, move data to PEB 19402
>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>> 19402:512, written 0 bytes
>>> UBI warning: recover_peb: failed to write to PEB 19402
>>> UBI: try again
>>> UBI: recover PEB 5812, move data to PEB 19403
>>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 
>>> 19403:512, written 0 bytes
>>> UBI warning: recover_peb: failed to write to PEB 19403
>>> UBI warning: ubi_ro_mode: switch to read-only mode
>>> UBIFS error (pid 1149): ubifs_wbuf_write_nolock: cannot write 2522 
>>> bytes to LEB 389:10240, error -5
>>> UBIFS warning (pid 1149): ubifs_ro_mode: switched to read-only mode, 
>>> error -5
>>> UBIFS error (pid 1149): do_writepage: cannot write page 0 of inode 
>>> 30708, error -5
>>> UBIFS error (pid 1149): make_reservation: cannot reserve 858 bytes in 
>>> jhead 2, error -30
>>> UBIFS error (pid 1149): do_writepage: cannot write page 2 of inode 
>>> 29486, error -30
>>> UBIFS error (pid 1149): make_reservation: cannot reserve 721 bytes in 
>>> jhead 2, error -30
>>> UBIFS error (pid 1149): do_writepage: cannot write page 1 of inode 
>>> 30070, error -30
>>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 
>>> 5022:88064, written 0 bytes
>>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5022
>>> UBI: recover PEB 5022, move data to PEB 19404
>>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 
>>> 5022:512, read 512 bytes
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19404
>>> UBI: try again
>>> UBI: recover PEB 5022, move data to PEB 19405
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19405
>>> UBI: try again
>>> UBI: recover PEB 5022, move data to PEB 19406
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19406
>>> UBI: try again
>>> UBI: recover PEB 5022, move data to PEB 19407
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19407
>>> UBIFS error (pid 1044): ubifs_wbuf_sync_nolock: cannot write 2048 
>>> bytes to LEB 788:86016
>>> UBIFS error (pid 1044): ubifs_bg_wbufs_sync: cannot sync 
>>> write-buffer, error -30
>>> UBIFS warning (pid 1044): ubifs_ro_mode: switched to read-only mode, 
>>> error -30
>>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB 
>>> 5817:26624, written 0 bytes
>>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5817
>>> UBI: recover PEB 5817, move data to PEB 19408
>>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 
>>> 5817:512, read 512 bytes
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19408
>>> UBI: try again
>>> UBI: recover PEB 5817, move data to PEB 19409
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19409
>>> UBI: try again
>>> UBI: recover PEB 5817, move data to PEB 19410
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19410
>>> UBI: try again
>>> UBI: recover PEB 5817, move data to PEB 19411
>>> UBI error: ubi_io_write: read-only mode
>>> UBI warning: recover_peb: failed to write to PEB 19411
>>> UBIFS error (pid 1047): ubifs_wbuf_sync_nolock: cannot write 2048 
>>> bytes to LEB 385:24576
>>> UBIFS error (pid 1047): ubifs_bg_wbufs_sync: cannot sync 
>>> write-buffer, error -30
>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in 
>>> jhead 1, error -30
>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30709, 
>>> error -30
>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in 
>>> jhead 1, error -30
>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30710, 
>>> error -30
>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in 
>>> jhead 1, error -30
>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30698, 
>>> error -30
>>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in 
>>> jhead 1, error -30
>>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30711, 
>>> error -30
>>>
>>> I'd appreciate any hints on what can cause this. Is it a hardware 
>>> problem, mtd layer problem
>>> or UBI problem ?
>> It sounds like you are saying one MTD partition somehow affects another.
>> You should check the MTD partitions are set up correctly.  Are you using
>> tools that make assumptions about which mtd partition is which?
>>
>> How do you erase the NOR flash?  Is the device node (/dev/mtd...) 
>> correct?
> I can also reproduce the problem by reading from NOR, i.e.
> 
> dd if=/dev/mtd4 of=/dev/null

I doubt the problem is in UBI or UBIFS, and plenty of people use multiple
MTD partitions with no problem.

Do the NAND and NOR use the same memory controller?

I don't think I can be much help I'm afraid.

^ permalink raw reply

* Re: [Cbe-oss-dev] [PATCH] spufs: Fix test in spufs_switch_log_read()
From: Roel Kluin @ 2009-10-14 15:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: cbe-oss-dev, linuxppc-dev, Jeremy Kerr, Andrew Morton,
	linuxppc-dev, cbe-oss-dev
In-Reply-To: <200910131531.45726.arnd@arndb.de>

size_t len cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
>>> Or can this test be removed?
>>
>> I'd prefer just to remove the test.
> 
> Yes, sounds good.

If you meant only the left-hand part, here you go:

diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 884e8bc..64a4c2d 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -2494,7 +2494,7 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
 	struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
 	int error = 0, cnt = 0;
 
-	if (!buf || len < 0)
+	if (!buf)
 		return -EINVAL;
 
 	error = spu_acquire(ctx);

^ permalink raw reply related

* [PATCH] therm_adt746x: Don't access non-existing register
From: Jean Delvare @ 2009-10-14 15:31 UTC (permalink / raw)
  To: Colin Leroy, Tim Shepard; +Cc: linuxppc-dev, Paul Mackerras

The ADT746x don't have any register at sub-address 0, so better use an
existing register for the initial test read.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Colin Leroy <colin@colino.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
---
Tim, I don't really expect this to solve your problem, but who knows...
Care to give it a try, just in case?

 drivers/macintosh/therm_adt746x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.32-rc4.orig/drivers/macintosh/therm_adt746x.c	2009-10-12 11:53:59.000000000 +0200
+++ linux-2.6.32-rc4/drivers/macintosh/therm_adt746x.c	2009-10-14 17:27:46.000000000 +0200
@@ -387,7 +387,7 @@ static int probe_thermostat(struct i2c_c
 	i2c_set_clientdata(client, th);
 	th->clt = client;
 
-	rc = read_reg(th, 0);
+	rc = read_reg(th, CONFIG_REG);
 	if (rc < 0) {
 		dev_err(&client->dev, "Thermostat failed to read config!\n");
 		kfree(th);


-- 
Jean Delvare

^ permalink raw reply

* Re: [PATCH] * mpc8313erdb.dts: Fixed eTSEC interrupt assignment.
From: Scott Wood @ 2009-10-14 15:27 UTC (permalink / raw)
  To: Richard Cochran
  Cc: 'linuxppc-dev@lists.ozlabs.org', 'Roland Lezuo'
In-Reply-To: <95DC1AA8EC908B48939B72CF375AA5E30E220693@alice.at.omicron.at>

On Wed, Oct 14, 2009 at 09:41:33AM +0200, Richard Cochran wrote:
> >-----Original Message-----
> >From: linuxppc-dev-bounces On Behalf Of Scott Wood
> >Sent: Wednesday, September 09, 2009 8:22 PM
> >To: Roland Lezuo
> >Cc: linuxppc-dev@lists.ozlabs.org
> >Subject: Re: [PATCH] * mpc8313erdb.dts: Fixed eTSEC interrupt assignment.
> >
> >On Fri, Sep 04, 2009 at 12:31:25PM +0200, Roland Lezuo wrote:
> >> The following patch is needed to correctly assign the IRQs for the
> >> gianfar driver on the MPC8313ERDB-revc boards. ERR and TX are swapped
> >> as well as the interrupt lines for the two devices.
> >
> >And it will incorrectly assign them on older revisions of the chip.
> >
> >We really should have a u-boot fixup based on SVR.
> 
> Why not just offer different dts files, one for each board revision?
> 
> Something like:
> mpc8313erdb-revA.dts
> mpc8313erdb-revB.dts
> mpc8313erdb-revC.dts

Because that would be three times the device trees to maintain, and a
source of user confusion.

-Scott

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox