From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Patrick Mochel <mochel@osdl.org>
Cc: "David S. Miller" <davem@redhat.com>,
anton@samba.org, linux-kernel@vger.kernel.org
Subject: Re: [2.5.19] Oops during PCI scan on Alpha
Date: Tue, 4 Jun 2002 21:07:45 +0400 [thread overview]
Message-ID: <20020604210745.A849@jurassic.park.msu.ru> (raw)
In-Reply-To: <20020602.203916.21926462.davem@redhat.com> <Pine.LNX.4.33.0206040821100.654-100000@geena.pdx.osdl.net>
On Tue, Jun 04, 2002 at 08:50:11AM -0700, Patrick Mochel wrote:
> On Sun, 2 Jun 2002, David S. Miller wrote:
> > It's happening on every platform. It should be done before
> > arch_initcalls actually, but after core_initcalls. I would suggest to
> > rename unused_initcall into postcore_iniscall, then use it for this
> > and sys_bus_init which has the same problem.
>
> Can't it go the other way? Instead of mass-promotion of the setup
> functions, can't we demote the ones that are causing the problems?
Agreed, but converting everything into initcalls without any good reason
looks like a bad idea either.
> core is used for what's in drivers/base/*.c. unused is unused.
So subsys_initcall(sys_bus_init) in base/sys.c should be
core_initcall(sys_bus_init), right? :-)
> subsys is intended primarily for initializing and advertising the
> existence of bus types and device class types (network, input, etc).
> Device probing doesn't necessarily have to take place here, and in some
> cases, it can't: e.g. when the firmware is used to inform the system of
> the PCI buses present.
pcibios_init on alpha and some other archs is a lot more than just
device probing. Basically it's a firmware, and we want it to be
executed early.
The PCI _is_ a subsystem, and pci_driver_init() as the part of the
subsystem should be called from inside of it - pci_allocate_primary_bus()
seems to be a proper place. What about following patch?
Ivan.
--- linux/drivers/base/sys.c~ Mon Jun 3 05:44:37 2002
+++ linux/drivers/base/sys.c Tue Jun 4 16:09:16 2002
@@ -44,6 +44,6 @@ static int sys_bus_init(void)
return device_register(&system_bus);
}
-subsys_initcall(sys_bus_init);
+core_initcall(sys_bus_init);
EXPORT_SYMBOL(register_sys_device);
EXPORT_SYMBOL(unregister_sys_device);
--- linux/drivers/base/Makefile~ Mon Jun 3 05:44:45 2002
+++ linux/drivers/base/Makefile Tue Jun 4 16:14:36 2002
@@ -1,6 +1,6 @@
# Makefile for the Linux device tree
-obj-y := core.o sys.o interface.o fs.o power.o bus.o \
+obj-y := core.o interface.o fs.o power.o bus.o sys.o \
driver.o
export-objs := core.o fs.o power.o sys.o bus.o driver.o
--- linux/drivers/pci/pci-driver.c~ Tue Jun 4 15:35:54 2002
+++ linux/drivers/pci/pci-driver.c Tue Jun 4 16:23:10 2002
@@ -199,13 +199,6 @@ struct bus_type pci_bus_type = {
bind: pci_bus_bind,
};
-static int __init pci_driver_init(void)
-{
- return bus_register(&pci_bus_type);
-}
-
-subsys_initcall(pci_driver_init);
-
EXPORT_SYMBOL(pci_match_device);
EXPORT_SYMBOL(pci_register_driver);
EXPORT_SYMBOL(pci_unregister_driver);
--- linux/drivers/pci/probe.c~ Mon Jun 3 05:44:42 2002
+++ linux/drivers/pci/probe.c Tue Jun 4 16:24:55 2002
@@ -563,6 +563,9 @@ struct pci_bus * __devinit pci_alloc_pri
return NULL;
}
+ if (!atomic_read(&pci_bus_type.refcount))
+ bus_register(&pci_bus_type);
+
b = pci_alloc_bus();
if (!b)
return NULL;
next prev parent reply other threads:[~2002-06-04 17:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-02 20:06 Jan-Benedict Glaw
2002-06-03 4:27 ` Anton Blanchard
2002-06-03 3:39 ` David S. Miller
2002-06-04 15:50 ` Patrick Mochel
2002-06-04 17:07 ` Ivan Kokshaysky [this message]
2002-06-04 18:58 ` Patrick Mochel
2002-06-04 18:26 ` Benjamin Herrenschmidt
2002-06-05 14:20 ` Ivan Kokshaysky
2002-06-04 18:13 ` David S. Miller
2002-06-04 19:38 ` Patrick Mochel
2002-06-04 19:42 ` David S. Miller
2002-06-04 20:56 ` Tom Rini
2002-06-04 21:10 ` Patrick Mochel
2002-06-04 21:14 ` David S. Miller
2002-06-04 21:14 ` Patrick Mochel
2002-06-04 21:23 ` David S. Miller
2002-06-04 21:29 ` Patrick Mochel
2002-06-04 21:34 ` David S. Miller
2002-06-04 22:03 ` Patrick Mochel
2002-06-04 22:06 ` Patrick Mochel
2002-06-05 14:23 ` Ivan Kokshaysky
2002-06-05 22:29 ` David S. Miller
2002-06-06 0:01 ` Patrick Mochel
2002-06-06 13:22 ` Ivan Kokshaysky
2002-06-23 17:03 ` Jan-Benedict Glaw
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=20020604210745.A849@jurassic.park.msu.ru \
--to=ink@jurassic.park.msu.ru \
--cc=anton@samba.org \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®