aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-08-16 07:36:47 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-08-19 12:47:55 -0400
commit6848408abf1bc18d9a4d5fed3fcca812745ece05 (patch)
treecc52f981e49461426bc747821d0c133de20d7134 /drivers/ieee1394
parent1fca25427482387689fa27594c992a961d98768f (diff)
ieee1394: regression in 2.6.25: updates should happen before probes
Regression since commit 73cf60232ef16e1f8a64defa97214a1722db1e6c, "ieee1394: use class iteration api": The two loops for (1.) driver updates and (2.) driver probes were replaced by a single loop with bogus needs_probe checks. Hence updates and probes were now intermixed, and especially sbp2 updates (reconnects) held up longer than necessary. While we fix it, change the needs_probe flag to bool type for clarity. Tested by Damien Benoist. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/nodemgr.c29
-rw-r--r--drivers/ieee1394/nodemgr.h2
2 files changed, 16 insertions, 15 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 994a21e5a0aa..2ebd09a89427 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -844,7 +844,7 @@ static struct node_entry *nodemgr_create_node(octlet_t guid, struct csr1212_csr
844 ne->host = host; 844 ne->host = host;
845 ne->nodeid = nodeid; 845 ne->nodeid = nodeid;
846 ne->generation = generation; 846 ne->generation = generation;
847 ne->needs_probe = 1; 847 ne->needs_probe = true;
848 848
849 ne->guid = guid; 849 ne->guid = guid;
850 ne->guid_vendor_id = (guid >> 40) & 0xffffff; 850 ne->guid_vendor_id = (guid >> 40) & 0xffffff;
@@ -1144,7 +1144,7 @@ static void nodemgr_process_root_directory(struct host_info *hi, struct node_ent
1144 struct csr1212_keyval *kv, *vendor_name_kv = NULL; 1144 struct csr1212_keyval *kv, *vendor_name_kv = NULL;
1145 u8 last_key_id = 0; 1145 u8 last_key_id = 0;
1146 1146
1147 ne->needs_probe = 0; 1147 ne->needs_probe = false;
1148 1148
1149 csr1212_for_each_dir_entry(ne->csr, kv, ne->csr->root_kv, dentry) { 1149 csr1212_for_each_dir_entry(ne->csr, kv, ne->csr->root_kv, dentry) {
1150 switch (kv->key.id) { 1150 switch (kv->key.id) {
@@ -1295,7 +1295,7 @@ static void nodemgr_update_node(struct node_entry *ne, struct csr1212_csr *csr,
1295 nodemgr_update_bus_options(ne); 1295 nodemgr_update_bus_options(ne);
1296 1296
1297 /* Mark the node as new, so it gets re-probed */ 1297 /* Mark the node as new, so it gets re-probed */
1298 ne->needs_probe = 1; 1298 ne->needs_probe = true;
1299 } else { 1299 } else {
1300 /* old cache is valid, so update its generation */ 1300 /* old cache is valid, so update its generation */
1301 struct nodemgr_csr_info *ci = ne->csr->private; 1301 struct nodemgr_csr_info *ci = ne->csr->private;
@@ -1566,28 +1566,27 @@ static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int ge
1566struct probe_param { 1566struct probe_param {
1567 struct host_info *hi; 1567 struct host_info *hi;
1568 int generation; 1568 int generation;
1569 bool probe_now;
1569}; 1570};
1570 1571
1571static int __nodemgr_node_probe(struct device *dev, void *data) 1572static int node_probe(struct device *dev, void *data)
1572{ 1573{
1573 struct probe_param *param = (struct probe_param *)data; 1574 struct probe_param *p = data;
1574 struct node_entry *ne; 1575 struct node_entry *ne;
1575 1576
1576 ne = container_of(dev, struct node_entry, node_dev); 1577 ne = container_of(dev, struct node_entry, node_dev);
1577 if (!ne->needs_probe) 1578 if (ne->needs_probe == p->probe_now)
1578 nodemgr_probe_ne(param->hi, ne, param->generation); 1579 nodemgr_probe_ne(p->hi, ne, p->generation);
1579 if (ne->needs_probe)
1580 nodemgr_probe_ne(param->hi, ne, param->generation);
1581 return 0; 1580 return 0;
1582} 1581}
1583 1582
1584static void nodemgr_node_probe(struct host_info *hi, int generation) 1583static void nodemgr_node_probe(struct host_info *hi, int generation)
1585{ 1584{
1586 struct hpsb_host *host = hi->host; 1585 struct hpsb_host *host = hi->host;
1587 struct probe_param param; 1586 struct probe_param p;
1588 1587
1589 param.hi = hi; 1588 p.hi = hi;
1590 param.generation = generation; 1589 p.generation = generation;
1591 /* Do some processing of the nodes we've probed. This pulls them 1590 /* Do some processing of the nodes we've probed. This pulls them
1592 * into the sysfs layer if needed, and can result in processing of 1591 * into the sysfs layer if needed, and can result in processing of
1593 * unit-directories, or just updating the node and it's 1592 * unit-directories, or just updating the node and it's
@@ -1597,8 +1596,10 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
1597 * while probes are time-consuming. (Well, those probes need some 1596 * while probes are time-consuming. (Well, those probes need some
1598 * improvement...) */ 1597 * improvement...) */
1599 1598
1600 class_for_each_device(&nodemgr_ne_class, NULL, &param, 1599 p.probe_now = false;
1601 __nodemgr_node_probe); 1600 class_for_each_device(&nodemgr_ne_class, NULL, &p, node_probe);
1601 p.probe_now = true;
1602 class_for_each_device(&nodemgr_ne_class, NULL, &p, node_probe);
1602 1603
1603 /* If we had a bus reset while we were scanning the bus, it is 1604 /* If we had a bus reset while we were scanning the bus, it is
1604 * possible that we did not probe all nodes. In that case, we 1605 * possible that we did not probe all nodes. In that case, we
diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h
index 919e92e2a955..6eb26465a84c 100644
--- a/drivers/ieee1394/nodemgr.h
+++ b/drivers/ieee1394/nodemgr.h
@@ -97,7 +97,7 @@ struct node_entry {
97 struct hpsb_host *host; /* Host this node is attached to */ 97 struct hpsb_host *host; /* Host this node is attached to */
98 nodeid_t nodeid; /* NodeID */ 98 nodeid_t nodeid; /* NodeID */
99 struct bus_options busopt; /* Bus Options */ 99 struct bus_options busopt; /* Bus Options */
100 int needs_probe; 100 bool needs_probe;
101 unsigned int generation; /* Synced with hpsb generation */ 101 unsigned int generation; /* Synced with hpsb generation */
102 102
103 /* The following is read from the config rom */ 103 /* The following is read from the config rom */