diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-08-26 19:18:32 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-02-24 08:51:26 -0500 |
commit | 29f8ea8ab09bad0c3c0d67964559d27643e97903 (patch) | |
tree | 841538d670636493ccb4bd240739e934dd09fda1 | |
parent | 612262a53352af839a14b3395975a3440c95080a (diff) |
ieee1394: use correct barrier types between accesses of nodeid and generation
A compiler barrier (explicit on the read side, implicit on the write
side) is not quite enough for what has to be accomplished here. Use
hardware memory barriers on systems which need them.
(Of course a full fix of generation handling would require much more
than this. The ieee1394 core's bus generation counter had to be tied to
the controller's bus generation counter; cf. Kristian's stack. It's
just that I have other current business with the code around these
barrier()s, so why not do at least this small fix.)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/ieee1394/nodemgr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 906c5a98d814..f47b6f69d2a9 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c | |||
@@ -1265,7 +1265,8 @@ static void nodemgr_update_node(struct node_entry *ne, struct csr1212_csr *csr, | |||
1265 | csr1212_destroy_csr(csr); | 1265 | csr1212_destroy_csr(csr); |
1266 | } | 1266 | } |
1267 | 1267 | ||
1268 | /* Mark the node current */ | 1268 | /* Finally, mark the node current */ |
1269 | smp_wmb(); | ||
1269 | ne->generation = generation; | 1270 | ne->generation = generation; |
1270 | 1271 | ||
1271 | if (ne->in_limbo) { | 1272 | if (ne->in_limbo) { |
@@ -1798,7 +1799,7 @@ void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *packet) | |||
1798 | { | 1799 | { |
1799 | packet->host = ne->host; | 1800 | packet->host = ne->host; |
1800 | packet->generation = ne->generation; | 1801 | packet->generation = ne->generation; |
1801 | barrier(); | 1802 | smp_rmb(); |
1802 | packet->node_id = ne->nodeid; | 1803 | packet->node_id = ne->nodeid; |
1803 | } | 1804 | } |
1804 | 1805 | ||
@@ -1807,7 +1808,7 @@ int hpsb_node_write(struct node_entry *ne, u64 addr, | |||
1807 | { | 1808 | { |
1808 | unsigned int generation = ne->generation; | 1809 | unsigned int generation = ne->generation; |
1809 | 1810 | ||
1810 | barrier(); | 1811 | smp_rmb(); |
1811 | return hpsb_write(ne->host, ne->nodeid, generation, | 1812 | return hpsb_write(ne->host, ne->nodeid, generation, |
1812 | addr, buffer, length); | 1813 | addr, buffer, length); |
1813 | } | 1814 | } |