mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 18:40:10 +00:00
media: amphion: release core lock before reset vpu core
[ Upstream commita621cc4bed] In reset vpu core, driver will wait for a response event, but if there are still some events unhandled, they will be handled first, driver may acquire core lock for that. So if we do reset in core lock, it may led to reset timeout. Fixes:9f599f351e("media: amphion: add vpu core driver") Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4b8d0fa094
commit
70b148acab
@@ -455,8 +455,13 @@ int vpu_inst_unregister(struct vpu_inst *inst)
|
||||
}
|
||||
vpu_core_check_hang(core);
|
||||
if (core->state == VPU_CORE_HANG && !core->instance_mask) {
|
||||
int err;
|
||||
|
||||
dev_info(core->dev, "reset hang core\n");
|
||||
if (!vpu_core_sw_reset(core)) {
|
||||
mutex_unlock(&core->lock);
|
||||
err = vpu_core_sw_reset(core);
|
||||
mutex_lock(&core->lock);
|
||||
if (!err) {
|
||||
core->state = VPU_CORE_ACTIVE;
|
||||
core->hang_mask = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user