aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-01-17 16:43:14 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-17 19:27:29 -0500
commit762c2de2e61ef5f3c866d00861e6b1509cd8eacf (patch)
tree7e995313877766e8013fa03b8305fbaa1139b808
parent1c28f6ba600d05be2dc7ab0592e4d845f668a485 (diff)
[PATCH] sky2: write barrier's
Be more careful about memory barriers. The only place we really need them is before and after updating the chip's ring interface. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/sky2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 178249a96e1c..1407ff2da41e 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -707,6 +707,7 @@ static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2)
707static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, 707static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q,
708 u16 idx, u16 *last, u16 size) 708 u16 idx, u16 *last, u16 size)
709{ 709{
710 wmb();
710 if (is_ec_a1(hw) && idx < *last) { 711 if (is_ec_a1(hw) && idx < *last) {
711 u16 hwget = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX)); 712 u16 hwget = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX));
712 713
@@ -730,6 +731,7 @@ setnew:
730 sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx); 731 sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx);
731 } 732 }
732 *last = idx; 733 *last = idx;
734 mmiowb();
733} 735}
734 736
735 737
@@ -1253,7 +1255,6 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1253 netif_stop_queue(dev); 1255 netif_stop_queue(dev);
1254 1256
1255out_unlock: 1257out_unlock:
1256 mmiowb();
1257 spin_unlock(&sky2->tx_lock); 1258 spin_unlock(&sky2->tx_lock);
1258 1259
1259 dev->trans_start = jiffies; 1260 dev->trans_start = jiffies;
@@ -1896,7 +1897,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
1896 1897
1897exit_loop: 1898exit_loop:
1898 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); 1899 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
1899 mmiowb();
1900 1900
1901 sky2_tx_check(hw, 0, tx_done[0]); 1901 sky2_tx_check(hw, 0, tx_done[0]);
1902 sky2_tx_check(hw, 1, tx_done[1]); 1902 sky2_tx_check(hw, 1, tx_done[1]);
@@ -1911,7 +1911,6 @@ exit_loop:
1911 netif_rx_complete(dev0); 1911 netif_rx_complete(dev0);
1912 hw->intr_mask |= Y2_IS_STAT_BMU; 1912 hw->intr_mask |= Y2_IS_STAT_BMU;
1913 sky2_write32(hw, B0_IMSK, hw->intr_mask); 1913 sky2_write32(hw, B0_IMSK, hw->intr_mask);
1914 mmiowb();
1915 return 0; 1914 return 0;
1916 } else { 1915 } else {
1917 *budget -= work_done; 1916 *budget -= work_done;