qcacld-3.0: Avoid duplicated thermal level change event

At present, duplicated thermal level change events are reported
on different mac with different pdev id from target. To report
the lowest pdev id's thermal level to avoid confusing the user.

Change-Id: Ia1f497ba1a1e0af946b87924de80b9fd39fe95e8
CRs-Fixed: 2976437
This commit is contained in:
Liangwei Dong
2021-06-24 11:32:11 +08:00
committed by Madan Koyyalamudi
parent 62a7eb9d30
commit 11611472b1
3 changed files with 17 additions and 7 deletions

View File

@@ -280,9 +280,11 @@ struct wlan_fwol_cfg {
/**
* struct wlan_fwol_thermal_throttle_info - FW offload thermal throttle info
* @level: thermal throttle level
* @pdev_id: pdev id
*/
struct wlan_fwol_thermal_throttle_info {
enum thermal_throttle_level level;
uint32_t pdev_id;
};
/**

View File

@@ -543,6 +543,7 @@ static void ucfg_fwol_fetch_ra_filter(struct wlan_objmgr_psoc *psoc,
static void fwol_thermal_init(struct wlan_fwol_psoc_obj *fwol_obj)
{
fwol_obj->thermal_throttle.level = THERMAL_FULLPERF;
fwol_obj->thermal_throttle.pdev_id = WLAN_INVALID_PDEV_ID;
}
#else
static void fwol_thermal_init(struct wlan_fwol_psoc_obj *fwol_obj)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -196,12 +196,19 @@ notify_thermal_throttle_handler(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_INVAL;
}
thermal_cbs = &fwol_obj->thermal_cbs;
fwol_nofl_debug("thermal evt: pdev %d lvl %d", info->pdev_id,
info->level);
if (info->pdev_id <= fwol_obj->thermal_throttle.pdev_id ||
fwol_obj->thermal_throttle.pdev_id == WLAN_INVALID_PDEV_ID) {
fwol_obj->thermal_throttle.level = info->level;
fwol_obj->thermal_throttle.pdev_id = info->pdev_id;
if (thermal_cbs->notify_thermal_throttle_handler)
status = thermal_cbs->notify_thermal_throttle_handler(psoc,
status =
thermal_cbs->notify_thermal_throttle_handler(psoc,
info);
else
fwol_debug("no thermal throttle handler");
}
return status;
}