aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/nodemgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/nodemgr.c')
-rw-r--r--drivers/ieee1394/nodemgr.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index b23322523ef5..347ece6b583c 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -64,10 +64,10 @@ static int nodemgr_bus_read(struct csr1212_csr *csr, u64 addr, u16 length,
64 struct nodemgr_csr_info *ci = (struct nodemgr_csr_info*)__ci; 64 struct nodemgr_csr_info *ci = (struct nodemgr_csr_info*)__ci;
65 int i, ret = 0; 65 int i, ret = 0;
66 66
67 for (i = 0; i < 3; i++) { 67 for (i = 1; ; i++) {
68 ret = hpsb_read(ci->host, ci->nodeid, ci->generation, addr, 68 ret = hpsb_read(ci->host, ci->nodeid, ci->generation, addr,
69 buffer, length); 69 buffer, length);
70 if (!ret) 70 if (!ret || i == 3)
71 break; 71 break;
72 72
73 if (msleep_interruptible(334)) 73 if (msleep_interruptible(334))
@@ -1438,9 +1438,13 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
1438 if (host->busmgr_id == 0xffff && host->node_count > 1) 1438 if (host->busmgr_id == 0xffff && host->node_count > 1)
1439 { 1439 {
1440 u16 root_node = host->node_count - 1; 1440 u16 root_node = host->node_count - 1;
1441 struct node_entry *ne = find_entry_by_nodeid(host, root_node | LOCAL_BUS);
1442 1441
1443 if (ne && ne->busopt.cmc) 1442 /* get cycle master capability flag from root node */
1443 if (host->is_cycmst ||
1444 (!hpsb_read(host, LOCAL_BUS | root_node, get_hpsb_generation(host),
1445 (CSR_REGISTER_BASE + CSR_CONFIG_ROM + 2 * sizeof(quadlet_t)),
1446 &bc, sizeof(quadlet_t)) &&
1447 be32_to_cpu(bc) & 1 << CSR_CMC_SHIFT))
1444 hpsb_send_phy_config(host, root_node, -1); 1448 hpsb_send_phy_config(host, root_node, -1);
1445 else { 1449 else {
1446 HPSB_DEBUG("The root node is not cycle master capable; " 1450 HPSB_DEBUG("The root node is not cycle master capable; "
@@ -1557,24 +1561,19 @@ static int nodemgr_host_thread(void *__hi)
1557 } 1561 }
1558 } 1562 }
1559 1563
1560 if (!nodemgr_check_irm_capability(host, reset_cycles)) { 1564 if (!nodemgr_check_irm_capability(host, reset_cycles) ||
1565 !nodemgr_do_irm_duties(host, reset_cycles)) {
1561 reset_cycles++; 1566 reset_cycles++;
1562 up(&nodemgr_serialize); 1567 up(&nodemgr_serialize);
1563 continue; 1568 continue;
1564 } 1569 }
1570 reset_cycles = 0;
1565 1571
1566 /* Scan our nodes to get the bus options and create node 1572 /* Scan our nodes to get the bus options and create node
1567 * entries. This does not do the sysfs stuff, since that 1573 * entries. This does not do the sysfs stuff, since that
1568 * would trigger hotplug callbacks and such, which is a 1574 * would trigger hotplug callbacks and such, which is a
1569 * bad idea at this point. */ 1575 * bad idea at this point. */
1570 nodemgr_node_scan(hi, generation); 1576 nodemgr_node_scan(hi, generation);
1571 if (!nodemgr_do_irm_duties(host, reset_cycles)) {
1572 reset_cycles++;
1573 up(&nodemgr_serialize);
1574 continue;
1575 }
1576
1577 reset_cycles = 0;
1578 1577
1579 /* This actually does the full probe, with sysfs 1578 /* This actually does the full probe, with sysfs
1580 * registration. */ 1579 * registration. */