diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-04-27 10:39:47 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-05-10 11:36:33 +0200 |
commit | 4cba5473c5ce0f1389d316c5dc6f83a0259df5eb (patch) | |
tree | bc01e1b58037b7413ab173049857c5d8264c6c74 /drivers/media/cec | |
parent | staging: media: rkvdec: fix pm_runtime_get_sync() usage count (diff) | |
download | linux-4cba5473c5ce0f1389d316c5dc6f83a0259df5eb.tar.xz linux-4cba5473c5ce0f1389d316c5dc6f83a0259df5eb.zip |
media: venus: Rework error fail recover logic
The Venus code has a sort of watchdog that attempts to recover
from IP errors, implemented as a delayed work job, which
calls venus_sys_error_handler().
Right now, it has several issues:
1. It assumes that PM runtime resume never fails
2. It internally runs two while() loops that also assume that
PM runtime will never fail to go idle:
while (pm_runtime_active(core->dev_dec) || pm_runtime_active(core->dev_enc))
msleep(10);
...
while (core->pmdomains[0] && pm_runtime_active(core->pmdomains[0]))
usleep_range(1000, 1500);
3. It uses an OR to merge all return codes and then report to the user
4. If the hardware never recovers, it keeps running on every 10ms,
flooding the syslog with 2 messages (so, up to 200 messages
per second).
Rework the code, in order to prevent that, by:
1. check the return code from PM runtime resume;
2. don't let the while() loops run forever;
3. store the failed event;
4. use warn ratelimited when it fails to recover.
Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/cec')
0 files changed, 0 insertions, 0 deletions