[patch 01/10] ieee1394: use correct barrier types between accesses of nodeid and generation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stefan Richter
Date: Monday, September 29, 2008 - 10:16 am

Date: Wed, 27 Aug 2008 01:18:32 +0200 (CEST)
From: Stefan Richter <stefanr@s5r6.in-berlin.de>

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>
---
 drivers/ieee1394/nodemgr.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux/drivers/ieee1394/nodemgr.c
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.c
+++ linux/drivers/ieee1394/nodemgr.c
@@ -1308,7 +1308,8 @@ static void nodemgr_update_node(struct n
 	if (ne->in_limbo)
 		nodemgr_resume_ne(ne);
 
-	/* Mark the node current */
+	/* Finally, mark the node current */
+	smp_wmb();
 	ne->generation = generation;
 }
 
@@ -1869,7 +1870,7 @@ void hpsb_node_fill_packet(struct node_e
 {
 	packet->host = ne->host;
 	packet->generation = ne->generation;
-	barrier();
+	smp_rmb();
 	packet->node_id = ne->nodeid;
 }
 
@@ -1878,7 +1879,7 @@ int hpsb_node_write(struct node_entry *n
 {
 	unsigned int generation = ne->generation;
 
-	barrier();
+	smp_rmb();
 	return hpsb_write(ne->host, ne->nodeid, generation,
 			  addr, buffer, length);
 }

-- 
Stefan Richter
-=====-==--- =--= ===-=
http://arcgraph.de/sr/

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[No subject], , (Wed Dec 31, 5:00 pm)
Dearest Beloved,, Mr. Kunio Uematsu, (Tue Mar 16, 12:52 pm)
Hope to hear from you soon., Christopher Green, (Tue Oct 26, 12:02 pm)
Kick off the Linux Driver Project (again, this time for real), Peter W. Morreale, (Thu Sep 27, 6:21 am)
Kick off the Linux Driver Project (again, this time for real), Peter W. Morreale, (Thu Sep 27, 6:55 am)
Kick off the Linux Driver Project (again, this time for real), Peter W. Morreale, (Thu Sep 27, 7:58 am)
Kick off the Linux Driver Project (again, this time for real), Tomasz Grzegurzko, (Thu Sep 27, 6:40 pm)
JOINT VENTURE., ming yang, (Sun Dec 23, 5:41 am)
broken mailing list, try 47..., Greg KH, (Fri Jan 11, 12:12 pm)
Re: broken mailing list, try 47..., Steven Le Roux, (Sat Jan 12, 11:10 am)
Re: broken mailing list, try 47..., stuart, (Sat Jan 12, 3:56 pm)
Mailing Lists, Tomasz Grzegurzko, (Fri Feb 8, 5:22 pm)
what is the status of this initiative ?, JoJo jojo, (Thu Mar 13, 12:20 am)
Re: what is the status of this initiative ?, Greg KH, (Thu Mar 13, 7:51 am)
Re: what is the status of this initiative ?, Javi Roman, (Thu Mar 13, 10:13 am)
Re: what is the status of this initiative ?, Davide Madrisan, (Thu Mar 13, 10:30 am)
Re: what is the status of this initiative ?, Greg KH, (Thu Mar 13, 10:36 am)
[patch 00/10] firedtv: a few more updates, Stefan Richter, (Mon Sep 29, 10:15 am)
[patch 01/10] ieee1394: use correct barrier types between ..., Stefan Richter, (Mon Sep 29, 10:16 am)
[patch 08/10] firedtv: remove unused struct members, Stefan Richter, (Mon Sep 29, 10:21 am)
Re: [patch 00/10] firedtv: a few more updates, Stefan Richter, (Mon Sep 29, 10:46 am)
Gettinng started with Linux drivers, Amit Uttamchandani, (Fri Apr 10, 3:04 pm)
Re: Gettinng started with Linux drivers, Stefan Richter, (Sat Apr 11, 3:00 am)
Re: Gettinng started with Linux drivers, Amit Uttamchandani, (Sun Apr 12, 6:08 pm)
Re: Gettinng started with Linux drivers, Stefan Richter, (Mon Apr 13, 12:39 am)
A tablet driver question, Steven Hunt, (Tue May 19, 9:49 pm)
Re: A tablet driver question, Greg KH, (Tue May 19, 10:12 pm)
Re: A tablet driver question, Steven Hunt, (Tue May 19, 11:16 pm)
Re: A tablet driver question, Jiri Slaby, (Wed May 20, 12:19 am)
Re: A tablet driver question, Steven Hunt, (Wed May 20, 8:58 am)
Re: A tablet driver question, Jiri Slaby, (Wed May 20, 9:24 am)
Re: A tablet driver question, Mohamed Ikbel Boulabiar, (Wed May 20, 9:50 am)
Re: A tablet driver question, Jiri Kosina, (Thu May 21, 1:33 am)