aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid Dillow <dave@thedillows.org>2010-03-03 23:37:16 -0500
committerDavid S. Miller <davem@davemloft.net>2010-03-05 17:00:18 -0500
commit5fe88eae26dbd24eed73eb0b681e13981fd486b3 (patch)
treeea9c3175edbed98f6cbce7a680eb451f7872633b /drivers/net
parentd17792ebdf90289c9fd1bce888076d3d60ecd53b (diff)
typhoon: fix incorrect use of smp_wmb()
The typhoon driver was incorrectly using smp_wmb() to order memory accesses against IO to the NIC in a few instances. Use wmb() instead, which is required to actually order between memory types. Signed-off-by: David Dillow <dave@thedillows.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/typhoon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index e3ddcb8f29df..1cf012d3e072 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -480,7 +480,7 @@ typhoon_hello(struct typhoon *tp)
480 typhoon_inc_cmd_index(&ring->lastWrite, 1); 480 typhoon_inc_cmd_index(&ring->lastWrite, 1);
481 481
482 INIT_COMMAND_NO_RESPONSE(cmd, TYPHOON_CMD_HELLO_RESP); 482 INIT_COMMAND_NO_RESPONSE(cmd, TYPHOON_CMD_HELLO_RESP);
483 smp_wmb(); 483 wmb();
484 iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY); 484 iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY);
485 spin_unlock(&tp->command_lock); 485 spin_unlock(&tp->command_lock);
486 } 486 }
@@ -1311,13 +1311,15 @@ typhoon_init_interface(struct typhoon *tp)
1311 1311
1312 tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr); 1312 tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr);
1313 tp->card_state = Sleeping; 1313 tp->card_state = Sleeping;
1314 smp_wmb();
1315 1314
1316 tp->offload = TYPHOON_OFFLOAD_IP_CHKSUM | TYPHOON_OFFLOAD_TCP_CHKSUM; 1315 tp->offload = TYPHOON_OFFLOAD_IP_CHKSUM | TYPHOON_OFFLOAD_TCP_CHKSUM;
1317 tp->offload |= TYPHOON_OFFLOAD_UDP_CHKSUM | TSO_OFFLOAD_ON; 1316 tp->offload |= TYPHOON_OFFLOAD_UDP_CHKSUM | TSO_OFFLOAD_ON;
1318 1317
1319 spin_lock_init(&tp->command_lock); 1318 spin_lock_init(&tp->command_lock);
1320 spin_lock_init(&tp->state_lock); 1319 spin_lock_init(&tp->state_lock);
1320
1321 /* Force the writes to the shared memory area out before continuing. */
1322 wmb();
1321} 1323}
1322 1324
1323static void 1325static void