Commit f4268729 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtw88: fix error handling when setup efuse info

Disable efuse if the efuse is enabled when we failed to setup the efuse
information, otherwise the hardware will not turn off.

Fixes: e3037485 ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4f5bb7ff
......@@ -1105,19 +1105,19 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev)
/* power on mac to read efuse */
ret = rtw_chip_efuse_enable(rtwdev);
if (ret)
goto out;
goto out_unlock;
ret = rtw_parse_efuse_map(rtwdev);
if (ret)
goto out;
goto out_disable;
ret = rtw_dump_hw_feature(rtwdev);
if (ret)
goto out;
goto out_disable;
ret = rtw_check_supported_rfe(rtwdev);
if (ret)
goto out;
goto out_disable;
if (efuse->crystal_cap == 0xff)
efuse->crystal_cap = 0;
......@@ -1144,9 +1144,10 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev)
efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0;
efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0;
out_disable:
rtw_chip_efuse_disable(rtwdev);
out:
out_unlock:
mutex_unlock(&rtwdev->mutex);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment