Skip to contentSkip to conversation

media: amphion: support for reloading module

PATCH New Ming Qian 1 participant 1 message May 17, 2022

Subsystems (2)
lore
Share & tools
lore

Ming Qian

author maintainer
#0 lore raw

PATCH 1/1 media: amphion: support for reloading module

As there is no interface to power off vpu core. So it need to boot from cold on first load.
but on the second load, driver need to restore the status instead of booting.

---
 drivers/media/platform/amphion/vpu_core.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/media/platform/amphion/vpu_core.c +4 -7
index 68ad183925fd..3cca7ae2355d 100644
@@ -257,14 +257,8 @@ static int vpu_core_register(struct device *dev, struct vpu_core *core)
 	}
 
 	list_add_tail(&core->list, &vpu->cores);
-
 	vpu_core_get_vpu(core);
 
-	if (vpu_iface_get_power_state(core))
-		ret = vpu_core_restore(core);
-	if (ret)
-		goto error;
-
 	return 0;
 error:
 	if (core->msg_buffer) {
@@ -362,7 +356,10 @@ struct vpu_core *vpu_request_core(struct vpu_dev *vpu, enum vpu_core_type type)
 	pm_runtime_resume_and_get(core->dev);
 
 	if (core->state == VPU_CORE_DEINIT) {
-		ret = vpu_core_boot(core, true);
+		if (vpu_iface_get_power_state(core))
+			ret = vpu_core_restore(core);
+		else
+			ret = vpu_core_boot(core, true);
 		if (ret) {
 			pm_runtime_put_sync(core->dev);
 			mutex_unlock(&core->lock);
Signature · 1 line
2.36.1