diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 7347fd99d9d0..aa4b67a6b639 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1523,6 +1523,18 @@ static void wlan_hdd_pld_remove(struct device *dev, enum pld_bus_type bus_type) hdd_exit(); } +static void hdd_soc_idle_shutdown_lock(struct device *dev) +{ + hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_IDLE_SHUTDOWN); + + hdd_abort_system_suspend(dev); +} + +static void hdd_soc_idle_shutdown_unlock(void) +{ + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_IDLE_SHUTDOWN); +} + /** * wlan_hdd_pld_idle_shutdown() - wifi module idle shutdown after interface * inactivity timeout has trigerred idle shutdown @@ -1534,7 +1546,15 @@ static void wlan_hdd_pld_remove(struct device *dev, enum pld_bus_type bus_type) static int wlan_hdd_pld_idle_shutdown(struct device *dev, enum pld_bus_type bus_type) { - return hdd_psoc_idle_shutdown(dev); + int ret; + + hdd_soc_idle_shutdown_lock(dev); + + ret = hdd_psoc_idle_shutdown(dev); + + hdd_soc_idle_shutdown_unlock(); + + return ret; } /**