]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ieee1394: run high-level updates before high-level probes
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 13 Dec 2005 04:03:19 +0000 (23:03 -0500)
committerJody McIntyre <scjody@modernduck.com>
Tue, 13 Dec 2005 04:03:19 +0000 (23:03 -0500)
After a bus reset, let nodemgr call high-level update hooks first for nodes
which do not need to be probed.  The main benefit is for a bus with more
than one SBP-2 device:  SBP-2 reconnects will be performed before SBP-2
logins, thus have a much higher chance to succeed, and their SCSI devices
will not be blocked much longer than necessary.  This was demonstrated for
Linux 2.4 by Dave Cinege a while ago.

A better approach would be to perform time-consuming probes in parallel by a
subthread.  I actually plan to implement this for sbp2 but it may take a
while to get that done and tested.  Until then, this tweak is a huge
improvement for users with multiple SBP-2 devices.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jody McIntyre <scjody@modernduck.com>
drivers/ieee1394/nodemgr.c

index 01ab2bfa8d9d3c2c21d8757d766bc9e3fe5f4239..0ec2987686215e6c4273830681e95c6aa7931cc6 100644 (file)
@@ -1407,14 +1407,28 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
        struct hpsb_host *host = hi->host;
        struct class *class = &nodemgr_ne_class;
        struct class_device *cdev;
+       struct node_entry *ne;
 
        /* Do some processing of the nodes we've probed. This pulls them
         * into the sysfs layer if needed, and can result in processing of
         * unit-directories, or just updating the node and it's
-        * unit-directories. */
+        * unit-directories.
+        *
+        * Run updates before probes. Usually, updates are time-critical
+        * while probes are time-consuming. (Well, those probes need some
+        * improvement...) */
+
        down_read(&class->subsys.rwsem);
-       list_for_each_entry(cdev, &class->children, node)
-               nodemgr_probe_ne(hi, container_of(cdev, struct node_entry, class_dev), generation);
+       list_for_each_entry(cdev, &class->children, node) {
+               ne = container_of(cdev, struct node_entry, class_dev);
+               if (!ne->needs_probe)
+                       nodemgr_probe_ne(hi, ne, generation);
+       }
+       list_for_each_entry(cdev, &class->children, node) {
+               ne = container_of(cdev, struct node_entry, class_dev);
+               if (ne->needs_probe)
+                       nodemgr_probe_ne(hi, ne, generation);
+       }
         up_read(&class->subsys.rwsem);