qcacld-3.0: Flush inet notifier work before set ps

User can modify power save value which will be sent to FW.
IPv4/IPv6 notifier work will also checks this user configured
power save to send set ps request to FW, a possibility of
race condition exists when both user request and inet notifier
work are running at the same time.

Flush the inet notifier work to ensure the set PS calls are
serialized.

Change-Id: Ib7def61c961835682a6f72d6fb4bd97bd7ffff0f
CRs-Fixed: 3310057
Šī revīzija ir iekļauta:
Vinod Kumar Pirla
2022-10-12 05:09:16 -07:00
revīziju iesūtīja Madan Koyyalamudi
vecāks c078010ada
revīzija 0799f11b12
2 mainīti faili ar 20 papildinājumiem un 0 dzēšanām

Parādīt failu

@@ -2906,6 +2906,19 @@ static inline bool hdd_roaming_supported(struct hdd_context *hdd_ctx)
return val; return val;
} }
#ifdef WLAN_NS_OFFLOAD
static inline void
hdd_adapter_flush_ipv6_notifier_work(struct hdd_adapter *adapter)
{
flush_work(&adapter->ipv6_notifier_work);
}
#else
static inline void
hdd_adapter_flush_ipv6_notifier_work(struct hdd_adapter *adapter)
{
}
#endif
#ifdef CFG80211_SCAN_RANDOM_MAC_ADDR #ifdef CFG80211_SCAN_RANDOM_MAC_ADDR
static inline bool hdd_scan_random_mac_addr_supported(void) static inline bool hdd_scan_random_mac_addr_supported(void)
{ {

Parādīt failu

@@ -2959,6 +2959,13 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_POWER_ID); hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_POWER_ID);
/* Flush any scheduled inet change notifier work
* This is to make sure set power save request
* sent to FW are serialized to avoid race condition
*/
flush_work(&adapter->ipv4_notifier_work);
hdd_adapter_flush_ipv6_notifier_work(adapter);
if (is_mlo_vdev) { if (is_mlo_vdev) {
status = wlan_hdd_set_mlo_ps(hdd_ctx->psoc, adapter, status = wlan_hdd_set_mlo_ps(hdd_ctx->psoc, adapter,
allow_power_save, timeout); allow_power_save, timeout);