mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-08 00:29:36 -04:00
wifi: rtw89: Lower the timeout in rtw89_fwdl_check_path_ready_ax() for USB
When the chip is not powered on correctly (like during driver development) rtw89_fwdl_check_path_ready_ax() can fail. read_poll_timeout_atomic() with a delay of 1 µs and a timeout of 400000 µs can take 50 seconds with USB because of the time it takes to send a USB control message. The firmware upload is tried 5 times, so in total it takes 250 seconds. Lower the timeout to 3200 for USB in order to reduce the time rtw89_fwdl_check_path_ready_ax() takes from 50 seconds to less than 1 second. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/af0b25d0-ea67-455e-91f2-8e4c18ae4328@gmail.com
This commit is contained in:
committed by
Ping-Ke Shih
parent
671be46afd
commit
12322a0260
@@ -4699,6 +4699,7 @@ struct rtw89_c2h_rf_tas_info {
|
||||
#define RTW89_FW_BACKTRACE_KEY 0xBACEBACE
|
||||
|
||||
#define FWDL_WAIT_CNT 400000
|
||||
#define FWDL_WAIT_CNT_USB 3200
|
||||
|
||||
int rtw89_fw_check_rdy(struct rtw89_dev *rtwdev, enum rtw89_fwdl_check_type type);
|
||||
int rtw89_fw_recognize(struct rtw89_dev *rtwdev);
|
||||
|
||||
@@ -6940,10 +6940,16 @@ int rtw89_fwdl_check_path_ready_ax(struct rtw89_dev *rtwdev,
|
||||
bool h2c_or_fwdl)
|
||||
{
|
||||
u8 check = h2c_or_fwdl ? B_AX_H2C_PATH_RDY : B_AX_FWDL_PATH_RDY;
|
||||
u32 timeout;
|
||||
u8 val;
|
||||
|
||||
if (rtwdev->hci.type == RTW89_HCI_TYPE_USB)
|
||||
timeout = FWDL_WAIT_CNT_USB;
|
||||
else
|
||||
timeout = FWDL_WAIT_CNT;
|
||||
|
||||
return read_poll_timeout_atomic(rtw89_read8, val, val & check,
|
||||
1, FWDL_WAIT_CNT, false,
|
||||
1, timeout, false,
|
||||
rtwdev, R_AX_WCPU_FW_CTRL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user