ath10k: merge some pending stability fixes
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 936-ath10k_skip_otp_check.patch
1 --- a/drivers/net/wireless/ath/ath10k/core.c
2 +++ b/drivers/net/wireless/ath/ath10k/core.c
3 @@ -1168,9 +1168,6 @@ static int ath10k_core_fetch_firmware_fi
4 {
5 int ret;
6
7 - /* calibration file is optional, don't check for any errors */
8 - ath10k_fetch_cal_file(ar);
9 -
10 ar->fw_api = 5;
11 ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
12
13 @@ -1873,6 +1870,9 @@ static int ath10k_core_probe_fw(struct a
14 goto err_power_down;
15 }
16
17 + /* calibration file is optional, don't check for any errors */
18 + int calret = ath10k_fetch_cal_file(ar);
19 +
20 ret = ath10k_core_fetch_firmware_files(ar);
21 if (ret) {
22 ath10k_err(ar, "could not fetch firmware files (%d)\n", ret);
23 @@ -1895,11 +1895,14 @@ static int ath10k_core_probe_fw(struct a
24 "could not load pre cal data: %d\n", ret);
25 }
26
27 - ret = ath10k_core_get_board_id_from_otp(ar);
28 - if (ret && ret != -EOPNOTSUPP) {
29 - ath10k_err(ar, "failed to get board id from otp: %d\n",
30 - ret);
31 - goto err_free_firmware_files;
32 + /* otp and board file not needed if calibration data is present */
33 + if (calret) {
34 + ret = ath10k_core_get_board_id_from_otp(ar);
35 + if (ret && ret != -EOPNOTSUPP) {
36 + ath10k_err(ar, "failed to get board id from otp: %d\n",
37 + ret);
38 + return ret;
39 + }
40 }
41
42 ret = ath10k_core_fetch_board_file(ar);