[linux-sh:03220] Re: [linuxsh-dev] Status of ST40 on the 2.6 tree

Paul Mundt <[email protected]> Tue, 27 Apr 2004 11:35:31 -0400
Newsgroups gmane.linux.ports.sh.general,gmane.linux.ports.sh.devel
Message-ID <[email protected]>
On Tue, Apr 27, 2004 at 03:57:33PM +0100, David MCKAY wrote:
> > At the moment I am tweaking the PCI stuff to get it to compile nicely
> > (and removing some of the HARP specific bits out of the st40 pci code).
> > So is anyone running 2.6 with ST40 at the mo or is it currently
> > untested?
> 
> I have done exactly the same. I'll post patches soon. I'm currently testing 
> it, it seems to work OK. I have one question though, looking at the 7751 code 
> I do not understand how the ordering dependency between 
> sh7751_pci_init() and  pcibios_init() is handled. What enforces the order?
> 
There are varying initcall levels supported, both pcibios_init() and
sh7751_pci_init() use subsys_initcall(). When multiple users of the same
initcall level are used, they're ordering is link order dependant. So in
the pci case, pci.o is linked before pci-sh7751.o, so pcibios_init() will
be done first.

If you look at include/linux/init.h, we have:

#define core_initcall(fn)               __define_initcall("1",fn)
#define postcore_initcall(fn)           __define_initcall("2",fn)
#define arch_initcall(fn)               __define_initcall("3",fn)
#define subsys_initcall(fn)             __define_initcall("4",fn)
#define fs_initcall(fn)                 __define_initcall("5",fn)
#define device_initcall(fn)             __define_initcall("6",fn)
#define late_initcall(fn)               __define_initcall("7",fn)

so if you need something initialized before or after, you can either rely
on link order, or use a different initcall level.
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAjn3D1K+teJFxZ9wRAlX2AJ43WhU/dyyhNfBjRCPiyJh1vYc2kQCbBRw5
2jasOA35cogwuRK/oM89Yww=
=JqpO
-----END PGP SIGNATURE-----