linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firewire: fw-core: enforce write order when updating fw_device.generation
@ 2007-11-01  1:49 Stefan Richter
  2007-11-01  1:50 ` [PATCH] firewire: fw-core: react on bus resets while the config ROM is being fetched Stefan Richter
  2007-11-01  3:53 ` [PATCH] firewire: fw-core: enforce write order when updating fw_device.generation Nick Piggin
  0 siblings, 2 replies; 23+ messages in thread
From: Stefan Richter @ 2007-11-01  1:49 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel, Kristian Høgsberg

fw_device.node_id and fw_device.generation are accessed without mutexes.
We have to ensure that all readers will get to see node_id updates
before generation updates.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
 drivers/firewire/fw-device.c   |    6 ++++++
 drivers/firewire/fw-topology.c |    1 +
 2 files changed, 7 insertions(+)

Index: linux/drivers/firewire/fw-device.c
===================================================================
--- linux.orig/drivers/firewire/fw-device.c
+++ linux/drivers/firewire/fw-device.c
@@ -808,6 +813,7 @@ void fw_node_event(struct fw_card *card,
 
 		device = node->data;
 		device->node_id = node->node_id;
+		wmb();
 		device->generation = card->generation;
 		if (atomic_read(&device->state) == FW_DEVICE_RUNNING) {
 			PREPARE_DELAYED_WORK(&device->work, fw_device_update);
Index: linux/drivers/firewire/fw-topology.c
===================================================================
--- linux.orig/drivers/firewire/fw-topology.c
+++ linux/drivers/firewire/fw-topology.c
@@ -518,6 +518,7 @@ fw_core_handle_bus_reset(struct fw_card 
 		card->bm_retries = 0;
 
 	card->node_id = node_id;
+	wmb();
 	card->generation = generation;
 	card->reset_jiffies = jiffies;
 	schedule_delayed_work(&card->work, 0);

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-01-25 22:26 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01  1:49 [PATCH] firewire: fw-core: enforce write order when updating fw_device.generation Stefan Richter
2007-11-01  1:50 ` [PATCH] firewire: fw-core: react on bus resets while the config ROM is being fetched Stefan Richter
2007-11-01  1:51   ` [PATCH] firewire: fw-sbp2: enforce read order of device generation and node ID Stefan Richter
2007-11-01  3:53 ` [PATCH] firewire: fw-core: enforce write order when updating fw_device.generation Nick Piggin
2007-11-01  9:51   ` dealing with barriers (was Re: [PATCH] firewire: fw-core: enforce write order when updating fw_device.generation) Stefan Richter
2007-11-01 11:32     ` Nick Piggin
2008-01-24  0:52     ` [PATCH 0/4] firewire: order of memory accesses (bus generation vs. node ID) Stefan Richter
2008-01-24  0:53       ` [PATCH 1/4] firewire: fw-sbp2: use device generation, not card generation Stefan Richter
2008-01-24 16:04         ` Jarod Wilson
2008-01-24  0:53       ` [PATCH 2/4] firewire: fw-cdev: " Stefan Richter
2008-01-24 16:05         ` Jarod Wilson
2008-01-24  0:54       ` [PATCH 3/4] firewire: enforce access order between generation and node ID Stefan Richter
2008-01-24  4:55         ` Nick Piggin
2008-01-24 16:06         ` Jarod Wilson
2008-01-25 16:35           ` Stefan Richter
2008-01-25 17:57             ` Stefan Richter
     [not found]               ` <59ad55d30801251024j6ff43953tb86aaa52fdea5ec9@mail.gmail.com>
2008-01-25 22:25                 ` Stefan Richter
2008-01-24  0:55       ` [PATCH 4/4] firewire: fw-core: react on bus resets while the config ROM is being fetched Stefan Richter
2008-01-24 16:11         ` Jarod Wilson
2008-01-24 19:26           ` Jarod Wilson
2008-01-25 16:53             ` [PATCH 4/4 update] " Stefan Richter
2008-01-25 17:16               ` Jarod Wilson
2008-01-25 17:21                 ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).