Trying to remove cardbus dependence on ds

Russell King rmk at
Tue Jun 17 23:51:02 BST 2003

On Tue, Jun 17, 2003 at 08:55:00PM +0100, Matthew Wilcox wrote:
> On Tue, Jun 17, 2003 at 08:17:01PM +0100, Russell King wrote:
> > So, we can't call other pci device add/remove functions from within a
> > driver probe/remove callback.
> Or we make the semaphore per-bus rather than per-bus-type.  New races?
> Probably.

Yes, I think new races - each device appears inside a per-bus-type
structure within the sysfs representation, so I'd imagine (although
I haven't looked) that this will open races there.

> Or we have an _unlocked() form of the operation that's currently
> being called.

The semaphore is taken rather far down in the device model:

 device_unregister -> device_del -> bus_remove_device

We effectively have a subset of bus_remove_device called
device_release_driver, but if you use that, you end up having to
replicate device_del and co (and not forgetting to delete the
symlink which is removed in bus_remove_device...)  We'd also have
to replicate pci_remove_behind_bridge() as well.

I suspect such code would drift out of sync with the device model over
time, and thus would have a tendency to suffer bit rot.

Russell King (rmk at                The developer of ARM Linux

More information about the linux-pcmcia mailing list