aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-09 14:34:58 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-12 15:27:20 -0500
commitf2e46561cc1afa82b18b2fc6efc8510ec57c7d7d (patch)
tree1d73466e4b0893bfd679f8efb9f2428afdf2a106 /drivers
parent91c86df5a8a44157b456bf1e91fc6d878582e68c (diff)
[PATCH] sky2: no irq disable needed during tx
Don't need to disable interrupts during the transmit routine. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sky2.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 2cb6406c9635..eae270d81808 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -868,15 +868,14 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
868 struct sky2_port *sky2 = netdev_priv(dev); 868 struct sky2_port *sky2 = netdev_priv(dev);
869 struct sky2_hw *hw = sky2->hw; 869 struct sky2_hw *hw = sky2->hw;
870 u16 port = sky2->port; 870 u16 port = sky2->port;
871 unsigned long flags;
872 871
873 spin_lock_irqsave(&sky2->tx_lock, flags); 872 spin_lock(&sky2->tx_lock);
874 873
875 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON); 874 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON);
876 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON); 875 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON);
877 sky2->vlgrp = grp; 876 sky2->vlgrp = grp;
878 877
879 spin_unlock_irqrestore(&sky2->tx_lock, flags); 878 spin_unlock(&sky2->tx_lock);
880} 879}
881 880
882static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 881static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
@@ -884,16 +883,15 @@ static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
884 struct sky2_port *sky2 = netdev_priv(dev); 883 struct sky2_port *sky2 = netdev_priv(dev);
885 struct sky2_hw *hw = sky2->hw; 884 struct sky2_hw *hw = sky2->hw;
886 u16 port = sky2->port; 885 u16 port = sky2->port;
887 unsigned long flags;
888 886
889 spin_lock_irqsave(&sky2->tx_lock, flags); 887 spin_lock(&sky2->tx_lock);
890 888
891 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF); 889 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF);
892 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF); 890 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF);
893 if (sky2->vlgrp) 891 if (sky2->vlgrp)
894 sky2->vlgrp->vlan_devices[vid] = NULL; 892 sky2->vlgrp->vlan_devices[vid] = NULL;
895 893
896 spin_unlock_irqrestore(&sky2->tx_lock, flags); 894 spin_unlock(&sky2->tx_lock);
897} 895}
898#endif 896#endif
899 897
@@ -1072,6 +1070,8 @@ static inline unsigned tx_le_req(const struct sk_buff *skb)
1072 * A single packet can generate multiple list elements, and 1070 * A single packet can generate multiple list elements, and
1073 * the number of ring elements will probably be less than the number 1071 * the number of ring elements will probably be less than the number
1074 * of list elements used. 1072 * of list elements used.
1073 *
1074 * No BH disabling for tx_lock here (like tg3)
1075 */ 1075 */
1076static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) 1076static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1077{ 1077{
@@ -1079,22 +1079,18 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1079 struct sky2_hw *hw = sky2->hw; 1079 struct sky2_hw *hw = sky2->hw;
1080 struct sky2_tx_le *le = NULL; 1080 struct sky2_tx_le *le = NULL;
1081 struct ring_info *re; 1081 struct ring_info *re;
1082 unsigned long flags;
1083 unsigned i, len; 1082 unsigned i, len;
1084 dma_addr_t mapping; 1083 dma_addr_t mapping;
1085 u32 addr64; 1084 u32 addr64;
1086 u16 mss; 1085 u16 mss;
1087 u8 ctrl; 1086 u8 ctrl;
1088 1087
1089 local_irq_save(flags); 1088 if (!spin_trylock(&sky2->tx_lock))
1090 if (!spin_trylock(&sky2->tx_lock)) {
1091 local_irq_restore(flags);
1092 return NETDEV_TX_LOCKED; 1089 return NETDEV_TX_LOCKED;
1093 }
1094 1090
1095 if (unlikely(tx_avail(sky2) < tx_le_req(skb))) { 1091 if (unlikely(tx_avail(sky2) < tx_le_req(skb))) {
1096 netif_stop_queue(dev); 1092 netif_stop_queue(dev);
1097 spin_unlock_irqrestore(&sky2->tx_lock, flags); 1093 spin_unlock(&sky2->tx_lock);
1098 1094
1099 printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", 1095 printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",
1100 dev->name); 1096 dev->name);
@@ -1226,7 +1222,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1226 1222
1227out_unlock: 1223out_unlock:
1228 mmiowb(); 1224 mmiowb();
1229 spin_unlock_irqrestore(&sky2->tx_lock, flags); 1225 spin_unlock(&sky2->tx_lock);
1230 1226
1231 dev->trans_start = jiffies; 1227 dev->trans_start = jiffies;
1232 return NETDEV_TX_OK; 1228 return NETDEV_TX_OK;