mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
video: rockchip: vcodec: fix reboot crash when playing
shutdown function need wait last irq finish and then continue its work. Change-Id: I12bed04f6eeac1f12eedf55a09699be49fb4ac35 Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/iopoll.h>
|
||||
|
||||
#include <linux/rockchip/cru.h>
|
||||
#include <linux/rockchip/pmu.h>
|
||||
@@ -2636,6 +2637,8 @@ static void vcodec_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct vpu_subdev_data *data = platform_get_drvdata(pdev);
|
||||
struct vpu_service_info *pservice = data->pservice;
|
||||
int val;
|
||||
int ret;
|
||||
|
||||
dev_info(&pdev->dev, "vcodec shutdown");
|
||||
|
||||
@@ -2643,6 +2646,12 @@ static void vcodec_shutdown(struct platform_device *pdev)
|
||||
atomic_set(&pservice->service_on, 0);
|
||||
mutex_unlock(&pservice->shutdown_lock);
|
||||
|
||||
ret = readx_poll_timeout(atomic_read,
|
||||
&pservice->total_running,
|
||||
val, val == 0, 20000, 200000);
|
||||
if (ret == -ETIMEDOUT)
|
||||
dev_err(&pdev->dev, "wait total running time out\n");
|
||||
|
||||
vcodec_exit_mode(data);
|
||||
|
||||
vpu_service_power_on(data, pservice);
|
||||
|
||||
Reference in New Issue
Block a user