[Linux1394-cvslog] rev 843 - branches/linux-2.4
Brought to you by:
aeb,
bencollins
|
From: SVN U. <ben...@li...> - 2003-03-15 06:49:33
|
Author: bencollins
Date: 2003-03-15 01:48:52 -0500 (Sat, 15 Mar 2003)
New Revision: 843
Modified:
branches/linux-2.4/nodemgr.c
Log:
Backport supposed race fix.
Modified: branches/linux-2.4/nodemgr.c
==============================================================================
--- branches/linux-2.4/nodemgr.c (original)
+++ branches/linux-2.4/nodemgr.c 2003-03-15 01:48:53.000000000 -0500
@@ -1128,7 +1128,7 @@
{
int count;
struct selfid *sid = (struct selfid *)host->topology_map;
- nodeid_t nodeid = LOCAL_BUS;
+ nodeid_t nodeid = host->nodeid & BUS_MASK;
/* Scan each node on the bus */
for (count = host->selfid_count; count; count--, sid++) {
@@ -1143,6 +1143,15 @@
nodemgr_node_probe_one(host, nodeid++, generation);
}
+ /* If we had a bus reset while we were scanning the bus, it is
+ * possible that we did not probe all nodes. In that case, we
+ * skip the clean up for now, since we could remove nodes that
+ * were still on the bus. The bus reset increased hi->reset_sem,
+ * so there's a bus scan pending which will do the clean up
+ * eventually. */
+ if (generation == get_hpsb_generation(hi->host))
+ nodemgr_node_probe_cleanup(hi->host, generation);
+
return;
}
@@ -1234,16 +1243,6 @@
}
nodemgr_node_probe(hi->host, generation);
-
- /* If we had a bus reset while we were scanning the bus, it is
- * possible that we did not probe all nodes. In that case, we
- * skip the clean up for now, since we could remove nodes that
- * were still on the bus. The bus reset increased
- * hi->reset_sem, so there's a bus scan pending which will do
- * the clean up eventually. */
- if (generation == get_hpsb_generation(hi->host))
- nodemgr_node_probe_cleanup(hi->host, generation);
-
nodemgr_do_irm_duties(hi->host);
up(&nodemgr_serialize);
@@ -1350,6 +1349,8 @@
init_completion(&hi->exited);
sema_init(&hi->reset_sem, 0);
+ spin_lock_irqsave (&host_info_lock, flags);
+
hi->pid = kernel_thread(nodemgr_host_thread, hi,
CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
@@ -1357,11 +1358,12 @@
HPSB_ERR ("NodeMgr: failed to start NodeMgr thread for %s",
host->driver->name);
kfree(hi);
+ spin_unlock_irqrestore (&host_info_lock, flags);
return;
}
- spin_lock_irqsave (&host_info_lock, flags);
list_add_tail (&hi->list, &host_info_list);
+
spin_unlock_irqrestore (&host_info_lock, flags);
return;
@@ -1411,7 +1413,6 @@
break;
}
}
- spin_unlock_irqrestore (&host_info_lock, flags);
if (hi) {
if (hi->pid >= 0) {
@@ -1424,6 +1425,8 @@
HPSB_ERR("NodeMgr: host %s does not exist, cannot remove",
host->driver->name);
+ spin_unlock_irqrestore (&host_info_lock, flags);
+
down(&nodemgr_serialize);
/* Even if we fail the host_info part, remove all the node
|