diff mbox series

[1/6] iwlwifi: Decrease firmware monitor debug area from 4MB to 512k.

Message ID 20201231000523.14963-1-greearb@candelatech.com (mailing list archive)
State New
Delegated to: Miri Korenblit
Headers show
Series [1/6] iwlwifi: Decrease firmware monitor debug area from 4MB to 512k. | expand

Commit Message

Ben Greear Dec. 31, 2020, 12:05 a.m. UTC
From: Ben Greear <greearb@candelatech.com>

It appears the code can handle down to 2^11, so set max in
this case to 2^19 to save mem.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 2fffbbc8462f..18ddaa2c73fc 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -223,8 +223,8 @@  static void iwl_pcie_alloc_fw_monitor_block(struct iwl_trans *trans,
 			continue;
 
 		IWL_INFO(trans,
-			 "Allocated 0x%08x bytes for firmware monitor.\n",
-			 size);
+			 "Allocated 0x%08x bytes for firmware monitor, max_power: %d  min_power: %d  power: %d.\n",
+			 size, max_power, min_power, power);
 		break;
 	}
 
@@ -244,6 +244,8 @@  static void iwl_pcie_alloc_fw_monitor_block(struct iwl_trans *trans,
 
 void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans, u8 max_power)
 {
+	pr_err("iwl_pcie_alloc_fw_monitor, monitor size max_power requested: %d\n",
+	       max_power);
 	if (!max_power) {
 		/* default max_power is maximum */
 		max_power = 26;
@@ -256,6 +258,13 @@  void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans, u8 max_power)
 		 max_power))
 		return;
 
+	/* Try to use less memory, there are other things in the system as well! */
+	if (max_power > 19) {
+		pr_err("iwl_pcie_alloc_fw_monitor, decreasing max-power from %d to 19 to save memory.\n",
+		       max_power);
+		max_power = 19;
+	}
+
 	if (trans->dbg.fw_mon.size)
 		return;