From: dk-arm-linux@gmx.de (Dieter Kiermaier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [ARM] Kirkwood: Prevent kernel from crashing if PCIe bridge is present
Date: Fri, 13 Nov 2009 08:26:27 +0100 [thread overview]
Message-ID: <200911130826.30592.dk-arm-linux@gmx.de> (raw)
In-Reply-To: <20091112193713.GG22741@mail.wantstofly.org>
Hi Lennert,
> On Thu, Nov 12, 2009 at 06:19:42AM -0800, Dieter Kiermaier wrote:
>
> > Below you can find a first version of the patch which enables PCI on my openrd-base board
> > together with a PCIe->PCI bridge.
> > Please let me know if something is wrong with it.
> >
> > [...]
> >
> > Subject: [PATCH] [ARM] Kirkwood: Prevent kernel from crashing if PCIe bridge is present
>
> In the end, this is what the patch does, but the issue it solves is (at
> least in theory) not specific to PCI.
>
>
> > If this bit isn't disabled kernel crash during bootup when booted
> > with current mainline u-boot (version U-Boot 2009.08-00208-g9ef0569)
> > and a PCIe -> PCI bridge is connected to the system.
>
> And this should really explain why the crash happens (which is because
> there is a PCI master abort because the PCI scanning code probes all
> possible device IDs on the secondary side of the bridge).
thanks for being patient and explain it that even a newbie can understand what's going on here!
>
>
> > diff --git a/arch/arm/mach-kirkwood/openrd_base-setup.c b/arch/arm/mach-kirkwood/openrd_base-setup.c
> > index 77617c7..9e57326 100644
> > --- a/arch/arm/mach-kirkwood/openrd_base-setup.c
> > +++ b/arch/arm/mach-kirkwood/openrd_base-setup.c
>
> This issue is not OpenRD-specific, so shouldn't be handled in the
> OpenRD board setup file.
>
>
> > static int __init openrd_base_pci_init(void)
> > {
> > + u32 cpu_config_reg;
> > + void __iomem *base;
> > + base = ioremap(0xf1020100, 4);
> > + if (base)
> > + {
> > + cpu_config_reg = readl(base);
> > + cpu_config_reg &= ~(1 << 2);
> > + writel(cpu_config_reg, base);
> > + }
> > + iounmap(base);
>
> There's no need to ioremap/iounmap -- the 1MB block of CPU peripheral
> registers is permanently mapped into the kernel virtual address
> region.
>
> How about something like this instead? (Since you did most of the work
> I don't mind having you as the From: on the patch.)
>
Your version looks much more comprehensible so I would prefer your's.
And I've no problem with not being mentioned "from:" because most of the
work is done by Maxime, Alexander and yourself!
I've only triggered it - so reported by fits fine!
Will this patch together with Maximes patch:
http://lists.infradead.org/pipermail/linux-arm-kernel/2009-November/003784.html
applied to marvell orion.git and also upstream?
Dieter
>
>
> commit 728ae3400ef8fc3da10491d48e6832b6bb7aa281
> Author: Lennert Buytenhek <buytenh@wantstofly.org>
> Date: Thu Nov 12 20:31:14 2009 +0100
>
> [ARM] Kirkwood: disable propagation of mbus error to the CPU local bus
>
> Disable propagation of mbus errors to the CPU local bus, as this causes
> mbus errors (which can occur for example for PCI aborts) to throw CPU
> aborts, which we're not set up to deal with.
>
> Reported-by: Dieter Kiermaier <dk-arm-linux@gmx.de>
> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
>
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 0acb61f..96c98c2 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -915,6 +915,14 @@ void __init kirkwood_init(void)
> kirkwood_uart0_data[0].uartclk = kirkwood_tclk;
> kirkwood_uart1_data[0].uartclk = kirkwood_tclk;
>
> + /*
> + * Disable propagation of mbus errors to the CPU local bus,
> + * as this causes mbus errors (which can occur for example
> + * for PCI aborts) to throw CPU aborts, which we're not set
> + * up to deal with.
> + */
> + writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
> +
> kirkwood_setup_cpu_mbus();
>
> #ifdef CONFIG_CACHE_FEROCEON_L2
> diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> index 9e80d92..418f501 100644
> --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> @@ -13,6 +13,9 @@
>
> #include <mach/kirkwood.h>
>
> +#define CPU_CONFIG (BRIDGE_VIRT_BASE | 0x0100)
> +#define CPU_CONFIG_ERROR_PROP 0x00000004
> +
> #define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104)
> #define CPU_RESET 0x00000002
>
> --
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
next prev parent reply other threads:[~2009-11-13 7:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 14:19 [PATCH] [ARM] Kirkwood: Prevent kernel from crashing if PCIe bridge is present Dieter Kiermaier
2009-11-12 15:42 ` [PATCH] [ARM] Kirkwood: Prevent kernel from crashing if PCIe bridge?is present Alexander Clouter
2009-11-12 17:02 ` Dieter Kiermaier
2009-11-12 18:52 ` [PATCH] [ARM] Kirkwood: Prevent kernel from crashing if PCIe?bridge?is present Alexander Clouter
2009-11-13 7:50 ` [PATCH] [ARM] Kirkwood: Prevent kernel from crashing if PCIe bridge?is present Simon Kagstrom
2009-11-12 19:37 ` [PATCH] [ARM] Kirkwood: Prevent kernel from crashing if PCIe bridge is present Lennert Buytenhek
2009-11-13 7:26 ` Dieter Kiermaier [this message]
2009-11-12 20:55 ` Russell King - ARM Linux
2009-11-13 7:50 ` Dieter Kiermaier
2009-11-13 23:19 ` Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200911130826.30592.dk-arm-linux@gmx.de \
--to=dk-arm-linux@gmx.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.