size_t size;
#ifdef CONFIG_FW_LOADER_USER_HELPER
bool is_paged_buf;
+ bool need_uevent;
struct page **pages;
int nr_pages;
int page_array_size;
}
if (uevent) {
+ buf->need_uevent = true;
dev_set_uevent_suppress(f_dev, false);
dev_dbg(f_dev, "firmware: requesting %s\n", buf->fw_id);
if (timeout != MAX_SCHEDULE_TIMEOUT)
spin_unlock(&fwc->name_lock);
}
+/* kill pending requests without uevent to avoid blocking suspend */
+static void kill_requests_without_uevent(void)
+{
+ struct firmware_buf *buf;
+ struct firmware_buf *next;
+
+ mutex_lock(&fw_lock);
+ list_for_each_entry_safe(buf, next, &pending_fw_head, pending_list) {
+ if (!buf->need_uevent)
+ fw_load_abort(buf);
+ }
+ mutex_unlock(&fw_lock);
+}
+
/**
* device_cache_fw_images - cache devices' firmware
*
switch (mode) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
+ kill_requests_without_uevent();
device_cache_fw_images();
break;