rtw88: power on again if it was already on

We could fail to power on because it was already on. If the return
value is -EALREADY, power off and then power on again to turn on the
hardware as expected.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Yan-Hsuan Chuang 2019-06-14 15:24:12 +08:00 committed by Kalle Valo
parent e1cc056c92
commit d41673b941
1 changed files with 7 additions and 1 deletions

View File

@ -285,8 +285,14 @@ int rtw_mac_power_on(struct rtw_dev *rtwdev)
goto err;
ret = rtw_mac_power_switch(rtwdev, true);
if (ret)
if (ret == -EALREADY) {
rtw_mac_power_switch(rtwdev, false);
ret = rtw_mac_power_switch(rtwdev, true);
if (ret)
goto err;
} else if (ret) {
goto err;
}
ret = rtw_mac_init_system_cfg(rtwdev);
if (ret)