summaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/936-ath10k_skip_otp_check.patch
blob: 596ef9863902ecbbd3cdb394c7ffde3ba509414f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1243,9 +1243,6 @@ static int ath10k_core_fetch_firmware_fi
 {
 	int ret;
 
-	/* calibration file is optional, don't check for any errors */
-	ath10k_fetch_cal_file(ar);
-
 	ar->fw_api = 5;
 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
 
@@ -1944,7 +1941,7 @@ EXPORT_SYMBOL(ath10k_core_stop);
 static int ath10k_core_probe_fw(struct ath10k *ar)
 {
 	struct bmi_target_info target_info;
-	int ret = 0;
+	int calret, ret = 0;
 
 	ret = ath10k_hif_power_up(ar);
 	if (ret) {
@@ -1968,6 +1965,9 @@ static int ath10k_core_probe_fw(struct a
 		goto err_power_down;
 	}
 
+	/* calibration file is optional, don't check for any errors */
+	calret = ath10k_fetch_cal_file(ar);
+
 	ret = ath10k_core_fetch_firmware_files(ar);
 	if (ret) {
 		ath10k_err(ar, "could not fetch firmware files (%d)\n", ret);
@@ -1990,11 +1990,14 @@ static int ath10k_core_probe_fw(struct a
 			   "could not load pre cal data: %d\n", ret);
 	}
 
-	ret = ath10k_core_get_board_id_from_otp(ar);
-	if (ret && ret != -EOPNOTSUPP) {
-		ath10k_err(ar, "failed to get board id from otp: %d\n",
-			   ret);
-		goto err_free_firmware_files;
+	/* otp and board file not needed if calibration data is present */
+	if (calret) {
+		ret = ath10k_core_get_board_id_from_otp(ar);
+		if (ret && ret != -EOPNOTSUPP) {
+			ath10k_err(ar, "failed to get board id from otp: %d\n",
+				ret);
+			goto err_free_firmware_files;
+		}
 	}
 
 	ret = ath10k_core_fetch_board_file(ar);