mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-21 11:22:50 +00:00
97 lines
2.9 KiB
Diff
97 lines
2.9 KiB
Diff
From f5ffe76bb9fd0785210928f4d181742da95e0939 Mon Sep 17 00:00:00 2001
|
|
From: Aishwarya R <quic_aisr@quicinc.com>
|
|
Date: Fri, 1 Apr 2022 17:16:28 +0530
|
|
Subject: [PATCH] ath12k: Fixed issue in reading pdev temperature value for
|
|
thermal throttling feature
|
|
|
|
As wmi_pdev_temperature_event passed to function is
|
|
not pass by reference, value not changed.
|
|
fixed the issue by removing the function and declared
|
|
wmi_pdev_temperature_event as pointer
|
|
|
|
Signed-off-by: Aishwarya R <quic_aisr@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath12k/wmi.c | 54 ++++++++++++++++++++----------------------------------
|
|
1 file changed, 20 insertions(+), 34 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
|
@@ -5887,31 +5887,6 @@ int ath12k_wmi_pull_fw_stats(struct ath1
|
|
return 0;
|
|
}
|
|
|
|
-static int
|
|
-ath12k_pull_pdev_temp_ev(struct ath12k_base *ab, u8 *evt_buf,
|
|
- u32 len, const struct wmi_pdev_temperature_event *ev)
|
|
-{
|
|
- const void **tb;
|
|
- int ret;
|
|
-
|
|
- tb = ath12k_wmi_tlv_parse_alloc(ab, evt_buf, len, GFP_ATOMIC);
|
|
- if (IS_ERR(tb)) {
|
|
- ret = PTR_ERR(tb);
|
|
- ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
|
|
- return ret;
|
|
- }
|
|
-
|
|
- ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT];
|
|
- if (!ev) {
|
|
- ath12k_warn(ab, "failed to fetch pdev temp ev");
|
|
- kfree(tb);
|
|
- return -EPROTO;
|
|
- }
|
|
-
|
|
- kfree(tb);
|
|
- return 0;
|
|
-}
|
|
-
|
|
size_t ath12k_wmi_fw_stats_num_vdevs(struct list_head *head)
|
|
{
|
|
struct ath12k_fw_stats_vdev *i;
|
|
@@ -7368,23 +7343,36 @@ ath12k_wmi_pdev_temperature_event(struct
|
|
struct sk_buff *skb)
|
|
{
|
|
struct ath12k *ar;
|
|
- struct wmi_pdev_temperature_event ev = {0};
|
|
+ const void **tb;
|
|
+ int ret;
|
|
+ struct wmi_pdev_temperature_event *ev;
|
|
|
|
- if (ath12k_pull_pdev_temp_ev(ab, skb->data, skb->len, &ev) != 0) {
|
|
- ath12k_warn(ab, "failed to extract pdev temperature event");
|
|
- return;
|
|
- }
|
|
+ tb = ath12k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC);
|
|
+ if (IS_ERR(tb)) {
|
|
+ ret = PTR_ERR(tb);
|
|
+ ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT];
|
|
+ if (!ev) {
|
|
+ ath12k_warn(ab, "failed to fetch pdev temp ev");
|
|
+ kfree(tb);
|
|
+ return;
|
|
+ }
|
|
|
|
ath12k_dbg(ab, ATH12K_DBG_WMI,
|
|
- "pdev temperature ev temp %d pdev_id %d\n", ev.temp, ev.pdev_id);
|
|
+ "pdev temperature ev temp %d pdev_id %d\n", ev->temp,
|
|
+ ev->pdev_id);
|
|
|
|
- ar = ath12k_mac_get_ar_by_pdev_id(ab, ev.pdev_id);
|
|
+ ar = ath12k_mac_get_ar_by_pdev_id(ab, ev->pdev_id);
|
|
if (!ar) {
|
|
- ath12k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id);
|
|
+ ath12k_warn(ab, "invalid pdev id in pdev temperature ev %d",
|
|
+ ev->pdev_id);
|
|
return;
|
|
}
|
|
|
|
- ath12k_thermal_event_temperature(ar, ev.temp);
|
|
+ ath12k_thermal_event_temperature(ar, ev->temp);
|
|
}
|
|
|
|
static void ath12k_fils_discovery_event(struct ath12k_base *ab,
|