On Wed, Oct 10, 2012 at 4:25 AM, Felix Fietkau <n...@openwrt.org> wrote:

> On 2012-10-09 3:00 AM, Tim Harvey wrote:
> > Moving the PCIe hw initialization to an early init call allows PCI based
> > devices to be used when built as static.  An example of where this is
> needed
> > is when using PCI based UARTs such as the Gateworks GW2201 Octal UART.
> What do you mean by 'built as static'? Why does the initialization time
> matter here?
>
> - Felix
>
>
Felix,

I've had some time to dig deeper on this issue and I've found the following:

The kernel init levels are not documented well - the only documentation
I've found was an uncommitted patch here:
http://thread.gmane.org/gmane.linux.kernel/313880 .  The ARM kernel's pci
support provides 'pci_common_init' which is meant to be called from an init
level prior to device init.  All ARM platforms I looked at call their
PCI/PCIe controller init either via arch_initcall (level 3) or
subsys_initcall (level 4) - I don't think either one is necessary more
correct, they both preceed device init (level 6).  The ARM kernel does not
support HOTPLUG_PCI - if it did then it would be fine to init PCI/PCIe
controllers following device_init (level 6).

In the current case of the cns3xxx kernel (or any ARM platform), calling
pci_common_init from late_init (level 7) which follows device_init causes
any drivers that have already been probed by nature of being static in the
kernel to fail with resource conflicts.

I'm going to re-submit this patch using subsys_initcall instead of
device_initcall which I feel is more correct than what I've done here.

Tim
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to