Re: [PATCH] Make hot unplugging of PCI buses work

From: Russell King (rmk@arm.linux.org.uk)
Date: Sun Feb 23 2003 - 14:32:29 EST


On Sun, Feb 23, 2003 at 10:57:10AM -0800, Linus Torvalds wrote:
> On Sun, 23 Feb 2003, Russell King wrote:
> > Linus - this patch is for discussion, NOT for applying unless you have
> > zero problems with it since it actively breaks existing hotplug PCI.
>
> Well, I definitely want it, and you should add Alan to the cc list since
> he apparently even _has_ one of these devices.

Alan kindly sent one of these beasts to me, which renewed my interest
in this area. I'll forward stuff so far.

> > Furthermore, I propose that pci_remove_device() shall disappear -
> > and this devices makes it so (thereby breaking existing hotplug
> > drivers.)
>
> Can't you just fix up the current users to use "pci_remove_bus_device()".
> The breakage seems a bit spiteful ;)

I'd like to hear Gregs comments first - Greg knows the hotplugging code
better than me. It appears to have its own way of decending some of the
PCI buses, but it seems unclear why it needs to supervise removal of
devices which are downstream from the hotplug slot.

As far as inserting this device, there needs to be a fair number of other
to the PCI layer to make stuff work sanely. Currently, in order, we:

1. discovering all devices
2. once all devices have been initialised, registering each
   device with sysfs and thereby letting the drivers know.
3. apply any fixups needed
4. initialise any resources that need initialising

The drivers quite rightfully moan, and it isn't a pretty sight.

IMO, what we should be doing, in order, is:

1. discovering all devices
2. apply any fixups needed
3. initialise any resources that need initialising
4. once all devices have been initialised, registering each
   device with sysfs and thereby letting the drivers know.

We need to wait until everything is setup for step 4 because we may
(and do in the case of this split-bridge) need to program PCI-PCI
bridges before the devices become accessible.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

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



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:39 EST