Browse Source

qcacld-3.0: Fix bandwidth vote level for device in monitor mode

Bandwidth level was set correctly to PLD_BUS_WIDTH_VERY_HIGH
but current vote level was not updated for monitor mode.
Due to this during PCI link down the reg writes for SW2WBM
release ring were enqueued in delayed register write work
queue instead of being written directly.

Delay in scheduling the workqueue results in SW2WBM release
ring getting full which results in invoking panic.
Hence update the current vote level along with the bus
bandwidth in HDD open function for monitor mode.

Change-Id: Ib9861a038afa6ca7758ea35afcae2bcfe9e69b60
CRs-Fixed: 2690247
Nisha Menon 4 years ago
parent
commit
761251b822
2 changed files with 28 additions and 1 deletions
  1. 24 0
      core/hdd/inc/wlan_hdd_main.h
  2. 4 1
      core/hdd/src/wlan_hdd_main.c

+ 24 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -2617,6 +2617,24 @@ hdd_get_current_throughput_level(struct hdd_context *hdd_ctx)
 	return hdd_ctx->cur_vote_level;
 }
 
+/**
+ * hdd_set_current_throughput_level() - update the current vote
+ * level
+ * @hdd_ctx: the global hdd context
+ * @next_vote_level: pld_bus_width_type voting level
+ *
+ * This function updates the current vote level to the new level
+ * provided
+ *
+ * Return: None
+ */
+static inline void
+hdd_set_current_throughput_level(struct hdd_context *hdd_ctx,
+				 enum pld_bus_width_type next_vote_level)
+{
+	hdd_ctx->cur_vote_level = next_vote_level;
+}
+
 static inline bool
 hdd_is_low_tput_gro_enable(struct hdd_context *hdd_ctx)
 {
@@ -2674,6 +2692,12 @@ hdd_get_current_throughput_level(struct hdd_context *hdd_ctx)
 	return PLD_BUS_WIDTH_NONE;
 }
 
+static inline void
+hdd_set_current_throughput_level(struct hdd_context *hdd_ctx,
+				 enum pld_bus_width_type next_vote_level)
+{
+}
+
 static inline bool
 hdd_is_low_tput_gro_enable(struct hdd_context *hdd_ctx)
 {

+ 4 - 1
core/hdd/src/wlan_hdd_main.c

@@ -2591,9 +2591,12 @@ static int __hdd_mon_open(struct net_device *dev)
 	if (!ret)
 		ret = hdd_enable_monitor_mode(dev);
 
-	if (!ret)
+	if (!ret) {
+		hdd_set_current_throughput_level(hdd_ctx,
+						 PLD_BUS_WIDTH_VERY_HIGH);
 		pld_request_bus_bandwidth(hdd_ctx->parent_dev,
 					  PLD_BUS_WIDTH_VERY_HIGH);
+	}
 
 	return ret;
 }