Re: bug in init_i82365 wrt sysfs

From: Patrick Mochel
Date: Tue Oct 14 2003 - 18:05:41 EST



> Due to the number of cases that we're encountering with PCMCIA, I'm
> beginning to wonder if the driver model could be fixed to be more kind
> to PCMCIA by avoiding some of these ordering dependencies. None of this
> would be a problem if the driver model would allow PCI device drivers to
> register PCI devices while their probe or remove functions were executing.

I am open to that suggestion, but after doing some tinkering, I've found
that it would be very painful.

The problem is that we hold the bus's rwsem across the driver binding
sequence. This includes walking either the list of devices or drivers
regsitered with the bus and calling ->probe().

We could make the locking more fine-grained, and only hold it when
actually iterating over the list, and dropping it on each iteration.
However, I'm strongly opposed to it because it gets ugly and fragile
very quickly. I'd much rather protect the entire iteration, since it's
easy to understand.

So, that means you simply cannot register devices that are on the same bus
from inside a ->probe() function, or unregister them in ->remove(). At
least not the way it is. Any suggestions?

Thanks,


Pat

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