Patch: 2.5.45 PCI Fixups for PCI HotPlug
Quoted 8 lines · Alan Cox
Quoted 4 lines · Adam J. Richter
There is no reason to use
__pci_devinitfor chipsets that are
only soldered into motherboards. I believe there are only a few of those quirk handlers thatCONFIG_PCI_HOTPLUGusers really need to retain in their kernels.You might be suprised what "motherboard" chips turn up in docking stations.My TP600 for example has an IBM southbridge in it.
What are you advocating? Do you want all quirk routines
marked __devinit? Wouldn't you agree at least that if we can establish that device *cannot* be hot plugged, that its quirk routine can be __init?
I see at least three levels of "hardware reality support":
1. Configurations known to be in use.
2. Possible configurations of hardware products known to exist
3. Hardware products not known to exist, based on chips and specs known to exist in other real hardware products.
Jeff Garzik recently said that he doesn't want to incorporate
hot plugging for arbitrary standard PCI cards until he hears about a hotplug configuration that uses that card (I'm cc'ing Jeff so he can correct me if I misunderstand). That would put the kernel at level 1 in the above list.
You seem to be advocating the third level, but maybe I'm
reading too much into your note.
For what it's worth, although I think that individual
trade-offs can lead to some drivers being exceptions in one direction or another, I would prefer level 2 for odd kernel versions so that we can get reports about things like your TP600's chip set. I do think that patches for hotplug support for arbitrary regular PCI card should be accepted now that there are backplanes that can hot plug them.
By the way, does your TP600 docking station use one of the
mechanisms that is included by CONFIG_PCI_HOTPLUG or is it compiled in either way (like CardBus)?
If:
- Your docking station were not controlled by CONFIG_PCI_HOTPLUG
- and your kernel were not configured CONFIG_PCI_HOTPLUG
- and your docking station needed a quirk routine
- and the quirk routine were marked with the proposed __pcidevinit
- and you were to plug in your station after boot
...then you would get a kernel segment fault, even if you haveCONFIG_HOTPLUG defined.
Adam J. Richter __ ______________ 575 Oroville Road [email protected] \ / Milpitas, California 95035 +1 408 309-6081 | g g d r a s i l United States of America
"Free Software For The Rest Of Us."
Quoted 6 lines · Adam J. Richter
Jeff Garzik recently said that he doesn't want to incorporate
hot plugging for arbitrary standard PCI cards until he hears about a hotplug configuration that uses that card (I'm cc'ing Jeff so he can correct me if I misunderstand). That would put the kernel at level 1 in the above list.
No, I was talking more specifically about de2104x driver.
For general drivers I prefer __devinit out of general laziness: if there is not an active and kernel-clueful maintainer, then it's better to mark everything __devinit [with the wastage it implies]. But for a few drivers with obviously provable/disprovable cases, __init may be better.
So it IMO matters WRT maintainer and testability issues as well as strictly kernel/technical issues.
Jeff
Quoted 4 lines · Adam J. Richter
What are you advocating? Do you want all quirk routines
marked__devinit? Wouldn't you agree at least that if we can establish that device *cannot* be hot plugged, that its quirk routine can be__init?
You cannot mark individual quirk routines differently as long as they belong in the same quirk list. If the list is __devinitdata and some of routines in it are __init, you'll have an oops in the hotplug path.
What we need is an additional quirk list, say, "hotplug_pci_fixups" and a global flag "init_gone" (probably free_initmem() should set it). Then we'll have
void pci_fixup_device(int pass, struct pci_dev *dev) {
- pci_do_fixups(dev, pass, pcibios_fixups);
- pci_do_fixups(dev, pass, pci_fixups);
+ if (!init_gone) {
+ pci_do_fixups(dev, pass, pcibios_fixups);
+ pci_do_fixups(dev, pass, pci_fixups);
+ }
+ pci_do_fixups(dev, pass, hotplug_pci_fixups);
}
Perhaps arch specific "hotplug_pcibios_fixups" is also needed, as archs may work around the same pci bug differently.
What should go into the new list is another story. Obviously the fixups for host bridges must be __init, as well as some south bridges that look like pci devices but actually aren't.
Ivan.