summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStanimir Varbanov <stanimir.varbanov@linaro.org>2019-09-17 09:02:26 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-31 16:34:54 +0100
commitf0d45d442855fae85630b14db096d6dd0ec26cad (patch)
tree1e3645902e71aa0c1b2307da9014d6a30e8ff739 /drivers
parent697353c7e16924e8330582c0833efb6288b9bc1f (diff)
downloadlinux-stable-f0d45d442855fae85630b14db096d6dd0ec26cad.tar.gz
linux-stable-f0d45d442855fae85630b14db096d6dd0ec26cad.tar.bz2
linux-stable-f0d45d442855fae85630b14db096d6dd0ec26cad.zip
media: venus: Fix occasionally failures to suspend
[ Upstream commit 8dbebb2bd01e6f36e9a215dcde99ace70408f2c8 ] Failure to suspend (venus_suspend_3xx) happens when the system is fresh booted and loading venus driver. This happens once and after reload the venus driver modules the problem disrepair. Fix the failure by skipping the check for WFI and IDLE bits if PC_READY is on in control status register. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/qcom/venus/hfi_venus.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index 124085556b94..fbcc67c10993 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -1484,6 +1484,7 @@ static int venus_suspend_3xx(struct venus_core *core)
{
struct venus_hfi_device *hdev = to_hfi_priv(core);
struct device *dev = core->dev;
+ u32 ctrl_status;
bool val;
int ret;
@@ -1499,6 +1500,10 @@ static int venus_suspend_3xx(struct venus_core *core)
return -EINVAL;
}
+ ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0);
+ if (ctrl_status & CPU_CS_SCIACMDARG0_PC_READY)
+ goto power_off;
+
/*
* Power collapse sequence for Venus 3xx and 4xx versions:
* 1. Check for ARM9 and video core to be idle by checking WFI bit
@@ -1523,6 +1528,7 @@ static int venus_suspend_3xx(struct venus_core *core)
if (ret)
return ret;
+power_off:
mutex_lock(&hdev->lock);
ret = venus_power_off(hdev);