ath10k: silence firmware file probing warnings
authorMichal Kazior <michal.kazior@tieto.com>
Mon, 13 Feb 2017 10:38:42 +0000 (12:38 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 14 Feb 2017 17:52:35 +0000 (19:52 +0200)
Firmware files are versioned to prevent older
driver instances to load unsupported firmware
blobs. This is reflected with a fallback logic
which attempts to load several firmware files.

This however produced a lot of unnecessary
warnings sometimes confusing users and leading
them to rename firmware files making things even
more confusing.

Hence use request_firmware_direct() which does not
produce extra warnings. This shouldn't really
break anything because most modern systems don't
rely on udev/hotplug helpers to load firmware
files anymore. For example it was confirmed that
LEDE does not user helper.

This also fixes a 60 second delay per _each_
unexistent firmware/calibration file with distros
which have CONFIG_FW_LOADER_USER_HELPER_FALLBACK
enabled, RHEL being a notable example. Using
ath10k with firmware-2.bin this might end up
into a five minute delay in boot.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
[kvalo@qca.qualcomm.com: add more info to the commit log]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/testmode.c

index 51d9183..873b134 100644 (file)
@@ -456,7 +456,10 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar,
                dir = ".";
 
        snprintf(filename, sizeof(filename), "%s/%s", dir, file);
-       ret = request_firmware(&fw, filename, ar->dev);
+       ret = request_firmware_direct(&fw, filename, ar->dev);
+       ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
+                  filename, ret);
+
        if (ret)
                return ERR_PTR(ret);
 
@@ -1190,12 +1193,8 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
        /* first fetch the firmware file (firmware-*.bin) */
        fw_file->firmware = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
                                                 name);
-       if (IS_ERR(fw_file->firmware)) {
-               ath10k_err(ar, "could not fetch firmware file '%s/%s': %ld\n",
-                          ar->hw_params.fw.dir, name,
-                          PTR_ERR(fw_file->firmware));
+       if (IS_ERR(fw_file->firmware))
                return PTR_ERR(fw_file->firmware);
-       }
 
        data = fw_file->firmware->data;
        len = fw_file->firmware->size;
index ed85f93..8bb36c1 100644 (file)
@@ -150,7 +150,10 @@ static int ath10k_tm_fetch_utf_firmware_api_1(struct ath10k *ar,
                 ar->hw_params.fw.dir, ATH10K_FW_UTF_FILE);
 
        /* load utf firmware image */
-       ret = request_firmware(&fw_file->firmware, filename, ar->dev);
+       ret = request_firmware_direct(&fw_file->firmware, filename, ar->dev);
+       ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode fw request '%s': %d\n",
+                  filename, ret);
+
        if (ret) {
                ath10k_warn(ar, "failed to retrieve utf firmware '%s': %d\n",
                            filename, ret);