Skip to contentSkip to conversation

iwlwifi: fix dma mappings and skbs leak

PATCH In review Stanislaw Gruszka 2 participants 14 messages Feb 28, 2011 – Mar 3, 2011 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/5 iwlwifi: fix dma mappings and skbs leak

Since commit commit 470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 "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

---
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c |   12 +++++-
 drivers/net/wireless/iwlwifi/iwl-core.h   |    2 +
 drivers/net/wireless/iwlwifi/iwl-tx.c     |   71 +++++++++++++++++++----------
 3 files changed, 59 insertions(+), 26 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +11 -1
index 266490d..a709d05 100644
@@ -947,7 +947,7 @@ void iwlagn_txq_ctx_reset(struct iwl_priv *priv)
  */
 void iwlagn_txq_ctx_stop(struct iwl_priv *priv)
 {
-	int ch;
+	int ch, txq_id;
 	unsigned long flags;
 
 	/* Turn off all Tx DMA fifos */
@@ -966,6 +966,16 @@ void iwlagn_txq_ctx_stop(struct iwl_priv *priv)
 			    iwl_read_direct32(priv, FH_TSSR_TX_STATUS_REG));
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
+
+	if (!priv->txq)
+		return;
+
+	/* Unmap DMA from host system and free skb's */
+	for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++)
+		if (txq_id == priv->cmd_queue)
+			iwl_cmd_queue_unmap(priv);
+		else
+			iwl_tx_queue_unmap(priv, txq_id);
 }
 
 /*
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
index e0ec170..ed701f9 100644
@@ -509,6 +509,7 @@ void iwl_rx_reply_error(struct iwl_priv *priv,
 * RX
 ******************************************************/
 void iwl_cmd_queue_free(struct iwl_priv *priv);
+void iwl_cmd_queue_unmap(struct iwl_priv *priv);
 int iwl_rx_queue_alloc(struct iwl_priv *priv);
 void iwl_rx_queue_update_write_ptr(struct iwl_priv *priv,
 				  struct iwl_rx_queue *q);
@@ -533,6 +534,7 @@ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
 void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq,
 			int slots_num, u32 txq_id);
 void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id);
+void iwl_tx_queue_unmap(struct iwl_priv *priv, int txq_id);
 void iwl_setup_watchdog(struct iwl_priv *priv);
 /*****************************************************
  * TX power
drivers/net/wireless/iwlwifi/iwl-tx.c +46 -25

114 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

PATCH v3 2/5 iwlegacy: fix dma mappings and skbs leak

Fix possible dma mappings and skbs introduced by commit 470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 "iwlwifi: avoid Tx queue memory allocation in interface down".

---
 drivers/net/wireless/iwlegacy/iwl-4965-tx.c |   12 ++++-
 drivers/net/wireless/iwlegacy/iwl-core.h    |    2 +
 drivers/net/wireless/iwlegacy/iwl-tx.c      |   75 +++++++++++++++++---------
 3 files changed, 62 insertions(+), 27 deletions(-)
drivers/net/wireless/iwlegacy/iwl-4965-tx.c +11 -1
index 829db91..5c40502 100644
@@ -698,7 +698,7 @@ void iwl4965_txq_ctx_reset(struct iwl_priv *priv)
  */
 void iwl4965_txq_ctx_stop(struct iwl_priv *priv)
 {
-	int ch;
+	int ch, txq_id;
 	unsigned long flags;
 
 	/* Turn off all Tx DMA fifos */
@@ -719,6 +719,16 @@ void iwl4965_txq_ctx_stop(struct iwl_priv *priv)
 					FH_TSSR_TX_STATUS_REG));
 	}
 	spin_unlock_irqrestore(&priv->lock, flags);
+
+	if (!priv->txq)
+		return;
+
+	/* Unmap DMA from host system and free skb's */
+	for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++)
+		if (txq_id == priv->cmd_queue)
+			iwl_legacy_cmd_queue_unmap(priv);
+		else
+			iwl_legacy_tx_queue_unmap(priv, txq_id);
 }
 
 /*
drivers/net/wireless/iwlegacy/iwl-core.h +2 -0
index c6d12d7..f03b463 100644
@@ -388,6 +388,7 @@ void iwl_legacy_rx_reply_error(struct iwl_priv *priv,
 /*****************************************************
 * RX
 ******************************************************/
+void iwl_legacy_cmd_queue_unmap(struct iwl_priv *priv);
 void iwl_legacy_cmd_queue_free(struct iwl_priv *priv);
 int iwl_legacy_rx_queue_alloc(struct iwl_priv *priv);
 void iwl_legacy_rx_queue_update_write_ptr(struct iwl_priv *priv,
@@ -415,6 +416,7 @@ int iwl_legacy_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
 void iwl_legacy_tx_queue_reset(struct iwl_priv *priv,
 			struct iwl_tx_queue *txq,
 			int slots_num, u32 txq_id);
+void iwl_legacy_tx_queue_unmap(struct iwl_priv *priv, int txq_id);
 void iwl_legacy_tx_queue_free(struct iwl_priv *priv, int txq_id);
 void iwl_legacy_setup_watchdog(struct iwl_priv *priv);
 /*****************************************************
drivers/net/wireless/iwlegacy/iwl-tx.c +49 -26

117 lines not on this page · raw message

Signature · 1 line
1.7.1
#3 lore raw

PATCH v3 3/5 iwlwifi: add {ack,plpc}_check module parameters

In reply to Stanislaw Gruszka

Add module ack_check, and plcp_check parameters. Ack_check is disabled by default since is proved that check ack health can cause troubles. Plcp_check is enabled by default.

---
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |    1 +
 drivers/net/wireless/iwlwifi/iwl-agn.c     |    6 ++++++
 drivers/net/wireless/iwlwifi/iwl-core.h    |    2 ++
 drivers/net/wireless/iwlwifi/iwl-rx.c      |    8 ++++++--
 4 files changed, 15 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -0
index 0d0572c..693a1fa 100644
@@ -609,6 +609,7 @@ const u8 *iwlagn_eeprom_query_addr(const struct iwl_priv *priv,
 struct iwl_mod_params iwlagn_mod_params = {
 	.amsdu_size_8K = 1,
 	.restart_fw = 1,
+	.plcp_check = true,
 	/* the rest are 0 by default */
 };
 
drivers/net/wireless/iwlwifi/iwl-agn.c +6 -0
index 8cdbd8c..4792418 100644
@@ -4785,3 +4785,9 @@ MODULE_PARM_DESC(antenna_coupling,
 module_param_named(bt_ch_inhibition, iwlagn_bt_ch_announce, bool, S_IRUGO);
 MODULE_PARM_DESC(bt_ch_inhibition,
 		 "Disable BT channel inhibition (default: enable)");
+
+module_param_named(plcp_check, iwlagn_mod_params.plcp_check, bool, S_IRUGO);
+MODULE_PARM_DESC(plcp_check, "Check plcp health (default: 1 [enabled])");
+
+module_param_named(ack_check, iwlagn_mod_params.ack_check, bool, S_IRUGO);
+MODULE_PARM_DESC(ack_check, "Check ack health (default: 0 [disabled])");
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
index ed701f9..fac3a6c 100644
@@ -261,6 +261,8 @@ struct iwl_mod_params {
 	int amsdu_size_8K;	/* def: 1 = enable 8K amsdu size */
 	int antenna;  		/* def: 0 = both antennas (use diversity) */
 	int restart_fw;		/* def: 1 = restart firmware */
+	bool plcp_check;	/* def: true = enable plcp health check */
+	bool ack_check;		/* def: false = disable ack health check */
 };
 
 /*
drivers/net/wireless/iwlwifi/iwl-rx.c +6 -2
index a21f6fe..fd84d53 100644
@@ -230,18 +230,22 @@ void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv,
 void iwl_recover_from_statistics(struct iwl_priv *priv,
 				struct iwl_rx_packet *pkt)
 {
+	const struct iwl_mod_params *mod_params = priv->cfg->mod_params;
+
 	if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
 	    !iwl_is_any_associated(priv))
 		return;
 
-	if (priv->cfg->ops->lib->check_ack_health &&
+	if (mod_params->ack_check &&
+	    priv->cfg->ops->lib->check_ack_health &&
 	    !priv->cfg->ops->lib->check_ack_health(priv, pkt)) {
 		IWL_ERR(priv, "low ack count detected, restart firmware\n");
 		if (!iwl_force_reset(priv, IWL_FW_RESET, false))
 			return;
 	}
 
-	if (priv->cfg->ops->lib->check_plcp_health &&
+	if (mod_params->plcp_check &&
+	    priv->cfg->ops->lib->check_plcp_health &&
 	    !priv->cfg->ops->lib->check_plcp_health(priv, pkt))
 		iwl_force_reset(priv, IWL_RF_RESET, false);
 }
Signature · 1 line
1.7.1
#5 lore raw

PATCH v3 4/5 iwlwifi: move check health code into iwl-rx.c

In reply to Stanislaw Gruszka

Remove check_plcp_health and check_ack_health ops methods, they are unneeded after iwlegacy driver split. Merge check health code into to iwl-rx.c and make functions static.

---
 drivers/net/wireless/iwlwifi/iwl-1000.c   |    2 -
 drivers/net/wireless/iwlwifi/iwl-2000.c   |    2 -
 drivers/net/wireless/iwlwifi/iwl-5000.c   |    4 -
 drivers/net/wireless/iwlwifi/iwl-6000.c   |    4 -
 drivers/net/wireless/iwlwifi/iwl-agn-rx.c |   87 ---------------
 drivers/net/wireless/iwlwifi/iwl-agn.c    |   67 +------------
 drivers/net/wireless/iwlwifi/iwl-agn.h    |    4 -
 drivers/net/wireless/iwlwifi/iwl-core.h   |    7 +-
 drivers/net/wireless/iwlwifi/iwl-rx.c     |  162 +++++++++++++++++++++++++++--
 9 files changed, 156 insertions(+), 183 deletions(-)
drivers/net/wireless/iwlwifi/iwl-1000.c +0 -2
index ba78bc8..e8e1c2d 100644
@@ -232,8 +232,6 @@ static struct iwl_lib_ops iwl1000_lib = {
 		.bt_stats_read = iwl_ucode_bt_stats_read,
 		.reply_tx_error = iwl_reply_tx_error_read,
 	},
-	.check_plcp_health = iwl_good_plcp_health,
-	.check_ack_health = iwl_good_ack_health,
 	.txfifo_flush = iwlagn_txfifo_flush,
 	.dev_txfifo_flush = iwlagn_dev_txfifo_flush,
 	.tt_ops = {
drivers/net/wireless/iwlwifi/iwl-2000.c +0 -2
index 30483e2..894cb24 100644
@@ -315,8 +315,6 @@ static struct iwl_lib_ops iwl2000_lib = {
 		.bt_stats_read = iwl_ucode_bt_stats_read,
 		.reply_tx_error = iwl_reply_tx_error_read,
 	},
-	.check_plcp_health = iwl_good_plcp_health,
-	.check_ack_health = iwl_good_ack_health,
 	.txfifo_flush = iwlagn_txfifo_flush,
 	.dev_txfifo_flush = iwlagn_dev_txfifo_flush,
 	.tt_ops = {
drivers/net/wireless/iwlwifi/iwl-5000.c +0 -4
index 537fb8c..3ea31b6 100644
@@ -402,8 +402,6 @@ static struct iwl_lib_ops iwl5000_lib = {
 		.bt_stats_read = iwl_ucode_bt_stats_read,
 		.reply_tx_error = iwl_reply_tx_error_read,
 	},
-	.check_plcp_health = iwl_good_plcp_health,
-	.check_ack_health = iwl_good_ack_health,
 	.txfifo_flush = iwlagn_txfifo_flush,
 	.dev_txfifo_flush = iwlagn_dev_txfifo_flush,
 	.tt_ops = {
@@ -471,8 +469,6 @@ static struct iwl_lib_ops iwl5150_lib = {
 		.bt_stats_read = iwl_ucode_bt_stats_read,
 		.reply_tx_error = iwl_reply_tx_error_read,
 	},
-	.check_plcp_health = iwl_good_plcp_health,
-	.check_ack_health = iwl_good_ack_health,
 	.txfifo_flush = iwlagn_txfifo_flush,
 	.dev_txfifo_flush = iwlagn_dev_txfifo_flush,
 	.tt_ops = {
drivers/net/wireless/iwlwifi/iwl-6000.c +0 -4
index f6493f7..a745b01 100644
@@ -343,8 +343,6 @@ static struct iwl_lib_ops iwl6000_lib = {
 		.bt_stats_read = iwl_ucode_bt_stats_read,
 		.reply_tx_error = iwl_reply_tx_error_read,
 	},
-	.check_plcp_health = iwl_good_plcp_health,
-	.check_ack_health = iwl_good_ack_health,
 	.txfifo_flush = iwlagn_txfifo_flush,
 	.dev_txfifo_flush = iwlagn_dev_txfifo_flush,
 	.tt_ops = {
@@ -415,8 +413,6 @@ static struct iwl_lib_ops iwl6030_lib = {
 		.bt_stats_read = iwl_ucode_bt_stats_read,
 		.reply_tx_error = iwl_reply_tx_error_read,
 	},
-	.check_plcp_health = iwl_good_plcp_health,
-	.check_ack_health = iwl_good_ack_health,
 	.txfifo_flush = iwlagn_txfifo_flush,
 	.dev_txfifo_flush = iwlagn_dev_txfifo_flush,
 	.tt_ops = {
drivers/net/wireless/iwlwifi/iwl-agn-rx.c +0 -87

93 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-agn.c +1 -66

76 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-agn.h +0 -4
index 88c7210..b5a169b 100644
@@ -121,8 +121,6 @@ void iwl_disable_ict(struct iwl_priv *priv);
 int iwl_alloc_isr_ict(struct iwl_priv *priv);
 void iwl_free_isr_ict(struct iwl_priv *priv);
 irqreturn_t iwl_isr_ict(int irq, void *data);
-bool iwl_good_ack_health(struct iwl_priv *priv,
-			 struct iwl_rx_packet *pkt);
 
 /* tx queue */
 void iwlagn_set_wr_ptrs(struct iwl_priv *priv,
@@ -248,8 +246,6 @@ u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant_idx, u8 valid);
 /* rx */
 void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
 				struct iwl_rx_mem_buffer *rxb);
-bool iwl_good_plcp_health(struct iwl_priv *priv,
-			  struct iwl_rx_packet *pkt);
 void iwl_rx_statistics(struct iwl_priv *priv,
 		       struct iwl_rx_mem_buffer *rxb);
 void iwl_reply_statistics(struct iwl_priv *priv,
drivers/net/wireless/iwlwifi/iwl-core.h +1 -6
index fac3a6c..22dc435 100644
@@ -210,12 +210,7 @@ struct iwl_lib_ops {
 
 	/* temperature */
 	struct iwl_temp_ops temp_ops;
-	/* check for plcp health */
-	bool (*check_plcp_health)(struct iwl_priv *priv,
-					struct iwl_rx_packet *pkt);
-	/* check for ack health */
-	bool (*check_ack_health)(struct iwl_priv *priv,
-					struct iwl_rx_packet *pkt);
+
 	int (*txfifo_flush)(struct iwl_priv *priv, u16 flush_control);
 	void (*dev_txfifo_flush)(struct iwl_priv *priv, u16 flush_control);
 
drivers/net/wireless/iwlwifi/iwl-rx.c +154 -8

179 lines not on this page · raw message

Signature · 1 line
1.7.1
#7 lore raw

PATCH v3 5/5 iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.c

In reply to Stanislaw Gruszka

There is no need to have separate iwl-agn-rx.c file after iwlegacy split.

---
 drivers/net/wireless/iwlwifi/Makefile     |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-rx.c |  264 -----------------------------
 drivers/net/wireless/iwlwifi/iwl-core.h   |    2 -
 drivers/net/wireless/iwlwifi/iwl-rx.c     |  226 ++++++++++++++++++++++++-
 4 files changed, 225 insertions(+), 269 deletions(-)
 delete mode 100644 drivers/net/wireless/iwlwifi/iwl-agn-rx.c
drivers/net/wireless/iwlwifi/Makefile +1 -1
index aab7d15..9d6ee83 100644
@@ -2,7 +2,7 @@
 obj-$(CONFIG_IWLAGN)	+= iwlagn.o
 iwlagn-objs		:= iwl-agn.o iwl-agn-rs.o iwl-agn-led.o
 iwlagn-objs		+= iwl-agn-ucode.o iwl-agn-tx.o
-iwlagn-objs		+= iwl-agn-lib.o iwl-agn-rx.o iwl-agn-calib.o
+iwlagn-objs		+= iwl-agn-lib.o iwl-agn-calib.o
 iwlagn-objs		+= iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o
 
 iwlagn-objs 		+= iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o
drivers/net/wireless/iwlwifi/iwl-agn-rx.c deleted +0 -264

264 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-core.h +0 -2
index 22dc435..c025769 100644
@@ -515,8 +515,6 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb);
 /* Handlers */
 void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv,
 					  struct iwl_rx_mem_buffer *rxb);
-void iwl_recover_from_statistics(struct iwl_priv *priv,
-				struct iwl_rx_packet *pkt);
 void iwl_chswitch_done(struct iwl_priv *priv, bool is_success);
 void iwl_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb);
 
drivers/net/wireless/iwlwifi/iwl-rx.c +224 -2

250 lines not on this page · raw message

Signature · 1 line
1.7.1
Acked-by on v3 1/5
#13 lore raw
In reply to Stanislaw Gruszka
Quoted 37 lines · Stanislaw Gruszka

Since commit commit 470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 "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.

Quoted 4 lines

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

#9 lore raw

Re: [PATCH v3 5/5] iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.c

In reply to Stanislaw Gruszka

Hi Stanislaw,

Quoted 12 lines · Stanislaw Gruszka

There is no need to have separate iwl-agn-rx.c file after iwlegacy split.

---
 drivers/net/wireless/iwlwifi/Makefile     |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-rx.c |  264 -----------------------------
 drivers/net/wireless/iwlwifi/iwl-core.h   |    2 -
 drivers/net/wireless/iwlwifi/iwl-rx.c     |  226 ++++++++++++++++++++++++-
 4 files changed, 225 insertions(+), 269 deletions(-)
 delete mode 100644 drivers/net/wireless/iwlwifi/iwl-agn-rx.c

I got the following warning:

drivers/net/wireless/iwlwifi/iwl-rx.c:506:6: warning: symbol 'iwl_rx_statistics' was not declared. Should it be static? drivers/net/wireless/iwlwifi/iwl-rx.c:575:6: warning: symbol 'iwl_reply_statistics' was not declared. Should it be static? drivers/net/wireless/iwlwifi/iwl-rx.c:600:6: warning: symbol 'iwl_rx_missed_beacon_notif' was not declared. Should it be static?

when I compile with sparse

Thanks
Wey

#10 lore raw

Re: [PATCH v3 5/5] iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.c

Hello

Quoted 8 lines · Wey-Yi

I got the following warning:

drivers/net/wireless/iwlwifi/iwl-rx.c:506:6: warning: symbol 'iwl_rx_statistics' was not declared. Should it be static? drivers/net/wireless/iwlwifi/iwl-rx.c:575:6: warning: symbol 'iwl_reply_statistics' was not declared. Should it be static? drivers/net/wireless/iwlwifi/iwl-rx.c:600:6: warning: symbol 'iwl_rx_missed_beacon_notif' was not declared. Should it be static?

include "iwl-agh.h" should make warning go away, but perhaps would be better to move all rx_handlers to iwl-rx.c, make them statics and export only iwl_setup_rx_handlers ?

Stanislaw

#11 lore raw

Re: [PATCH v3 5/5] iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.c

Hi Stanislaw,

Quoted 12 lines · Stanislaw Gruszka

Hello

Quoted 8 lines · Wey-Yi

I got the following warning:

drivers/net/wireless/iwlwifi/iwl-rx.c:506:6: warning: symbol 'iwl_rx_statistics' was not declared. Should it be static? drivers/net/wireless/iwlwifi/iwl-rx.c:575:6: warning: symbol 'iwl_reply_statistics' was not declared. Should it be static? drivers/net/wireless/iwlwifi/iwl-rx.c:600:6: warning: symbol 'iwl_rx_missed_beacon_notif' was not declared. Should it be static?

Quoted 4 lines

include "iwl-agh.h" should make warning go away, but perhaps would be better to move all rx_handlers to iwl-rx.c, make them statics and export only iwl_setup_rx_handlers ?

I like the 2nd approach and make it "static", could you like to do it, or I can make the changes.

Thanks
Wey

#12 lore raw

Re: [PATCH v3 5/5] iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.c

Quoted 2 lines · Wey-Yi

I like the 2nd approach and make it "static", could you like to do it, or I can make the changes.

I'll do it tomorrow.

Stanislaw