All of lore.kernel.org
 help / color / mirror / Atom feed
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: Thu, 12 Nov 2009 18:02:10 +0100	[thread overview]
Message-ID: <200911121802.10323.dk-arm-linux@gmx.de> (raw)
In-Reply-To: <p0nts6-gt3.ln1@chipmunk.wormnet.eu>

Am Donnerstag 12 November 2009 16:42:49 schrieb Alexander Clouter:
> Dieter Kiermaier <dk-arm-linux@gmx.de> wrote:
> >
> > [snipped]
> > 
> > static int __init openrd_base_pci_init(void)
> > {
> > +       u32 cpu_config_reg;
> > +       void __iomem *base;
> > +       base = ioremap(0xf1020100, 4);
> >
> Ewwwwwwww. :)
> 
> If you dig through arch/arm/mach-orion5x/include/mach/orion5x.h you 
> should be able to work out that 0xf1020100 is probably best replaced 
> with something like (ORION5X_BRIDGE_PHYS_BASE | 0x100), once you add
> a matching ORION5X_BRIDGE_PHYS_BASE entry alongside the
> ORION5X_BRIDGE_VIRT_BASE[1].  Well, *I* prefer that sort of thing. :)
> 
> > +       if (base)
> > +       {
> > +               cpu_config_reg = readl(base);
> > +               cpu_config_reg &= ~(1 << 2);
> > +               writel(cpu_config_reg, base);
> > +       }
> > +       iounmap(base);
> > +
> >        if (machine_is_openrd_base())
> >                kirkwood_pcie_init();
> > -
> >        return 0;
> >  }
> > subsys_initcall(openrd_base_pci_init);
> >
> As was recently explained to me[2], that code is going to run on *all* 
> kirkword platforms, not just the OpenRD.  I am guessing you want to 
> shove your additional code into a seperate int returning __init function 
> and call it from the machine_is_openrd_base() clause.
> 

If we go on thinking about that - I would prefer place the code - without the magick key ;) - 
in kirkwood_pcie_init()?
It will affect later or sooner more kirkwood boards if people switch form marvell stock u-boot
to mainline u-boot.
What do you think about that?

to [2]:
Hm, is this really right? Why is there a function called openrd_base_pci_init() which is inside a file
called openrd_base-setup.c and this function is called on a sheevaplug?

I couldn't believe that (but to be honest I don't know it!).
The 2 board do still have different machnumbers, right?
I've expected that these machnumbers are to determine
which board / hardware the kernel / u-boot is running.
Isn't this the case?

> Also, if for some strange reason the ioremap() failed, you are going to 
> call iounmap(NULL) so that should probably be moved up a line into the 
> 'if' clause?  However on this one I *think* I have been told in the past 
> it cannot fail so you might be able to remove the 'if' clause 
> altogether.
sounds reasonable

> 
> Cheers
> 
> [1] unsure if at that point can can just jump straight in and tinker with
> 	ORION5X_BRIDGE_VIRT_BASE?
> [2] http://lists.infradead.org/pipermail/linux-arm-kernel/2009-October/002699.html
> 

Dieter

  reply	other threads:[~2009-11-12 17:02 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 [this message]
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
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=200911121802.10323.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.