>A bad API. Subsystems and the driver core will both traverse the trees >(usually just lists) which can be built from the depend pointers, and >the trees grow and shrink dynamically. Perhaps it would be simpler if >the subsystem would just use a mutex per group of devices which have to >be serialized.
Yes, this is a bad API. I have a new idea. The /sys/devices is a tree, which is linked by dev->klist_children, any sub-tree of /sys/devices tree can be a parallel unit, which can be indicated by a flag of struct device of root node of sub-tree. In a sub-tree being a parallel unit, all probing is serialized, while the probing of different sub-trees is parallelized. The find_next_device_to_check will not traverse through devices_subsys.list, but traverse through dev->klist_children. In the IEEE 1394 case, the "node" can be a parallel unit (sub-tree) by set the corresponding flag in struct device of "node", and the "unit" under "node" will be probed serially. In general, subsystems can set the flag in any struct device if necessary, even the root struct device of subsystem, which means all devices in the subsystem must be probed serially. I will work out a new patch based on this new idea. >*However*, IMO parallelized probing should be implemented in the >subsystems themselves in the first place, _not in the driver core_. > >The subsystems know where parallelism is possible and safe and >effective, the driver core doesn't. I totally agree that the parallelized probing should be controlled by the subsystems. By if the mechanism can be provided by driver core effectively, the solution will be ideal. Best Regards, Huang Ying - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/