diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index a85307fe99..eec5c3fb61 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2906,6 +2906,19 @@ static inline bool hdd_roaming_supported(struct hdd_context *hdd_ctx) 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 static inline bool hdd_scan_random_mac_addr_supported(void) { diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 9cdf74a8a4..b9831df327 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -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); + /* 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) { status = wlan_hdd_set_mlo_ps(hdd_ctx->psoc, adapter, allow_power_save, timeout);