@@ -936,7 +936,7 @@ static void rproc_fw_config_virtio(const struct firmware *fw, void *context)
out:
release_firmware(fw);
/* allow rproc_del() contexts, if any, to proceed */
- complete_all(&rproc->firmware_loading_complete);
+ fw_loading_done(rproc->fw_st);
}
static int rproc_add_virtio_devices(struct rproc *rproc)
@@ -944,7 +944,7 @@ static int rproc_add_virtio_devices(struct rproc *rproc)
int ret;
/* rproc_del() calls must wait until async loader completes */
- init_completion(&rproc->firmware_loading_complete);
+ firmware_stat_init(&rproc->fw_st);
/*
* We must retrieve early virtio configuration info from
@@ -959,7 +959,7 @@ static int rproc_add_virtio_devices(struct rproc *rproc)
rproc, rproc_fw_config_virtio);
if (ret < 0) {
dev_err(&rproc->dev, "request_firmware_nowait err: %d\n", ret);
- complete_all(&rproc->firmware_loading_complete);
+ fw_loading_abort(rproc->fw_st);
}
return ret;
@@ -1089,7 +1089,7 @@ static int __rproc_boot(struct rproc *rproc, bool wait)
/* if rproc virtio is not yet configured, wait */
if (wait)
- wait_for_completion(&rproc->firmware_loading_complete);
+ fw_loading_wait(rproc->fw_st);
ret = rproc_fw_boot(rproc, firmware_p);
@@ -1447,7 +1447,7 @@ int rproc_del(struct rproc *rproc)
return -EINVAL;
/* if rproc is just being registered, wait */
- wait_for_completion(&rproc->firmware_loading_complete);
+ fw_loading_wait(rproc->fw_st);
/* clean up remote vdev entries */
list_for_each_entry_safe(rvdev, tmp, &rproc->rvdevs, node)
@@ -370,7 +370,7 @@ static void wkup_m3_rproc_boot_thread(struct wkup_m3_ipc *m3_ipc)
struct device *dev = m3_ipc->dev;
int ret;
- wait_for_completion(&m3_ipc->rproc->firmware_loading_complete);
+ fw_loading_wait(m3_ipc->rproc->fw_st);
init_completion(&m3_ipc->sync_complete);
@@ -41,6 +41,7 @@
#include <linux/completion.h>
#include <linux/idr.h>
#include <linux/of.h>
+#include <linux/firmware.h>
/**
* struct resource_table - firmware resource table header
@@ -397,7 +398,7 @@ enum rproc_crash_type {
* @num_traces: number of trace buffers
* @carveouts: list of physically contiguous memory allocations
* @mappings: list of iommu mappings we initiated, needed on shutdown
- * @firmware_loading_complete: marks e/o asynchronous firmware loading
+ * @fw_sync: marks e/o asynchronous firmware loading
* @bootaddr: address of first instruction to boot rproc with (optional)
* @rvdevs: list of remote virtio devices
* @notifyids: idr for dynamically assigning rproc-wide unique notify ids
@@ -429,7 +430,7 @@ struct rproc {
int num_traces;
struct list_head carveouts;
struct list_head mappings;
- struct completion firmware_loading_complete;
+ struct firmware_stat fw_st;
u32 bootaddr;
struct list_head rvdevs;
struct idr notifyids;
@@ -479,6 +480,7 @@ struct rproc_vring {
* @vring: the vrings for this vdev
* @rsc_offset: offset of the vdev's resource entry
*/
+
struct rproc_vdev {
struct list_head node;
struct rproc *rproc;