936-ath10k_skip_otp_check.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- a/drivers/net/wireless/ath/ath10k/core.c
  2. +++ b/drivers/net/wireless/ath/ath10k/core.c
  3. @@ -1362,9 +1362,6 @@ static int ath10k_core_fetch_firmware_fi
  4. {
  5. int ret;
  6. - /* calibration file is optional, don't check for any errors */
  7. - ath10k_fetch_cal_file(ar);
  8. -
  9. ar->fw_api = 5;
  10. ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
  11. @@ -2149,7 +2146,7 @@ EXPORT_SYMBOL(ath10k_core_stop);
  12. static int ath10k_core_probe_fw(struct ath10k *ar)
  13. {
  14. struct bmi_target_info target_info;
  15. - int ret = 0;
  16. + int calret, ret = 0;
  17. ret = ath10k_hif_power_up(ar);
  18. if (ret) {
  19. @@ -2173,6 +2170,9 @@ static int ath10k_core_probe_fw(struct a
  20. goto err_power_down;
  21. }
  22. + /* calibration file is optional, don't check for any errors */
  23. + calret = ath10k_fetch_cal_file(ar);
  24. +
  25. ret = ath10k_core_fetch_firmware_files(ar);
  26. if (ret) {
  27. ath10k_err(ar, "could not fetch firmware files (%d)\n", ret);
  28. @@ -2195,11 +2195,14 @@ static int ath10k_core_probe_fw(struct a
  29. "could not load pre cal data: %d\n", ret);
  30. }
  31. - ret = ath10k_core_get_board_id_from_otp(ar);
  32. - if (ret && ret != -EOPNOTSUPP) {
  33. - ath10k_err(ar, "failed to get board id from otp: %d\n",
  34. - ret);
  35. - goto err_free_firmware_files;
  36. + /* otp and board file not needed if calibration data is present */
  37. + if (calret) {
  38. + ret = ath10k_core_get_board_id_from_otp(ar);
  39. + if (ret && ret != -EOPNOTSUPP) {
  40. + ath10k_err(ar, "failed to get board id from otp: %d\n",
  41. + ret);
  42. + goto err_free_firmware_files;
  43. + }
  44. }
  45. ret = ath10k_core_check_smbios(ar);