|
@@ -112,6 +112,7 @@ static inline long firmware_loading_timeout(void)
|
|
#define FW_OPT_FALLBACK 0
|
|
#define FW_OPT_FALLBACK 0
|
|
#endif
|
|
#endif
|
|
#define FW_OPT_NO_WARN (1U << 3)
|
|
#define FW_OPT_NO_WARN (1U << 3)
|
|
|
|
+#define FW_OPT_NOCACHE (1U << 4)
|
|
|
|
|
|
struct firmware_cache {
|
|
struct firmware_cache {
|
|
/* firmware_buf instance will be added into the below list */
|
|
/* firmware_buf instance will be added into the below list */
|
|
@@ -1065,14 +1066,16 @@ static int assign_firmware_buf(struct firmware *fw, struct device *device,
|
|
* should be fixed in devres or driver core.
|
|
* should be fixed in devres or driver core.
|
|
*/
|
|
*/
|
|
/* don't cache firmware handled without uevent */
|
|
/* don't cache firmware handled without uevent */
|
|
- if (device && (opt_flags & FW_OPT_UEVENT))
|
|
|
|
|
|
+ if (device && (opt_flags & FW_OPT_UEVENT) &&
|
|
|
|
+ !(opt_flags & FW_OPT_NOCACHE))
|
|
fw_add_devm_name(device, buf->fw_id);
|
|
fw_add_devm_name(device, buf->fw_id);
|
|
|
|
|
|
/*
|
|
/*
|
|
* After caching firmware image is started, let it piggyback
|
|
* After caching firmware image is started, let it piggyback
|
|
* on request firmware.
|
|
* on request firmware.
|
|
*/
|
|
*/
|
|
- if (buf->fwc->state == FW_LOADER_START_CACHE) {
|
|
|
|
|
|
+ if (!(opt_flags & FW_OPT_NOCACHE) &&
|
|
|
|
+ buf->fwc->state == FW_LOADER_START_CACHE) {
|
|
if (fw_cache_piggyback_on_request(buf->fw_id))
|
|
if (fw_cache_piggyback_on_request(buf->fw_id))
|
|
kref_get(&buf->ref);
|
|
kref_get(&buf->ref);
|
|
}
|
|
}
|