From 09b7b63ec407cb1b23e6381cf2aebed553022feb Mon Sep 17 00:00:00 2001 From: Nikesh Oswal Date: Wed, 15 May 2024 12:41:21 +0000 Subject: [PATCH] video: tsec: Set tsec state before power_on/off Set s_tsec_state before calling tsec_plat_poweron as it enables irq and can context switch to the irq handler which needs s_tsec_state set appropriately Bug 4437491 Change-Id: I1f48713329b9315376fe926d1e8b33686d05d035 Signed-off-by: Nikesh Oswal Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3145973 Reviewed-by: svcacv GVS: buildbot_gerritrpt --- drivers/video/tegra/tsec/tsec_comms/tsec_comms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c b/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c index ff42e225..1e76943c 100644 --- a/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c +++ b/drivers/video/tegra/tsec/tsec_comms/tsec_comms.c @@ -111,8 +111,8 @@ static int tsec_comms_send_getctxt_cmd(callback_func_t cb_func, void *cb_ctx) /* Context retrieved, shutdown tsec now */ static void tsec_comms_process_getctxt_msg(void) { - tsec_plat_poweroff(); s_tsec_state = TSEC_STATE_SHUTDOWN; + tsec_plat_poweroff(); } /* Power on tsec with context information */ @@ -122,8 +122,8 @@ static void tsec_comms_poweron_with_context(void) bootInfo->bootWithContextFlag = 1; bootInfo->bootContextOffset = s_tsec_context_gscco_offset; - tsec_plat_poweron(); s_tsec_state = TSEC_STATE_BOOTED_WITH_CONTEXT; + tsec_plat_poweron(); } /* Clear flags after power on with context done */