PnP Model
Quoted 4 lines
I agree. A lot of drivers should be able to use one model for everything including "
enable_device" stuff. Right not its all a bit too detailed
Actually, while we're on the subject of PnP-ISA, I was wondering if we could also migrate straight ISA to the device model probing (The 3c509 now looks a bit of a mess because it's got probes for EISA and MCA, needs probes for PNP-ISA and still has to use Space.c for ISA).
If we just had a bus matching function that always matched and the device probe would do its usual port etc. probe and return success if it found a device or fail if it didn't, that would move ISA over reasonably effectively. The only nasty is multiple cards: here the probe routine would have to detect the extra cards, allocate struct devices for them and then catch them again when they come back in through the driver probe routine (this will work today because all probes are single threaded on the bus semaphore, obviously it will fail if probes ever become multi-threaded).
The last issue is probably that we'd like the ISA probes to be run after all the rest of the busses so that all resources in use in the system have a good chance of being claimed and the ISA memory poking should have the least potential for doing damage---this would require a change in the way the device model works, I think, wouldn't it?
James
Quoted 2 lines · James Bottomley
The last issue is probably that we'd like the ISA probes to be run after all the rest of the busses so that all resources in use in the system
They need to run very early on in some ways. We don't want to assign a PnP device over something we didnt know exists. We can scan the other busses first safely but we can't activate devices or do anything else until the ISA unsafe probes run. Those also have some very careful ordering especially in networking. NE2000 must run early, other probes can make some cards move around so must also be ordered
Quoted 10 lines · Alan Cox
Quoted 2 lines · James Bottomley
The last issue is probably that we'd like the ISA probes to be run after all the rest of the busses so that all resources in use in the system
They need to run very early on in some ways. We don't want to assign a PnP device over something we didnt know exists. We can scan the other busses first safely but we can't activate devices or do anything else until the ISA unsafe probes run. Those also have some very careful ordering especially in networking. NE2000 must run early, other probes can make some cards move around so must also be ordered
It strikes me that we can make use of the bus matching logic for this. For ISA, since we have no concept of a card id, we could instead match on when the binding should occur (i.e. ISA_BIND_EARLY and ISA_BIND_LATE). Thus each driver picks its binding type and we run bind early before all other busses and bind late after them (probably by simulating a hotplug event that says hey I suddenly found a bunch of ISA cards of type ISA_BIND_LATE). It's a bit of an abuse of what bus matching is supposed to do, but it should work for the purpose
James