From 72f45df5ff33041e48cc737e597de3459a024cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bremv=C3=A5g?= Date: Sun, 10 Nov 2019 14:49:56 +0100 Subject: [PATCH] Fix a few sleep-in-atomic-context bugs in rtw_pwrctrl --- core/rtw_pwrctrl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index fa66c2a..08ce9cf 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -540,7 +540,7 @@ u8 rtw_cpwm_polling(_adapter *adapter, u8 rpwm, u8 cpwm_orig) do { start_time = rtw_get_current_time(); do { - rtw_msleep_os(1); + rtw_mdelay_os(1); rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now); if ((cpwm_orig ^ cpwm_now) & 0x80) { @@ -1460,7 +1460,7 @@ void LPS_Leave_check( RTW_ERR("Wait for cpwm event than 100 ms!!!\n"); break; } - rtw_msleep_os(1); + rtw_mdelay_os(1); } } @@ -2513,7 +2513,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) if (pwrpriv->ps_processing) { RTW_INFO("%s wait ps_processing...\n", __func__); while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000) - rtw_msleep_os(10); + rtw_mdelay_os(10); if (pwrpriv->ps_processing) RTW_INFO("%s wait ps_processing timeout\n", __func__); else @@ -2524,7 +2524,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) if (rtw_hal_sreset_inprogress(padapter)) { RTW_INFO("%s wait sreset_inprogress...\n", __func__); while (rtw_hal_sreset_inprogress(padapter) && rtw_get_passing_time_ms(start) <= 4000) - rtw_msleep_os(10); + rtw_mdelay_os(10); if (rtw_hal_sreset_inprogress(padapter)) RTW_INFO("%s wait sreset_inprogress timeout\n", __func__); else @@ -2542,7 +2542,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) && ((rtw_get_passing_time_ms(start) <= 3000 && !rtw_is_do_late_resume(pwrpriv)) || (rtw_get_passing_time_ms(start) <= 500 && rtw_is_do_late_resume(pwrpriv))) ) - rtw_msleep_os(10); + rtw_mdelay_os(10); if (pwrpriv->bInSuspend) RTW_INFO("%s wait bInSuspend timeout\n", __func__); else