Ming Lei
f8e1d0803d
ath9k-htc: fix lockdep warning and kernel warning after unplugging ar9271 usb device
This patch fixes two warnings below after unplugging ar9271 usb device:
-one is a kernel warning[1]
-another is a lockdep warning[2]
The root reason is that __skb_queue_purge can't be executed in hardirq
context, so the patch forks ath9k_skb_queue_purge(ath9k version of _skb_queue_purge),
which frees skb with dev_kfree_skb_any which can be run in hardirq
context safely, then prevent the lockdep warning and kernel warning after
unplugging ar9271 usb device.
[1] kernel warning
[ 602.894005] ------------[ cut here ]------------
[ 602.894005] WARNING: at net/core/skbuff.c:398 skb_release_head_state+0x71/0x87()
[ 602.894005] Hardware name: 6475EK2
[ 602.894005] Modules linked in: ath9k_htc ath9k ath9k_common ath9k_hw ath bridge stp llc sunrpc ipv6 cpufreq_ondemand acpi_cpufreq freq_table kvm_intel kvm arc4 ecb mac80211 snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep thinkpad_acpi snd_pcm snd_timer hwmon iTCO_wdt snd e1000e pcspkr i2c_i801 usbhid iTCO_vendor_support wmi cfg80211 yenta_socket rsrc_nonstatic pata_acpi snd_page_alloc soundcore uhci_hcd ohci_hcd ehci_hcd usbcore i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: ath]
[ 602.894005] Pid: 2506, comm: ping Tainted: G W 2.6.34-rc3-wl #20
[ 602.894005] Call Trace:
[ 602.894005] <IRQ> [<ffffffff8104a41c>] warn_slowpath_common+0x7c/0x94
[ 602.894005] [<ffffffffa022f398>] ? __skb_queue_purge+0x43/0x4a [ath9k_htc]
[ 602.894005] [<ffffffff8104a448>] warn_slowpath_null+0x14/0x16
[ 602.894005] [<ffffffff813269c1>] skb_release_head_state+0x71/0x87
[ 602.894005] [<ffffffff8132829a>] __kfree_skb+0x16/0x81
[ 602.894005] [<ffffffff813283b2>] kfree_skb+0x7e/0x86
[ 602.894005] [<ffffffffa022f398>] __skb_queue_purge+0x43/0x4a [ath9k_htc]
[ 602.894005] [<ffffffffa022f560>] __hif_usb_tx+0x1c1/0x21b [ath9k_htc]
[ 602.894005] [<ffffffffa022f73c>] hif_usb_tx_cb+0x12f/0x154 [ath9k_htc]
[ 602.894005] [<ffffffffa00d2fbe>] usb_hcd_giveback_urb+0x91/0xc5 [usbcore]
[ 602.894005] [<ffffffffa00f6c34>] ehci_urb_done+0x7a/0x8b [ehci_hcd]
[ 602.894005] [<ffffffffa00f6f33>] qh_completions+0x2ee/0x376 [ehci_hcd]
[ 602.894005] [<ffffffffa00f8ba5>] ehci_work+0x95/0x76e [ehci_hcd]
[ 602.894005] [<ffffffffa00fa5ae>] ? ehci_irq+0x2f/0x1d4 [ehci_hcd]
[ 602.894005] [<ffffffffa00fa725>] ehci_irq+0x1a6/0x1d4 [ehci_hcd]
[ 602.894005] [<ffffffff810a6d18>] ? __rcu_process_callbacks+0x7a/0x2df
[ 602.894005] [<ffffffff810a47a4>] ? handle_fasteoi_irq+0x22/0xd2
[ 602.894005] [<ffffffffa00d268d>] usb_hcd_irq+0x4a/0xa7 [usbcore]
[ 602.894005] [<ffffffff810a2853>] handle_IRQ_event+0x77/0x14f
[ 602.894005] [<ffffffff813285ce>] ? skb_release_data+0xc9/0xce
[ 602.894005] [<ffffffff810a4814>] handle_fasteoi_irq+0x92/0xd2
[ 602.894005] [<ffffffff8100c4fb>] handle_irq+0x88/0x91
[ 602.894005] [<ffffffff8100baed>] do_IRQ+0x63/0xc9
[ 602.894005] [<ffffffff81354245>] ? ip_flush_pending_frames+0x4d/0x5c
[ 602.894005] [<ffffffff813ba993>] ret_from_intr+0x0/0x16
[ 602.894005] <EOI> [<ffffffff811095fe>] ? __delete_object+0x5a/0xb1
[ 602.894005] [<ffffffff813ba5f5>] ? _raw_write_unlock_irqrestore+0x47/0x7e
[ 602.894005] [<ffffffff813ba5fa>] ? _raw_write_unlock_irqrestore+0x4c/0x7e
[ 602.894005] [<ffffffff811095fe>] __delete_object+0x5a/0xb1
[ 602.894005] [<ffffffff81109814>] delete_object_full+0x25/0x31
[ 602.894005] [<ffffffff813a60c0>] kmemleak_free+0x26/0x45
[ 602.894005] [<ffffffff810ff517>] kfree+0xaa/0x149
[ 602.894005] [<ffffffff81323fb7>] ? sock_def_write_space+0x84/0x89
[ 602.894005] [<ffffffff81354245>] ? ip_flush_pending_frames+0x4d/0x5c
[ 602.894005] [<ffffffff813285ce>] skb_release_data+0xc9/0xce
[ 602.894005] [<ffffffff813282a2>] __kfree_skb+0x1e/0x81
[ 602.894005] [<ffffffff813283b2>] kfree_skb+0x7e/0x86
[ 602.894005] [<ffffffff81354245>] ip_flush_pending_frames+0x4d/0x5c
[ 602.894005] [<ffffffff81370c1f>] raw_sendmsg+0x653/0x709
[ 602.894005] [<ffffffff81379e31>] inet_sendmsg+0x54/0x5d
[ 602.894005] [<ffffffff813207a2>] ? sock_recvmsg+0xc6/0xdf
[ 602.894005] [<ffffffff813208c1>] sock_sendmsg+0xc0/0xd9
[ 602.894005] [<ffffffff810e13b4>] ? might_fault+0x68/0xb8
[ 602.894005] [<ffffffff810e13fd>] ? might_fault+0xb1/0xb8
[ 602.894005] [<ffffffff8132a1c3>] ? copy_from_user+0x2f/0x31
[ 602.894005] [<ffffffff8132a5b3>] ? verify_iovec+0x54/0x91
[ 602.894005] [<ffffffff81320d41>] sys_sendmsg+0x1da/0x241
[ 602.894005] [<ffffffff8103d327>] ? finish_task_switch+0x0/0xc9
[ 602.894005] [<ffffffff8103d327>] ? finish_task_switch+0x0/0xc9
[ 602.894005] [<ffffffff8107642e>] ? trace_hardirqs_on_caller+0x16/0x150
[ 602.894005] [<ffffffff813ba27d>] ? _raw_spin_unlock_irq+0x56/0x63
[ 602.894005] [<ffffffff8103d3cb>] ? finish_task_switch+0xa4/0xc9
[ 602.894005] [<ffffffff8103d327>] ? finish_task_switch+0x0/0xc9
[ 602.894005] [<ffffffff810357fe>] ? need_resched+0x23/0x2d
[ 602.894005] [<ffffffff8107642e>] ? trace_hardirqs_on_caller+0x16/0x150
[ 602.894005] [<ffffffff813b9750>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 602.894005] [<ffffffff81009c02>] system_call_fastpath+0x16/0x1b
[ 602.894005] ---[ end trace 91ba2d8dc7826839 ]---
[2] lockdep warning
[ 169.363215] ======================================================
[ 169.365390] [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]
[ 169.366334] 2.6.34-rc3-wl #20
[ 169.366872] ------------------------------------------------------
[ 169.366872] khubd/78 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
[ 169.366872] (clock-AF_INET){++.?..}, at: [<ffffffff81323f51>] sock_def_write_space+0x1e/0x89
[ 169.366872]
[ 169.366872] and this task is already holding:
[ 169.366872] (&(&hif_dev->tx.tx_lock)->rlock){-.-...}, at: [<ffffffffa03715b0>] hif_usb_stop+0x24/0x53 [ath9k_htc]
[ 169.366872] which would create a new lock dependency:
[ 169.366872] (&(&hif_dev->tx.tx_lock)->rlock){-.-...} -> (clock-AF_INET){++.?..}
[ 169.366872]
[ 169.366872] but this new dependency connects a HARDIRQ-irq-safe lock:
[ 169.366872] (&(&hif_dev->tx.tx_lock)->rlock){-.-...}
[ 169.366872] ... which became HARDIRQ-irq-safe at:
[ 169.366872] [<ffffffff810772d5>] __lock_acquire+0x2c6/0xd2b
[ 169.366872] [<ffffffff8107866d>] lock_acquire+0xec/0x119
[ 169.366872] [<ffffffff813b99bb>] _raw_spin_lock+0x40/0x73
[ 169.366872] [<ffffffffa037163d>] hif_usb_tx_cb+0x5e/0x154 [ath9k_htc]
[ 169.366872] [<ffffffffa00d2fbe>] usb_hcd_giveback_urb+0x91/0xc5 [usbcore]
[ 169.366872] [<ffffffffa00f6c34>] ehci_urb_done+0x7a/0x8b [ehci_hcd]
[ 169.366872] [<ffffffffa00f6f33>] qh_completions+0x2ee/0x376 [ehci_hcd]
[ 169.366872] [<ffffffffa00f8ba5>] ehci_work+0x95/0x76e [ehci_hcd]
[ 169.366872] [<ffffffffa00fa725>] ehci_irq+0x1a6/0x1d4 [ehci_hcd]
[ 169.366872] [<ffffffffa00d268d>] usb_hcd_irq+0x4a/0xa7 [usbcore]
[ 169.366872] [<ffffffff810a2853>] handle_IRQ_event+0x77/0x14f
[ 169.366872] [<ffffffff810a4814>] handle_fasteoi_irq+0x92/0xd2
[ 169.366872] [<ffffffff8100c4fb>] handle_irq+0x88/0x91
[ 169.366872] [<ffffffff8100baed>] do_IRQ+0x63/0xc9
[ 169.366872] [<ffffffff813ba993>] ret_from_intr+0x0/0x16
[ 169.366872] [<ffffffff8130f6ee>] cpuidle_idle_call+0xa7/0x115
[ 169.366872] [<ffffffff81008c4f>] cpu_idle+0x68/0xc4
[ 169.366872] [<ffffffff813a41e0>] rest_init+0x104/0x10b
[ 169.366872] [<ffffffff81899db3>] start_kernel+0x3f1/0x3fc
[ 169.366872] [<ffffffff818992c8>] x86_64_start_reservations+0xb3/0xb7
[ 169.366872] [<ffffffff818993c4>] x86_64_start_kernel+0xf8/0x107
[ 169.366872]
[ 169.366872] to a HARDIRQ-irq-unsafe lock:
[ 169.366872] (clock-AF_INET){++.?..}
[ 169.366872] ... which became HARDIRQ-irq-unsafe at:
[ 169.366872] ... [<ffffffff81077349>] __lock_acquire+0x33a/0xd2b
[ 169.366872] [<ffffffff8107866d>] lock_acquire+0xec/0x119
[ 169.366872] [<ffffffff813b9d07>] _raw_write_lock_bh+0x45/0x7a
[ 169.366872] [<ffffffff8135cf14>] tcp_close+0x165/0x34d
[ 169.366872] [<ffffffff8137aced>] inet_release+0x55/0x5c
[ 169.366872] [<ffffffff81321350>] sock_release+0x1f/0x6e
[ 169.366872] [<ffffffff813213c6>] sock_close+0x27/0x2b
[ 169.366872] [<ffffffff8110dd45>] __fput+0x125/0x1ca
[ 169.366872] [<ffffffff8110de04>] fput+0x1a/0x1c
[ 169.366872] [<ffffffff8110adc9>] filp_close+0x68/0x72
[ 169.366872] [<ffffffff8110ae80>] sys_close+0xad/0xe7
[ 169.366872] [<ffffffff81009c02>] system_call_fastpath+0x16/0x1b
(Trimmed at the "other info that might help us debug this" line in
the interest of brevity... -- JWL)
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-14 14:58:37 -04:00
..
2010-02-22 15:45:51 -08:00
2010-01-07 23:54:26 -08:00
2010-03-07 15:25:49 -08:00
2010-02-22 15:45:51 -08:00
2010-02-22 15:45:51 -08:00
2010-02-22 15:45:51 -08:00
2010-03-08 10:45:28 -08:00
2010-02-27 02:52:05 -08:00
2010-03-08 12:13:57 -08:00
2010-02-26 01:38:34 -08:00
2010-02-17 13:27:12 -08:00
2010-03-04 00:53:54 -08:00
2010-02-25 23:22:42 -08:00
2010-03-05 14:00:18 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2010-02-27 02:34:36 -08:00
2010-01-03 21:42:50 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2010-03-07 15:25:51 -08:00
2010-02-22 15:45:52 -08:00
2010-02-27 03:28:24 -08:00
2010-02-12 11:38:58 -08:00
2009-10-13 12:55:20 -07:00
2010-02-19 13:19:51 -08:00
2010-02-26 04:18:34 -08:00
2010-02-26 02:07:30 -08:00
2010-02-26 02:08:33 -08:00
2010-02-28 19:23:06 -08:00
2010-02-17 17:27:40 -08:00
2010-03-08 10:45:30 -08:00
2010-02-26 02:07:30 -08:00
2010-02-25 23:22:42 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:51 -08:00
2010-02-18 14:47:50 -08:00
2010-03-07 15:25:51 -08:00
2010-02-26 02:07:31 -08:00
2010-02-26 02:07:31 -08:00
2010-01-07 23:54:26 -08:00
2010-01-28 06:12:38 -08:00
2010-04-14 14:58:37 -04:00
2010-02-18 14:47:48 -08:00
2010-02-18 14:47:48 -08:00
2009-09-01 01:13:50 -07:00
2009-12-03 13:18:01 -08:00
2010-02-18 14:47:48 -08:00
2009-12-26 20:24:45 -08:00
2010-02-12 11:38:58 -08:00
2010-02-18 14:47:48 -08:00
2010-02-18 14:47:48 -08:00
2010-02-18 14:47:48 -08:00
2010-02-22 15:45:51 -08:00
2010-02-17 17:45:18 -08:00
2010-02-17 17:45:18 -08:00
2009-09-01 01:14:07 -07:00
2009-09-01 01:14:07 -07:00
2009-09-01 01:14:07 -07:00
2010-02-22 15:45:51 -08:00
2010-02-22 15:45:51 -08:00
2010-02-12 11:38:58 -08:00
2009-09-01 01:14:07 -07:00
2010-02-22 15:45:51 -08:00
2010-02-22 15:45:51 -08:00
2010-02-12 11:38:58 -08:00
2009-12-04 15:39:55 +01:00
2010-02-22 15:45:51 -08:00
2010-02-12 11:38:58 -08:00
2010-02-22 15:45:51 -08:00
2010-02-28 19:23:06 -08:00
2010-02-27 12:53:02 +01:00
2010-02-08 22:44:18 -08:00
2010-02-22 15:45:51 -08:00
2010-02-22 15:45:51 -08:00
2009-09-17 20:07:53 +02:00
2010-02-22 15:45:51 -08:00
2010-02-22 15:45:51 -08:00
2010-02-28 00:43:33 -08:00
2010-02-16 15:19:03 -08:00
2009-08-12 23:03:00 -07:00
2010-02-17 13:35:44 -08:00
2010-02-17 13:35:44 -08:00
2010-02-17 13:35:44 -08:00
2009-08-12 23:02:59 -07:00
2010-02-17 17:45:20 -08:00
2009-11-05 20:00:29 -08:00
2010-02-28 18:37:12 -08:00
2009-12-09 19:43:33 -08:00
2010-02-17 17:45:20 -08:00
2010-03-03 01:04:39 -08:00
2010-02-26 02:10:14 -08:00
2010-02-26 02:10:14 -08:00
2010-02-26 02:10:14 -08:00
2010-02-26 02:10:14 -08:00
2010-03-07 15:25:53 -08:00
2010-02-17 13:27:12 -08:00
2010-03-03 01:04:39 -08:00
2010-02-12 11:38:58 -08:00
2010-02-17 13:27:12 -08:00
2010-02-17 13:27:12 -08:00
2010-02-18 14:47:47 -08:00
2010-02-17 13:27:12 -08:00
2010-01-07 23:54:26 -08:00
2010-02-17 13:27:12 -08:00
2009-11-11 19:22:21 -08:00
2009-09-01 01:14:07 -07:00
2009-09-01 01:13:40 -07:00
2010-02-22 15:45:52 -08:00
2009-12-03 13:18:01 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2010-02-12 11:38:58 -08:00
2010-02-22 15:45:52 -08:00
2009-10-11 11:20:58 -07:00
2010-02-12 11:38:58 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2009-10-14 14:54:52 -07:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2009-12-30 22:03:43 -08:00
2009-11-02 23:40:57 -08:00
2009-11-02 23:40:59 -08:00
2009-12-03 13:18:01 -08:00
2010-03-04 00:53:53 -08:00
2009-12-18 20:38:37 -08:00
2010-02-26 04:18:43 -08:00
2010-02-17 15:59:40 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2009-12-03 13:18:01 -08:00
2009-09-07 01:56:52 -07:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2009-11-20 15:35:04 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2010-02-22 15:45:52 -08:00
2009-12-03 13:18:01 -08:00
2010-02-26 02:07:30 -08:00
2010-02-12 13:27:46 -08:00
2010-03-02 07:55:08 -08:00
2010-02-26 02:07:30 -08:00
2009-10-13 11:48:18 -07:00
2010-02-26 02:07:30 -08:00
2010-02-26 02:07:30 -08:00
2009-10-20 19:11:06 -07:00
2010-02-26 02:07:30 -08:00
2010-02-12 11:38:58 -08:00
2009-12-04 15:39:55 +01:00
2010-02-26 02:07:30 -08:00
2010-02-26 02:07:30 -08:00
2010-02-26 02:07:30 -08:00
2010-02-16 23:05:38 -08:00
2010-02-26 02:07:30 -08:00
2010-02-26 02:07:30 -08:00
2010-01-09 23:00:32 -08:00
2010-02-26 02:07:30 -08:00
2010-02-28 19:23:06 -08:00
2010-02-28 19:23:06 -08:00
2010-02-27 18:31:11 +01:00
2010-02-03 20:20:33 -08:00
2010-02-18 14:08:38 -08:00
2010-02-17 15:59:40 -08:00
2009-10-12 23:59:08 -07:00
2010-01-28 06:01:35 -08:00
2009-09-03 20:02:11 -07:00
2009-11-18 23:29:17 -08:00
2010-02-26 02:07:30 -08:00
2009-12-26 20:38:23 -08:00
2010-02-26 02:07:30 -08:00
2010-01-07 23:54:26 -08:00
2009-11-18 23:29:17 -08:00
2010-02-26 02:07:30 -08:00
2010-02-12 11:38:58 -08:00
2010-02-26 02:07:30 -08:00
2010-02-26 02:07:30 -08:00
2010-02-12 11:38:58 -08:00
2009-10-12 13:26:39 -07:00
2010-01-07 23:54:26 -08:00
2010-02-26 02:07:30 -08:00
2010-02-26 02:07:30 -08:00
2009-12-03 13:18:01 -08:00
2009-12-03 13:18:01 -08:00
2009-12-03 13:18:01 -08:00
2010-01-19 02:12:34 -08:00
2009-12-03 13:18:01 -08:00
2009-12-03 13:18:01 -08:00
2009-12-03 13:18:01 -08:00
2009-12-01 16:15:57 -08:00
2009-11-05 22:18:14 -08:00
2010-02-26 02:07:30 -08:00
2009-12-02 00:52:31 -08:00
2010-03-23 16:50:28 -04:00
2009-11-09 09:40:57 +01:00
2010-01-18 00:29:19 -08:00
2010-02-26 02:07:30 -08:00
2010-03-04 00:53:53 -08:00
2009-09-21 15:14:54 +02:00
2010-01-10 22:55:03 -08:00
2009-09-01 01:14:07 -07:00
2010-03-05 14:00:19 -08:00
2009-08-30 22:35:11 -07:00
2009-12-03 13:18:01 -08:00
2009-11-18 23:29:17 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2009-11-18 23:29:17 -08:00
2010-02-12 11:38:58 -08:00
2010-01-10 22:55:03 -08:00
2009-10-13 03:44:05 -07:00
2010-03-02 03:44:41 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2009-10-01 15:14:54 -07:00
2010-02-18 14:47:49 -08:00
2010-02-12 16:21:01 -08:00
2009-12-03 13:18:01 -08:00
2010-02-26 02:07:31 -08:00
2010-03-05 13:56:40 -08:00
2010-02-26 02:07:31 -08:00
2010-02-15 09:27:02 -08:00
2010-02-26 02:07:31 -08:00
2009-12-03 13:18:01 -08:00
2010-02-18 14:47:48 -08:00
2009-12-04 15:39:55 +01:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2010-02-26 02:07:31 -08:00
2010-02-18 14:47:49 -08:00
2010-02-12 11:38:58 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2009-12-03 13:18:01 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2010-02-18 14:47:49 -08:00
2010-02-26 02:08:42 -08:00
2010-02-26 02:07:31 -08:00
2010-02-16 15:45:43 -08:00
2010-02-28 00:43:34 -08:00
2010-02-17 17:27:40 -08:00
2010-02-26 02:07:31 -08:00
2010-01-13 20:37:01 -08:00
2010-02-26 02:07:31 -08:00
2010-02-17 16:35:17 -08:00
2010-03-05 14:00:18 -08:00
2009-08-30 21:51:47 -07:00
2010-02-26 02:07:31 -08:00
2010-01-06 20:32:38 -08:00
2010-02-27 02:43:40 -08:00
2010-02-26 02:07:31 -08:00
2010-02-26 02:07:31 -08:00
2009-11-26 15:51:29 -08:00
2010-03-02 03:57:33 -08:00
2009-11-04 08:47:24 -08:00
2010-02-15 21:51:00 -08:00
2009-11-18 23:29:17 -08:00
2010-02-26 02:07:31 -08:00
2010-02-26 02:07:31 -08:00
2009-08-09 21:46:53 -07:00