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 <amahindre@nvidia.com>
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 <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Anup Mahindre
2021-01-06 16:01:11 +05:30
committed by Laxman Dewangan
parent 7b57280b9b
commit 37453d24df
2 changed files with 9 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
/* /*
* NVDLA OS Interface * 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 * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@@ -138,6 +138,11 @@
#define DLA_MSG_UNUSED 6U #define DLA_MSG_UNUSED 6U
#define DLA_MSG_DEBUG_PRINT 7U #define DLA_MSG_DEBUG_PRINT 7U
#define DLA_MSG_TASK_TIMEOUT 8U #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 * Task descriptor for DLA_CMD_SUBMIT_TASK

View File

@@ -1,7 +1,7 @@
/* /*
* NVDLA driver for T194 * 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 * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * 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_writel(pdev, flcn_thi_int_stat_r(), flcn_thi_int_stat_clr_f());
host1x_readl(pdev, flcn_thi_int_stat_r()); host1x_readl(pdev, flcn_thi_int_stat_r());
host1x_writel(pdev, flcn_irqsclr_r(), flcn_irqsclr_swgen1_set_f()); 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; return 0;
} }