Return-path: Received: from mail-pw0-f46.google.com ([209.85.160.46]:49426 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346Ab0DJQKw (ORCPT ); Sat, 10 Apr 2010 12:10:52 -0400 Received: by pwj9 with SMTP id 9so3586362pwj.19 for ; Sat, 10 Apr 2010 09:10:51 -0700 (PDT) From: tom.leiming@gmail.com To: Sujith.Manoharan@atheros.com, lrodriguez@atheros.com Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com, Ming Lei Subject: [PATCH] ath9k-htc: fix lockdep warning and kernel warning after unplugging ar9271 usb device Date: Sun, 11 Apr 2010 00:10:27 +0800 Message-Id: <1270915827-4525-1-git-send-email-tom.leiming@gmail.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Ming Lei 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] [] warn_slowpath_common+0x7c/0x94 [ 602.894005] [] ? __skb_queue_purge+0x43/0x4a [ath9k_htc] [ 602.894005] [] warn_slowpath_null+0x14/0x16 [ 602.894005] [] skb_release_head_state+0x71/0x87 [ 602.894005] [] __kfree_skb+0x16/0x81 [ 602.894005] [] kfree_skb+0x7e/0x86 [ 602.894005] [] __skb_queue_purge+0x43/0x4a [ath9k_htc] [ 602.894005] [] __hif_usb_tx+0x1c1/0x21b [ath9k_htc] [ 602.894005] [] hif_usb_tx_cb+0x12f/0x154 [ath9k_htc] [ 602.894005] [] usb_hcd_giveback_urb+0x91/0xc5 [usbcore] [ 602.894005] [] ehci_urb_done+0x7a/0x8b [ehci_hcd] [ 602.894005] [] qh_completions+0x2ee/0x376 [ehci_hcd] [ 602.894005] [] ehci_work+0x95/0x76e [ehci_hcd] [ 602.894005] [] ? ehci_irq+0x2f/0x1d4 [ehci_hcd] [ 602.894005] [] ehci_irq+0x1a6/0x1d4 [ehci_hcd] [ 602.894005] [] ? __rcu_process_callbacks+0x7a/0x2df [ 602.894005] [] ? handle_fasteoi_irq+0x22/0xd2 [ 602.894005] [] usb_hcd_irq+0x4a/0xa7 [usbcore] [ 602.894005] [] handle_IRQ_event+0x77/0x14f [ 602.894005] [] ? skb_release_data+0xc9/0xce [ 602.894005] [] handle_fasteoi_irq+0x92/0xd2 [ 602.894005] [] handle_irq+0x88/0x91 [ 602.894005] [] do_IRQ+0x63/0xc9 [ 602.894005] [] ? ip_flush_pending_frames+0x4d/0x5c [ 602.894005] [] ret_from_intr+0x0/0x16 [ 602.894005] [] ? __delete_object+0x5a/0xb1 [ 602.894005] [] ? _raw_write_unlock_irqrestore+0x47/0x7e [ 602.894005] [] ? _raw_write_unlock_irqrestore+0x4c/0x7e [ 602.894005] [] __delete_object+0x5a/0xb1 [ 602.894005] [] delete_object_full+0x25/0x31 [ 602.894005] [] kmemleak_free+0x26/0x45 [ 602.894005] [] kfree+0xaa/0x149 [ 602.894005] [] ? sock_def_write_space+0x84/0x89 [ 602.894005] [] ? ip_flush_pending_frames+0x4d/0x5c [ 602.894005] [] skb_release_data+0xc9/0xce [ 602.894005] [] __kfree_skb+0x1e/0x81 [ 602.894005] [] kfree_skb+0x7e/0x86 [ 602.894005] [] ip_flush_pending_frames+0x4d/0x5c [ 602.894005] [] raw_sendmsg+0x653/0x709 [ 602.894005] [] inet_sendmsg+0x54/0x5d [ 602.894005] [] ? sock_recvmsg+0xc6/0xdf [ 602.894005] [] sock_sendmsg+0xc0/0xd9 [ 602.894005] [] ? might_fault+0x68/0xb8 [ 602.894005] [] ? might_fault+0xb1/0xb8 [ 602.894005] [] ? copy_from_user+0x2f/0x31 [ 602.894005] [] ? verify_iovec+0x54/0x91 [ 602.894005] [] sys_sendmsg+0x1da/0x241 [ 602.894005] [] ? finish_task_switch+0x0/0xc9 [ 602.894005] [] ? finish_task_switch+0x0/0xc9 [ 602.894005] [] ? trace_hardirqs_on_caller+0x16/0x150 [ 602.894005] [] ? _raw_spin_unlock_irq+0x56/0x63 [ 602.894005] [] ? finish_task_switch+0xa4/0xc9 [ 602.894005] [] ? finish_task_switch+0x0/0xc9 [ 602.894005] [] ? need_resched+0x23/0x2d [ 602.894005] [] ? trace_hardirqs_on_caller+0x16/0x150 [ 602.894005] [] ? trace_hardirqs_on_thunk+0x3a/0x3f [ 602.894005] [] 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: [] 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: [] 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] [] __lock_acquire+0x2c6/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_spin_lock+0x40/0x73 [ 169.366872] [] hif_usb_tx_cb+0x5e/0x154 [ath9k_htc] [ 169.366872] [] usb_hcd_giveback_urb+0x91/0xc5 [usbcore] [ 169.366872] [] ehci_urb_done+0x7a/0x8b [ehci_hcd] [ 169.366872] [] qh_completions+0x2ee/0x376 [ehci_hcd] [ 169.366872] [] ehci_work+0x95/0x76e [ehci_hcd] [ 169.366872] [] ehci_irq+0x1a6/0x1d4 [ehci_hcd] [ 169.366872] [] usb_hcd_irq+0x4a/0xa7 [usbcore] [ 169.366872] [] handle_IRQ_event+0x77/0x14f [ 169.366872] [] handle_fasteoi_irq+0x92/0xd2 [ 169.366872] [] handle_irq+0x88/0x91 [ 169.366872] [] do_IRQ+0x63/0xc9 [ 169.366872] [] ret_from_intr+0x0/0x16 [ 169.366872] [] cpuidle_idle_call+0xa7/0x115 [ 169.366872] [] cpu_idle+0x68/0xc4 [ 169.366872] [] rest_init+0x104/0x10b [ 169.366872] [] start_kernel+0x3f1/0x3fc [ 169.366872] [] x86_64_start_reservations+0xb3/0xb7 [ 169.366872] [] 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] ... [] __lock_acquire+0x33a/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_write_lock_bh+0x45/0x7a [ 169.366872] [] tcp_close+0x165/0x34d [ 169.366872] [] inet_release+0x55/0x5c [ 169.366872] [] sock_release+0x1f/0x6e [ 169.366872] [] sock_close+0x27/0x2b [ 169.366872] [] __fput+0x125/0x1ca [ 169.366872] [] fput+0x1a/0x1c [ 169.366872] [] filp_close+0x68/0x72 [ 169.366872] [] sys_close+0xad/0xe7 [ 169.366872] [] system_call_fastpath+0x16/0x1b [ 169.366872] [ 169.366872] other info that might help us debug this: [ 169.366872] [ 169.366872] 5 locks held by khubd/78: [ 169.366872] #0: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x17/0x19 [ 169.366872] #1: (&wdev->mtx){+.+.+.}, at: [] cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211] [ 169.366872] #2: (&ifmgd->mtx){+.+.+.}, at: [] ieee80211_mgd_deauth+0x3f/0x18f [mac80211] [ 169.366872] #3: (&priv->mutex){+.+.+.}, at: [] ath9k_htc_config+0x41/0x496 [ath9k_htc] [ 169.366872] #4: (&(&hif_dev->tx.tx_lock)->rlock){-.-...}, at: [] hif_usb_stop+0x24/0x53 [ath9k_htc] [ 169.366872] [ 169.366872] the dependencies between HARDIRQ-irq-safe lock and the holding lock: [ 169.366872] -> (&(&hif_dev->tx.tx_lock)->rlock){-.-...} ops: 239529 { [ 169.366872] IN-HARDIRQ-W at: [ 169.366872] [] __lock_acquire+0x2c6/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_spin_lock+0x40/0x73 [ 169.366872] [] hif_usb_tx_cb+0x5e/0x154 [ath9k_htc] [ 169.366872] [] usb_hcd_giveback_urb+0x91/0xc5 [usbcore] [ 169.366872] [] ehci_urb_done+0x7a/0x8b [ehci_hcd] [ 169.366872] [] qh_completions+0x2ee/0x376 [ehci_hcd] [ 169.366872] [] ehci_work+0x95/0x76e [ehci_hcd] [ 169.366872] [] ehci_irq+0x1a6/0x1d4 [ehci_hcd] [ 169.366872] [] usb_hcd_irq+0x4a/0xa7 [usbcore] [ 169.366872] [] handle_IRQ_event+0x77/0x14f [ 169.366872] [] handle_fasteoi_irq+0x92/0xd2 [ 169.366872] [] handle_irq+0x88/0x91 [ 169.366872] [] do_IRQ+0x63/0xc9 [ 169.366872] [] ret_from_intr+0x0/0x16 [ 169.366872] [] cpuidle_idle_call+0xa7/0x115 [ 169.366872] [] cpu_idle+0x68/0xc4 [ 169.366872] [] rest_init+0x104/0x10b [ 169.366872] [] start_kernel+0x3f1/0x3fc [ 169.366872] [] x86_64_start_reservations+0xb3/0xb7 [ 169.366872] [] x86_64_start_kernel+0xf8/0x107 [ 169.366872] IN-SOFTIRQ-W at: [ 169.366872] [] __lock_acquire+0x2e7/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_spin_lock_irqsave+0x58/0x92 [ 169.366872] [] hif_usb_send+0x46/0x208 [ath9k_htc] [ 169.366872] [] htc_issue_send.clone.0+0x6c/0x7b [ath9k_htc] [ 169.366872] [] htc_send+0x18/0x1a [ath9k_htc] [ 169.366872] [] ath9k_htc_tx_start+0x1d9/0x1e4 [ath9k_htc] [ 169.366872] [] ath9k_htc_tx+0x85/0x105 [ath9k_htc] [ 169.366872] [] __ieee80211_tx+0xfa/0x16e [mac80211] [ 169.366872] [] ieee80211_tx+0xe5/0x206 [mac80211] [ 169.366872] [] ieee80211_xmit+0x176/0x18a [mac80211] [ 169.366872] [] ieee80211_subif_start_xmit+0x70d/0x72b [mac80211] [ 169.366872] [] dev_hard_start_xmit+0x228/0x2f9 [ 169.366872] [] sch_direct_xmit+0x6d/0x17e [ 169.366872] [] dev_queue_xmit+0x2d0/0x45d [ 169.366872] [] neigh_resolve_output+0x216/0x267 [ 169.366872] [] ip6_output2+0x358/0x39f [ipv6] [ 169.366872] [] ip6_output+0xbb4/0xbc6 [ipv6] [ 169.366872] [] mld_sendpack+0x248/0x363 [ipv6] [ 169.366872] [] mld_ifc_timer_expire+0x246/0x27f [ipv6] [ 169.366872] [] run_timer_softirq+0x246/0x31b [ 169.366872] [] __do_softirq+0x11c/0x1fd [ 169.366872] [] call_softirq+0x1c/0x30 [ 169.366872] [] do_softirq+0x4b/0xa3 [ 169.366872] [] irq_exit+0x4a/0x99 [ 169.366872] [] smp_apic_timer_interrupt+0x84/0x92 [ 169.366872] [] apic_timer_interrupt+0x13/0x20 [ 169.366872] [] print_context_stack+0xa8/0xc4 [ 169.366872] [] dump_trace+0x2fa/0x32d [ 169.366872] [] save_stack_trace+0x2f/0x4c [ 169.366872] [] create_object+0x1a4/0x2a8 [ 169.366872] [] kmemleak_alloc+0x26/0x43 [ 169.366872] [] kmem_cache_alloc+0xff/0x16b [ 169.366872] [] skb_clone+0x47/0x61 [ 169.366872] [] netlink_broadcast+0xfc/0x279 [ 169.366872] [] nlmsg_notify+0x48/0x8e [ 169.366872] [] rtnl_notify+0x30/0x32 [ 169.366872] [] wireless_nlevent_process+0x35/0x70 [ 169.366872] [] worker_thread+0x28b/0x38a [ 169.366872] [] kthread+0x7f/0x87 [ 169.366872] [] kernel_thread_helper+0x4/0x10 [ 169.366872] INITIAL USE at: [ 169.366872] [] __lock_acquire+0x3b1/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_spin_lock_irqsave+0x58/0x92 [ 169.366872] [] hif_usb_start+0x25/0x3b [ath9k_htc] [ 169.366872] [] htc_start+0x49/0x5d [ath9k_htc] [ 169.366872] [] ath9k_htc_start+0x1c2/0x1fc [ath9k_htc] [ 169.366872] [] ieee80211_open+0x287/0x68e [mac80211] [ 169.366872] [] __dev_open+0x8e/0xbc [ 169.366872] [] __dev_change_flags+0xad/0x130 [ 169.366872] [] dev_change_flags+0x21/0x56 [ 169.366872] [] devinet_ioctl+0x270/0x504 [ 169.366872] [] inet_ioctl+0x8f/0xa7 [ 169.366872] [] sock_do_ioctl+0x29/0x48 [ 169.366872] [] sock_ioctl+0x213/0x222 [ 169.366872] [] vfs_ioctl+0x32/0xa6 [ 169.366872] [] do_vfs_ioctl+0x490/0x4d6 [ 169.366872] [] sys_ioctl+0x47/0x6a [ 169.366872] [] system_call_fastpath+0x16/0x1b [ 169.366872] } [ 169.366872] ... key at: [] __key.44613+0x0/0xffffffffffffdca3 [ath9k_htc] [ 169.366872] ... acquired at: [ 169.366872] [] check_irq_usage+0x5d/0xbe [ 169.366872] [] __lock_acquire+0xa40/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_read_lock+0x43/0x78 [ 169.366872] [] sock_def_write_space+0x1e/0x89 [ 169.366872] [] sock_wfree+0x42/0x60 [ 169.366872] [] skb_release_head_state+0x7a/0x87 [ 169.366872] [] __kfree_skb+0x16/0x81 [ 169.366872] [] kfree_skb+0x7e/0x86 [ 169.366872] [] __skb_queue_purge+0x43/0x49 [ath9k_htc] [ 169.366872] [] hif_usb_stop+0x31/0x53 [ath9k_htc] [ 169.366872] [] htc_stop+0x49/0x5d [ath9k_htc] [ 169.366872] [] ath9k_htc_config+0x121/0x496 [ath9k_htc] [ 169.366872] [] ieee80211_hw_config+0xf3/0x148 [mac80211] [ 169.366872] [] ieee80211_set_disassoc+0x15f/0x18a [mac80211] [ 169.366872] [] ieee80211_mgd_deauth+0x5d/0x18f [mac80211] [ 169.366872] [] ieee80211_deauth+0x1e/0x20 [mac80211] [ 169.366872] [] __cfg80211_mlme_deauth+0x140/0x14f [cfg80211] [ 169.366872] [] __cfg80211_disconnect+0x11b/0x193 [cfg80211] [ 169.366872] [] cfg80211_netdev_notifier_call+0x2ce/0x46d [cfg80211] [ 169.366872] [] notifier_call_chain+0x37/0x63 [ 169.366872] [] raw_notifier_call_chain+0x14/0x16 [ 169.366872] [] call_netdevice_notifiers+0x1b/0x1d [ 169.366872] [] __dev_close+0x5c/0x8b [ 169.366872] [] dev_close+0x1f/0x45 [ 169.366872] [] rollback_registered_many+0x90/0x1a6 [ 169.366872] [] unregister_netdevice_many+0x19/0x56 [ 169.366872] [] ieee80211_remove_interfaces+0xa6/0xb5 [mac80211] [ 169.366872] [] ieee80211_unregister_hw+0x47/0xe8 [mac80211] [ 169.366872] [] ath9k_htc_disconnect_device+0x3b/0x73 [ath9k_htc] [ 169.366872] [] ath9k_htc_hw_deinit+0x17/0x19 [ath9k_htc] [ 169.366872] [] ath9k_hif_usb_disconnect+0x3b/0xaa [ath9k_htc] [ 169.366872] [] usb_unbind_interface+0x71/0x13a [usbcore] [ 169.366872] [] __device_release_driver+0x7b/0xd1 [ 169.366872] [] device_release_driver+0x1e/0x2a [ 169.366872] [] bus_remove_device+0xc9/0xde [ 169.366872] [] device_del+0x137/0x185 [ 169.366872] [] usb_disable_device+0x85/0xfc [usbcore] [ 169.366872] [] usb_disconnect+0x9b/0x129 [usbcore] [ 169.366872] [] hub_thread+0x50a/0xf63 [usbcore] [ 169.366872] [] kthread+0x7f/0x87 [ 169.366872] [] kernel_thread_helper+0x4/0x10 [ 169.366872] [ 169.366872] [ 169.366872] the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock: [ 169.366872] -> (clock-AF_INET){++.?..} ops: 1525890 { [ 169.366872] HARDIRQ-ON-W at: [ 169.366872] [] __lock_acquire+0x33a/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_write_lock_bh+0x45/0x7a [ 169.366872] [] tcp_close+0x165/0x34d [ 169.366872] [] inet_release+0x55/0x5c [ 169.366872] [] sock_release+0x1f/0x6e [ 169.366872] [] sock_close+0x27/0x2b [ 169.366872] [] __fput+0x125/0x1ca [ 169.366872] [] fput+0x1a/0x1c [ 169.366872] [] filp_close+0x68/0x72 [ 169.366872] [] sys_close+0xad/0xe7 [ 169.366872] [] system_call_fastpath+0x16/0x1b [ 169.366872] HARDIRQ-ON-R at: [ 169.366872] [] __lock_acquire+0x312/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_read_lock+0x43/0x78 [ 169.366872] [] sock_def_write_space+0x1e/0x89 [ 169.366872] [] sock_wfree+0x42/0x60 [ 169.366872] [] loopback_xmit+0x26/0x8c [ 169.366872] [] dev_hard_start_xmit+0x228/0x2f9 [ 169.366872] [] dev_queue_xmit+0x387/0x45d [ 169.366872] [] neigh_resolve_output+0x216/0x267 [ 169.366872] [] ip_finish_output2+0x25c/0x291 [ 169.366872] [] ip_finish_output+0x61/0x63 [ 169.366872] [] ip_output+0x9f/0xa8 [ 169.366872] [] dst_output+0x10/0x12 [ 169.366872] [] ip_local_out+0x61/0x63 [ 169.366872] [] ip_push_pending_frames+0x2b2/0x313 [ 169.366872] [] udp_push_pending_frames+0x2de/0x35e [ 169.366872] [] udp_sendmsg+0x4fb/0x5f2 [ 169.366872] [] inet_sendmsg+0x54/0x5d [ 169.366872] [] sock_sendmsg+0xc0/0xd9 [ 169.366872] [] sys_sendto+0xe0/0x105 [ 169.366872] [] system_call_fastpath+0x16/0x1b [ 169.366872] IN-SOFTIRQ-R at: [ 169.366872] [] __lock_acquire+0x2e7/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_read_lock+0x43/0x78 [ 169.366872] [] sock_def_readable+0x1e/0x67 [ 169.366872] [] sock_queue_rcv_skb+0x141/0x163 [ 169.366872] [] __udp_queue_rcv_skb+0x17/0x85 [ 169.366872] [] udp_queue_rcv_skb+0x14c/0x204 [ 169.366872] [] __udp4_lib_rcv+0x2c1/0x481 [ 169.366872] [] udp_rcv+0x1a/0x1c [ 169.366872] [] ip_local_deliver+0x106/0x17c [ 169.366872] [] ip_rcv+0x4e5/0x525 [ 169.366872] [] netif_receive_skb+0x341/0x36e [ 169.366872] [] process_backlog+0xa1/0xe1 [ 169.366872] [] net_rx_action+0xc8/0x21c [ 169.366872] [] __do_softirq+0x11c/0x1fd [ 169.366872] [] call_softirq+0x1c/0x30 [ 169.366872] [] _local_bh_enable_ip+0xb8/0xf0 [ 169.366872] [] local_bh_enable+0x12/0x14 [ 169.366872] [] rcu_read_unlock_bh+0x26/0x28 [ 169.366872] [] dev_queue_xmit+0x429/0x45d [ 169.366872] [] neigh_resolve_output+0x216/0x267 [ 169.366872] [] ip_finish_output2+0x25c/0x291 [ 169.366872] [] ip_finish_output+0x61/0x63 [ 169.366872] [] ip_output+0x9f/0xa8 [ 169.366872] [] dst_output+0x10/0x12 [ 169.366872] [] ip_local_out+0x61/0x63 [ 169.366872] [] ip_push_pending_frames+0x2b2/0x313 [ 169.366872] [] udp_push_pending_frames+0x2de/0x35e [ 169.366872] [] udp_sendmsg+0x4fb/0x5f2 [ 169.366872] [] inet_sendmsg+0x54/0x5d [ 169.366872] [] sock_sendmsg+0xc0/0xd9 [ 169.366872] [] sys_sendto+0xe0/0x105 [ 169.366872] [] system_call_fastpath+0x16/0x1b [ 169.366872] SOFTIRQ-ON-R at: [ 169.366872] [] __lock_acquire+0x35b/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_read_lock+0x43/0x78 [ 169.366872] [] sock_def_write_space+0x1e/0x89 [ 169.366872] [] sock_setsockopt+0x26d/0x5e7 [ 169.366872] [] sys_setsockopt+0x66/0x96 [ 169.366872] [] system_call_fastpath+0x16/0x1b [ 169.366872] INITIAL USE at: [ 169.366872] [] __lock_acquire+0x3b1/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_write_lock_bh+0x45/0x7a [ 169.366872] [] tcp_close+0x165/0x34d [ 169.366872] [] inet_release+0x55/0x5c [ 169.366872] [] sock_release+0x1f/0x6e [ 169.366872] [] sock_close+0x27/0x2b [ 169.366872] [] __fput+0x125/0x1ca [ 169.366872] [] fput+0x1a/0x1c [ 169.366872] [] filp_close+0x68/0x72 [ 169.366872] [] sys_close+0xad/0xe7 [ 169.366872] [] system_call_fastpath+0x16/0x1b [ 169.366872] } [ 169.366872] ... key at: [] af_callback_keys+0x10/0x128 [ 169.366872] ... acquired at: [ 169.366872] [] check_irq_usage+0x5d/0xbe [ 169.366872] [] __lock_acquire+0xa40/0xd2b [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] _raw_read_lock+0x43/0x78 [ 169.366872] [] sock_def_write_space+0x1e/0x89 [ 169.366872] [] sock_wfree+0x42/0x60 [ 169.366872] [] skb_release_head_state+0x7a/0x87 [ 169.366872] [] __kfree_skb+0x16/0x81 [ 169.366872] [] kfree_skb+0x7e/0x86 [ 169.366872] [] __skb_queue_purge+0x43/0x49 [ath9k_htc] [ 169.366872] [] hif_usb_stop+0x31/0x53 [ath9k_htc] [ 169.366872] [] htc_stop+0x49/0x5d [ath9k_htc] [ 169.366872] [] ath9k_htc_config+0x121/0x496 [ath9k_htc] [ 169.366872] [] ieee80211_hw_config+0xf3/0x148 [mac80211] [ 169.366872] [] ieee80211_set_disassoc+0x15f/0x18a [mac80211] [ 169.366872] [] ieee80211_mgd_deauth+0x5d/0x18f [mac80211] [ 169.366872] [] ieee80211_deauth+0x1e/0x20 [mac80211] [ 169.366872] [] __cfg80211_mlme_deauth+0x140/0x14f [cfg80211] [ 169.366872] [] __cfg80211_disconnect+0x11b/0x193 [cfg80211] [ 169.366872] [] cfg80211_netdev_notifier_call+0x2ce/0x46d [cfg80211] [ 169.366872] [] notifier_call_chain+0x37/0x63 [ 169.366872] [] raw_notifier_call_chain+0x14/0x16 [ 169.366872] [] call_netdevice_notifiers+0x1b/0x1d [ 169.366872] [] __dev_close+0x5c/0x8b [ 169.366872] [] dev_close+0x1f/0x45 [ 169.366872] [] rollback_registered_many+0x90/0x1a6 [ 169.366872] [] unregister_netdevice_many+0x19/0x56 [ 169.366872] [] ieee80211_remove_interfaces+0xa6/0xb5 [mac80211] [ 169.366872] [] ieee80211_unregister_hw+0x47/0xe8 [mac80211] [ 169.366872] [] ath9k_htc_disconnect_device+0x3b/0x73 [ath9k_htc] [ 169.366872] [] ath9k_htc_hw_deinit+0x17/0x19 [ath9k_htc] [ 169.366872] [] ath9k_hif_usb_disconnect+0x3b/0xaa [ath9k_htc] [ 169.366872] [] usb_unbind_interface+0x71/0x13a [usbcore] [ 169.366872] [] __device_release_driver+0x7b/0xd1 [ 169.366872] [] device_release_driver+0x1e/0x2a [ 169.366872] [] bus_remove_device+0xc9/0xde [ 169.366872] [] device_del+0x137/0x185 [ 169.366872] [] usb_disable_device+0x85/0xfc [usbcore] [ 169.366872] [] usb_disconnect+0x9b/0x129 [usbcore] [ 169.366872] [] hub_thread+0x50a/0xf63 [usbcore] [ 169.366872] [] kthread+0x7f/0x87 [ 169.366872] [] kernel_thread_helper+0x4/0x10 [ 169.366872] [ 169.366872] [ 169.366872] stack backtrace: [ 169.366872] Pid: 78, comm: khubd Not tainted 2.6.34-rc3-wl #20 [ 169.366872] Call Trace: [ 169.366872] [] check_usage+0x350/0x364 [ 169.366872] [] ? sched_clock+0x9/0xd [ 169.366872] [] check_irq_usage+0x5d/0xbe [ 169.366872] [] __lock_acquire+0xa40/0xd2b [ 169.366872] [] ? __bfs+0x141/0x1d4 [ 169.366872] [] ? check_irq_usage+0xad/0xbe [ 169.366872] [] ? sock_def_write_space+0x1e/0x89 [ 169.366872] [] lock_acquire+0xec/0x119 [ 169.366872] [] ? sock_def_write_space+0x1e/0x89 [ 169.366872] [] ? __skb_queue_purge+0x43/0x49 [ath9k_htc] [ 169.366872] [] _raw_read_lock+0x43/0x78 [ 169.366872] [] ? sock_def_write_space+0x1e/0x89 [ 169.366872] [] sock_def_write_space+0x1e/0x89 [ 169.366872] [] sock_wfree+0x42/0x60 [ 169.366872] [] skb_release_head_state+0x7a/0x87 [ 169.366872] [] __kfree_skb+0x16/0x81 [ 169.366872] [] kfree_skb+0x7e/0x86 [ 169.366872] [] __skb_queue_purge+0x43/0x49 [ath9k_htc] [ 169.366872] [] hif_usb_stop+0x31/0x53 [ath9k_htc] [ 169.366872] [] htc_stop+0x49/0x5d [ath9k_htc] [ 169.366872] [] ath9k_htc_config+0x121/0x496 [ath9k_htc] [ 169.366872] [] ? __cancel_work_timer+0xe4/0x17e [ 169.366872] [] ? __cancel_work_timer+0x9e/0x17e [ 169.366872] [] ieee80211_hw_config+0xf3/0x148 [mac80211] [ 169.366872] [] ieee80211_set_disassoc+0x15f/0x18a [mac80211] [ 169.366872] [] ieee80211_mgd_deauth+0x5d/0x18f [mac80211] [ 169.366872] [] ? mark_held_locks+0x52/0x70 [ 169.366872] [] ieee80211_deauth+0x1e/0x20 [mac80211] [ 169.366872] [] __cfg80211_mlme_deauth+0x140/0x14f [cfg80211] [ 169.366872] [] ? __mutex_lock_common+0x447/0x49d [ 169.366872] [] ? cfg80211_netdev_notifier_call+0x28d/0x46d [cfg80211] [ 169.366872] [] __cfg80211_disconnect+0x11b/0x193 [cfg80211] [ 169.366872] [] cfg80211_netdev_notifier_call+0x2ce/0x46d [cfg80211] [ 169.366872] [] notifier_call_chain+0x37/0x63 [ 169.366872] [] raw_notifier_call_chain+0x14/0x16 [ 169.366872] [] call_netdevice_notifiers+0x1b/0x1d [ 169.366872] [] __dev_close+0x5c/0x8b [ 169.366872] [] dev_close+0x1f/0x45 [ 169.366872] [] rollback_registered_many+0x90/0x1a6 [ 169.366872] [] unregister_netdevice_many+0x19/0x56 [ 169.366872] [] ieee80211_remove_interfaces+0xa6/0xb5 [mac80211] [ 169.366872] [] ieee80211_unregister_hw+0x47/0xe8 [mac80211] [ 169.366872] [] ath9k_htc_disconnect_device+0x3b/0x73 [ath9k_htc] [ 169.366872] [] ath9k_htc_hw_deinit+0x17/0x19 [ath9k_htc] [ 169.366872] [] ath9k_hif_usb_disconnect+0x3b/0xaa [ath9k_htc] [ 169.366872] [] usb_unbind_interface+0x71/0x13a [usbcore] [ 169.366872] [] __device_release_driver+0x7b/0xd1 [ 169.366872] [] device_release_driver+0x1e/0x2a [ 169.366872] [] bus_remove_device+0xc9/0xde [ 169.366872] [] device_del+0x137/0x185 [ 169.366872] [] usb_disable_device+0x85/0xfc [usbcore] [ 169.366872] [] usb_disconnect+0x9b/0x129 [usbcore] [ 169.366872] [] hub_thread+0x50a/0xf63 [usbcore] [ 169.366872] [] ? trace_hardirqs_off+0xd/0xf [ 169.366872] [] ? schedule+0x5ee/0x649 [ 169.366872] [] ? trace_hardirqs_on_caller+0x125/0x150 [ 169.366872] [] ? autoremove_wake_function+0x0/0x39 [ 169.366872] [] ? hub_thread+0x0/0xf63 [usbcore] [ 169.366872] [] kthread+0x7f/0x87 [ 169.366872] [] kernel_thread_helper+0x4/0x10 [ 169.366872] [] ? restore_args+0x0/0x30 [ 169.366872] [] ? kthread+0x0/0x87 [ 169.366872] [] ? kernel_thread_helper+0x0/0x10 Signed-off-by: Ming Lei --- drivers/net/wireless/ath/ath9k/hif_usb.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index b9d42ff..aa1fb35 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -174,6 +174,12 @@ static void hif_usb_tx_cb(struct urb *urb) } } +static inline void ath9k_skb_queue_purge(struct sk_buff_head *list) +{ + struct sk_buff *skb; + while ((skb = __skb_dequeue(list)) != NULL) + dev_kfree_skb_any(skb); +} /* TX lock has to be taken */ static int __hif_usb_tx(struct hif_device_usb *hif_dev) { @@ -232,7 +238,7 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev) ret = usb_submit_urb(tx_buf->urb, GFP_ATOMIC); if (ret) { tx_buf->len = tx_buf->offset = 0; - __skb_queue_purge(&tx_buf->skb_queue); + ath9k_skb_queue_purge(&tx_buf->skb_queue); __skb_queue_head_init(&tx_buf->skb_queue); list_move_tail(&tx_buf->list, &hif_dev->tx.tx_buf); hif_dev->tx.tx_buf_cnt++; @@ -299,7 +305,7 @@ static void hif_usb_stop(void *hif_handle, u8 pipe_id) unsigned long flags; spin_lock_irqsave(&hif_dev->tx.tx_lock, flags); - __skb_queue_purge(&hif_dev->tx.tx_skb_queue); + ath9k_skb_queue_purge(&hif_dev->tx.tx_skb_queue); hif_dev->tx.tx_skb_cnt = 0; hif_dev->tx.flags |= HIF_USB_TX_STOP; spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags); -- 1.6.2.5