Re: Initialization order of PCI devices

From: Petr Vandrovec (VANDROVE@vc.cvut.cz)
Date: Tue May 23 2000 - 11:19:31 EST


On 23 May 00 at 11:51, Jeff Garzik wrote:
> > pci_register_driver returns 0.
> > Fixed
> [...]
> I do not think this is a bug. In via82cxxx_audio at least, I
> -purposefully- do not call pci_module_init, because it is not a hotplug
> driver. I don't want the PCI driver instance hanging around if there is
> no hardware for it -- even when CONFIG_HOTPLUG is true.
Why you think that via82cxxx is not hotplug driver?

> Your patch may also have unintended consequences, since you do not
> appear to search & replace "__init" with "__devinit" where necessary.
It is not needed because of pci_unfroze() is invoked before init memory
is released. Only difference is that with no device of such type in
computer driver is not unregistered. But because of non-hotplug kernel
ever calls pci_insert_device, it should not cause any problem.

> Thus when a driver which DOES hang around (pci_register_driver returns 0
> under CONFIG_HOTPLUG), and in the unlikely event such a device is
> plugged in, the kernel crashes because the __devinit code it is
> searching for has already been dropped (because it is __init instead).
I believe that I did not introduce new bugs - you can always think that
in old scheme you had one device driven by driver plugged in when
kernel booted and you plug another one after that... If you use
pci_register_driver and you do not have correct __init/__devinit,
your driver is already buggy. My patch did not change it (unfortunately?).

I'll try to review all PCI drivers, but I cannot promise anything.

> Unfortunately since your change only supports PCI drivers, it does not
> allow us to completely ignore/eliminate a user-specified ethX ordering
> [for example]. I also think that the call for this patch is less strong
> as we move to a more modular world.
Unfortunately, my current computers have one or zero ISA slots and (as
they are PCs) no sbus or MVE or..., so I have no idea which ordering is
reasonable for which of these other busses.

Even in modular world, it is nice if I can swap my two bttv interfaces
without opening cover and physically swapping grabbers... Or you can
swap on-board ide with promise/HPT ide without having ide_probe=reverse.
                                            Best regards,
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:23 EST