linux/drivers/net/wireless/iwlwifi
Stanislaw Gruszka 387f3381f7 iwlwifi: fix dma mappings and skbs leak
Since commit commit 470058e0ad
"iwlwifi: avoid Tx queue memory allocation in interface down" we do
not unmap dma and free skbs when down device and there is pending
transfer. What in consequence may cause that system hung (waiting
for free skb's) when performing shutdown at iptables module unload.

DMA leak manifest itself following warning:

WARNING: at lib/dma-debug.c:689 dma_debug_device_change+0x15a/0x1b0()
Hardware name: HP xw8600 Workstation
pci 0000:80:00.0: DMA-API: device driver has pending DMA allocations while released from device [count=240]
Modules linked in: iwlagn(-) aes_x86_64 aes_generic fuse cpufreq_ondemand acpi_cpufreq freq_table mperf xt_physdev ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 ext3 jbd dm_mirror dm_region_hash dm_log dm_mod uinput hp_wmi sparse_keymap sg wmi microcode serio_raw tg3 arc4 ecb shpchp mac80211 cfg80211 rfkill ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif firewire_ohci firewire_core crc_itu_t mptsas mptscsih mptbase scsi_transport_sas pata_acpi ata_generic ata_piix ahci libahci floppy nouveau ttm drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: iwlagn]
Pid: 9131, comm: rmmod Tainted: G        W   2.6.38-rc6-wl+ #33
Call Trace:
 [<ffffffff810649ef>] ? warn_slowpath_common+0x7f/0xc0
 [<ffffffff81064ae6>] ? warn_slowpath_fmt+0x46/0x50
 [<ffffffff812320ab>] ? dma_debug_device_change+0xdb/0x1b0
 [<ffffffff8123212a>] ? dma_debug_device_change+0x15a/0x1b0
 [<ffffffff8149dc18>] ? notifier_call_chain+0x58/0xb0
 [<ffffffff8108e370>] ? __blocking_notifier_call_chain+0x60/0x90
 [<ffffffff8108e3b6>] ? blocking_notifier_call_chain+0x16/0x20
 [<ffffffff812f570c>] ? __device_release_driver+0xbc/0xe0
 [<ffffffff812f5808>] ? driver_detach+0xd8/0xe0
 [<ffffffff812f45d1>] ? bus_remove_driver+0x91/0x100
 [<ffffffff812f6022>] ? driver_unregister+0x62/0xa0
 [<ffffffff8123d5d4>] ? pci_unregister_driver+0x44/0xa0
 [<ffffffffa05632d1>] ? iwl_exit+0x15/0x1c [iwlagn]
 [<ffffffff810ab492>] ? sys_delete_module+0x1a2/0x270
 [<ffffffff81498da9>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff8100bf42>] ? system_call_fastpath+0x16/0x1b

I still can observe above warning after apply patch, but it is very
hard to reproduce it, and have count=1. Whereas that one is easy to
reproduce using debugfs force_reset while transmitting data, and have
very big counts eg. 240, like quoted here. So count=1 WARNING seems
to be different issue that need to be resolved separately.

v1 -> v2: fix infinity loop bug I made during "for" to "while" loop transition.
v2 -> v3: remove unneeded EXPORT_SYMBOL

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-28 14:06:56 -05:00
..
iwl-1000.c iwlwifi: always support idle mode for agn devices 2011-01-31 13:19:02 -08:00
iwl-2000.c iwlagn: enable BT session 2 type UART for 2000 series 2011-02-26 10:29:02 -08:00
iwl-5000-hw.h
iwl-5000.c iwlagn: code clean up to remove duplicate code 2010-12-13 15:53:54 -08:00
iwl-6000-hw.h
iwl-6000.c Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-02-18 17:03:41 -05:00
iwl-agn-calib.c iwlwifi: introduce iwl_bt_statistics 2011-01-28 15:46:25 -05:00
iwl-agn-calib.h
iwl-agn-debugfs.c iwlwifi: introduce iwl_bt_statistics 2011-01-28 15:46:25 -05:00
iwl-agn-debugfs.h
iwl-agn-eeprom.c iwlwifi: don't read sku information from EEPROM for 4965 2011-01-21 15:05:57 -05:00
iwl-agn-hcmd.c iwlwifi: replace minimum slot time constant 2011-01-21 15:51:08 -08:00
iwl-agn-hw.h
iwl-agn-ict.c wireless: comment typo fix diable -> disable. 2011-01-03 16:05:53 +01:00
iwl-agn-led.c iwlwifi: use mac80211 throughput trigger 2011-01-21 15:26:39 -08:00
iwl-agn-led.h iwlwifi: use mac80211 throughput trigger 2011-01-21 15:26:39 -08:00
iwl-agn-lib.c iwlagn: enable BT session 2 type UART for 2000 series 2011-02-26 10:29:02 -08:00
iwl-agn-rs.c iwlwifi: use maximum aggregation size 2011-01-31 13:19:32 -08:00
iwl-agn-rs.h iwl3945: do not use agn specific IWL_RATE_COUNT 2011-01-31 15:06:21 -05:00
iwl-agn-rx.c iwlwifi: introduce iwl_bt_statistics 2011-01-28 15:46:25 -05:00
iwl-agn-rxon.c iwlagn: fix iwlagn_check_needed_chains 2011-02-25 15:33:39 -05:00
iwl-agn-sta.c
iwl-agn-tt.c
iwl-agn-tt.h
iwl-agn-tx.c iwlwifi: fix dma mappings and skbs leak 2011-02-28 14:06:56 -05:00
iwl-agn-ucode.c iwlwifi: check ucode loading error and restart 2011-01-31 13:17:28 -08:00
iwl-agn.c mac80211: make tx() operation return void 2011-02-25 15:32:34 -05:00
iwl-agn.h mac80211: make tx() operation return void 2011-02-25 15:32:34 -05:00
iwl-commands.h iwlagn: enable BT session 2 type UART for 2000 series 2011-02-26 10:29:02 -08:00
iwl-core.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-core.h iwlwifi: fix dma mappings and skbs leak 2011-02-28 14:06:56 -05:00
iwl-csr.h iwlagn: add IQ inversion support for 2000 series devices 2011-01-31 13:17:53 -08:00
iwl-debug.h iwlwifi: add new EEPROM debug log type 2010-12-13 15:52:39 -08:00
iwl-debugfs.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-dev.h iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-devtrace.c
iwl-devtrace.h
iwl-eeprom.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-eeprom.h iwlagn: add 2000 series EEPROM version 2011-01-21 15:28:55 -08:00
iwl-fh.h
iwl-hcmd.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-helpers.h Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-01-05 14:35:41 -05:00
iwl-io.h
iwl-led.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-led.h iwlwifi: use mac80211 throughput trigger 2011-01-21 15:26:39 -08:00
iwl-power.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-power.h
iwl-prph.h iwlwifi: do not reload fw if WiMAX own the RF 2010-12-13 15:53:24 -08:00
iwl-rx.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-scan.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-spectrum.h
iwl-sta.c iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
iwl-sta.h
iwl-tx.c iwlwifi: fix dma mappings and skbs leak 2011-02-28 14:06:56 -05:00
Kconfig iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00
Makefile iwlwifi: split the drivers for agn and legacy devices 3945/4965 2011-02-21 11:27:26 -08:00