aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sc92031.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-04-09 14:51:15 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-09 16:31:14 -0400
commit699784b7614ce61b16a075445b8e5b6c379c5086 (patch)
treeb6eba3c51a434838c96b1de6114146485db72b71 /drivers/net/sc92031.c
parentbb8a954f27ed8fb8f57e80e6b63d837cfdcad689 (diff)
[SC92031]: Fix priv->lock context
The spin_lock calls made in dev->open and dev->close must disable BH since open/close are made in process context. Conversely, the call in dev->hard_start_xmit does not need to disable BH since it is already executing with BH disabled. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sc92031.c')
-rw-r--r--drivers/net/sc92031.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 4a926f20b6ea..c32c21af3fdd 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -964,7 +964,7 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
964 goto out; 964 goto out;
965 } 965 }
966 966
967 spin_lock_bh(&priv->lock); 967 spin_lock(&priv->lock);
968 968
969 if (unlikely(!netif_carrier_ok(dev))) { 969 if (unlikely(!netif_carrier_ok(dev))) {
970 err = -ENOLINK; 970 err = -ENOLINK;
@@ -1005,7 +1005,7 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
1005 netif_stop_queue(dev); 1005 netif_stop_queue(dev);
1006 1006
1007out_unlock: 1007out_unlock:
1008 spin_unlock_bh(&priv->lock); 1008 spin_unlock(&priv->lock);
1009 1009
1010out: 1010out:
1011 dev_kfree_skb(skb); 1011 dev_kfree_skb(skb);
@@ -1042,12 +1042,12 @@ static int sc92031_open(struct net_device *dev)
1042 priv->pm_config = 0; 1042 priv->pm_config = 0;
1043 1043
1044 /* Interrupts already disabled by sc92031_stop or sc92031_probe */ 1044 /* Interrupts already disabled by sc92031_stop or sc92031_probe */
1045 spin_lock(&priv->lock); 1045 spin_lock_bh(&priv->lock);
1046 1046
1047 _sc92031_reset(dev); 1047 _sc92031_reset(dev);
1048 mmiowb(); 1048 mmiowb();
1049 1049
1050 spin_unlock(&priv->lock); 1050 spin_unlock_bh(&priv->lock);
1051 sc92031_enable_interrupts(dev); 1051 sc92031_enable_interrupts(dev);
1052 1052
1053 if (netif_carrier_ok(dev)) 1053 if (netif_carrier_ok(dev))
@@ -1077,13 +1077,13 @@ static int sc92031_stop(struct net_device *dev)
1077 /* Disable interrupts, stop Tx and Rx. */ 1077 /* Disable interrupts, stop Tx and Rx. */
1078 sc92031_disable_interrupts(dev); 1078 sc92031_disable_interrupts(dev);
1079 1079
1080 spin_lock(&priv->lock); 1080 spin_lock_bh(&priv->lock);
1081 1081
1082 _sc92031_disable_tx_rx(dev); 1082 _sc92031_disable_tx_rx(dev);
1083 _sc92031_tx_clear(dev); 1083 _sc92031_tx_clear(dev);
1084 mmiowb(); 1084 mmiowb();
1085 1085
1086 spin_unlock(&priv->lock); 1086 spin_unlock_bh(&priv->lock);
1087 1087
1088 free_irq(pdev->irq, dev); 1088 free_irq(pdev->irq, dev);
1089 pci_free_consistent(pdev, TX_BUF_TOT_LEN, priv->tx_bufs, 1089 pci_free_consistent(pdev, TX_BUF_TOT_LEN, priv->tx_bufs,
@@ -1539,13 +1539,13 @@ static int sc92031_suspend(struct pci_dev *pdev, pm_message_t state)
1539 /* Disable interrupts, stop Tx and Rx. */ 1539 /* Disable interrupts, stop Tx and Rx. */
1540 sc92031_disable_interrupts(dev); 1540 sc92031_disable_interrupts(dev);
1541 1541
1542 spin_lock(&priv->lock); 1542 spin_lock_bh(&priv->lock);
1543 1543
1544 _sc92031_disable_tx_rx(dev); 1544 _sc92031_disable_tx_rx(dev);
1545 _sc92031_tx_clear(dev); 1545 _sc92031_tx_clear(dev);
1546 mmiowb(); 1546 mmiowb();
1547 1547
1548 spin_unlock(&priv->lock); 1548 spin_unlock_bh(&priv->lock);
1549 1549
1550out: 1550out:
1551 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 1551 pci_set_power_state(pdev, pci_choose_state(pdev, state));
@@ -1565,12 +1565,12 @@ static int sc92031_resume(struct pci_dev *pdev)
1565 goto out; 1565 goto out;
1566 1566
1567 /* Interrupts already disabled by sc92031_suspend */ 1567 /* Interrupts already disabled by sc92031_suspend */
1568 spin_lock(&priv->lock); 1568 spin_lock_bh(&priv->lock);
1569 1569
1570 _sc92031_reset(dev); 1570 _sc92031_reset(dev);
1571 mmiowb(); 1571 mmiowb();
1572 1572
1573 spin_unlock(&priv->lock); 1573 spin_unlock_bh(&priv->lock);
1574 sc92031_enable_interrupts(dev); 1574 sc92031_enable_interrupts(dev);
1575 1575
1576 netif_device_attach(dev); 1576 netif_device_attach(dev);