aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2009-04-02 04:09:43 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-02 04:09:43 -0400
commit4ff61c8f7b5e1e60620a04a64ac0715c0822fdac (patch)
tree4748d41f682375bd09a3ef6e2a4ae7376937fe7a /drivers/net/usb
parentf2bde7328633269ee935d9ed96535ade15cc348f (diff)
kaweth: Fix locking to be SMP-safe
On an SMP system, the following message is printed. The patch below gets fixes the problem. ================================= [ INFO: inconsistent lock state ] 2.6.29-Linus-05093-gc31f403 #57 --------------------------------- inconsistent {hardirq-on-W} -> {in-hardirq-W} usage. bash/4105 [HC1[1]:SC0[0]:HE0:SE1] takes: (&kaweth->device_lock){+...}, at: [<ffffffffa01aa286>] kaweth_usb_receive+0x77/0x1af [kaw eth] {hardirq-on-W} state was registered at: [<ffffffff80260503>] __lock_acquire+0x753/0x1685 [<ffffffff8026148a>] lock_acquire+0x55/0x71 [<ffffffff80461ba6>] _spin_lock+0x31/0x3d [<ffffffffa01aaa0c>] kaweth_start_xmit+0x2b/0x1e1 [kaweth] [<ffffffff803eccd3>] dev_hard_start_xmit+0x22e/0x2ad [<ffffffff803fe120>] __qdisc_run+0xf2/0x203 [<ffffffff803ed0cd>] dev_queue_xmit+0x263/0x39b [<ffffffffa03a47cb>] packet_sendmsg_spkt+0x1c4/0x20a [af_packet] [<ffffffff803de0c2>] sock_sendmsg+0xe4/0xfd [<ffffffff803dec8f>] sys_sendto+0xe4/0x10c [<ffffffff8020bccb>] system_call_fastpath+0x16/0x1b [<ffffffffffffffff>] 0xffffffffffffffff irq event stamp: 1280 hardirqs last enabled at (1279): [<ffffffff80461a71>] _spin_unlock_irqrestore+0x44/0x4c hardirqs last disabled at (1280): [<ffffffff8020bad7>] save_args+0x67/0x70 softirqs last enabled at (660): [<ffffffff8024192c>] __do_softirq+0x14d/0x15d softirqs last disabled at (651): [<ffffffff8020ce9c>] call_softirq+0x1c/0x28 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/kaweth.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 7cb10a0a5316..3d0d0b0b37c5 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -36,7 +36,6 @@
36 * Run test procedures 36 * Run test procedures
37 * Fix bugs from previous two steps 37 * Fix bugs from previous two steps
38 * Snoop other OSs for any tricks we're not doing 38 * Snoop other OSs for any tricks we're not doing
39 * SMP locking
40 * Reduce arbitrary timeouts 39 * Reduce arbitrary timeouts
41 * Smart multicast support 40 * Smart multicast support
42 * Temporary MAC change support 41 * Temporary MAC change support
@@ -796,7 +795,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)
796 795
797 int res; 796 int res;
798 797
799 spin_lock(&kaweth->device_lock); 798 spin_lock_irq(&kaweth->device_lock);
800 799
801 kaweth_async_set_rx_mode(kaweth); 800 kaweth_async_set_rx_mode(kaweth);
802 netif_stop_queue(net); 801 netif_stop_queue(net);
@@ -814,7 +813,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)
814 if (!copied_skb) { 813 if (!copied_skb) {
815 kaweth->stats.tx_errors++; 814 kaweth->stats.tx_errors++;
816 netif_start_queue(net); 815 netif_start_queue(net);
817 spin_unlock(&kaweth->device_lock); 816 spin_unlock_irq(&kaweth->device_lock);
818 return 0; 817 return 0;
819 } 818 }
820 } 819 }
@@ -848,7 +847,7 @@ skip:
848 net->trans_start = jiffies; 847 net->trans_start = jiffies;
849 } 848 }
850 849
851 spin_unlock(&kaweth->device_lock); 850 spin_unlock_irq(&kaweth->device_lock);
852 851
853 return 0; 852 return 0;
854} 853}