From 37453d24df240d9b592f9b4f993befd068bcccc6 Mon Sep 17 00:00:00 2001 From: Anup Mahindre Date: Wed, 6 Jan 2021 16:01:11 +0530 Subject: [PATCH] video: tegra: host: nvdla: Update KMD-FW handshake mechanism Update handshake mechanism to signal interuppt handling complete which avoids race condition. Jira DLA-4201 Change-Id: I23e24a0c9b95a413e4600e24444244498cc8c414 Signed-off-by: Anup Mahindre Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2466726 (cherry picked from commit 352216de11d9797068bcf6e3fb72fd061971e271) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2468166 GVS: Gerrit_Virtual_Submit Reviewed-by: Praveen K Reviewed-by: Amit Sharma (SW-TEGRA) Reviewed-by: Bharat Nihalani Reviewed-by: mobile promotions Tested-by: Bharat Nihalani Tested-by: mobile promotions --- drivers/video/tegra/host/nvdla/dla_os_interface.h | 7 ++++++- drivers/video/tegra/host/nvdla/nvdla.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/video/tegra/host/nvdla/dla_os_interface.h b/drivers/video/tegra/host/nvdla/dla_os_interface.h index 7903a016..5112f586 100644 --- a/drivers/video/tegra/host/nvdla/dla_os_interface.h +++ b/drivers/video/tegra/host/nvdla/dla_os_interface.h @@ -1,7 +1,7 @@ /* * NVDLA OS Interface * - * Copyright (c) 2016-2019, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2016-2021, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -138,6 +138,11 @@ #define DLA_MSG_UNUSED 6U #define DLA_MSG_DEBUG_PRINT 7U #define DLA_MSG_TASK_TIMEOUT 8U +/** + * Magic number expected to be written to mailbox0 after + * interuppt handling is complete + */ +#define DLA_MSG_INTERRUPT_HANDLING_COMPLETE 0xD1A0CAFE /** * Task descriptor for DLA_CMD_SUBMIT_TASK diff --git a/drivers/video/tegra/host/nvdla/nvdla.c b/drivers/video/tegra/host/nvdla/nvdla.c index e53152b9..749f0f4c 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.c +++ b/drivers/video/tegra/host/nvdla/nvdla.c @@ -1,7 +1,7 @@ /* * NVDLA driver for T194 * - * Copyright (c) 2016-2020, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2016-2021, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -113,6 +113,8 @@ clear_interrupt: host1x_writel(pdev, flcn_thi_int_stat_r(), flcn_thi_int_stat_clr_f()); host1x_readl(pdev, flcn_thi_int_stat_r()); host1x_writel(pdev, flcn_irqsclr_r(), flcn_irqsclr_swgen1_set_f()); + /* Notify FW that interuppt handling is complete */ + host1x_writel(pdev, flcn_mailbox0_r(), DLA_MSG_INTERRUPT_HANDLING_COMPLETE); return 0; }