From d4185fbe2eace237b39d85e72b07f5517511b60e Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Tue, 9 May 2023 04:40:16 +0000 Subject: [PATCH] platform: dce: add delay between ipc_notify admin-seq Add a few microseconds delay between sending ipc-notify calls for IPC channel reset. IPC notify ACKs are asynchronous and sending notify when the previous ACK was still in progress will cause spurious interrupt/ACK signal and printout FSP state warnings. Bug 4069133 Change-Id: I20dff299149a66629dc23ab2a7cb7765eac1b4dc Signed-off-by: Mahesh Kumar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2900570 Reviewed-by: svc_kernel_abi Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Vinod Atyam Reviewed-by: Bitan Biswas Tested-by: Vinod Atyam GVS: Gerrit_Virtual_Submit Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2902404 --- drivers/platform/tegra/dce/dce-bootstrap.c | 1 + drivers/platform/tegra/dce/dce-util-common.c | 14 ++++++++++++++ .../platform/tegra/dce/include/dce-util-common.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/drivers/platform/tegra/dce/dce-bootstrap.c b/drivers/platform/tegra/dce/dce-bootstrap.c index 02d0f910..d88fd389 100644 --- a/drivers/platform/tegra/dce/dce-bootstrap.c +++ b/drivers/platform/tegra/dce/dce-bootstrap.c @@ -155,6 +155,7 @@ dce_start_boot_flow(struct tegra_dce *d) } dce_admin_ivc_channel_reset(d); + dce_usleep_range(10, 50); ret = dce_start_admin_seq(d); if (ret) { diff --git a/drivers/platform/tegra/dce/dce-util-common.c b/drivers/platform/tegra/dce/dce-util-common.c index a0ad5753..436e94cc 100644 --- a/drivers/platform/tegra/dce/dce-util-common.c +++ b/drivers/platform/tegra/dce/dce-util-common.c @@ -601,6 +601,20 @@ unsigned long dce_get_nxt_pow_of_2(unsigned long *addr, u8 nbits) return val; } +/* + * dce_usleep_range : sleep between min-max range + * + * @min : minimum sleep time in usec + * @max : maximum sleep time in usec + * + * Return : void + */ + +void dce_usleep_range(unsigned long min, unsigned long max) +{ + usleep_range(min, max); +} + /* * dce_schedule_work : schedule work in global highpri workqueue * diff --git a/drivers/platform/tegra/dce/include/dce-util-common.h b/drivers/platform/tegra/dce/include/dce-util-common.h index 03bbfe46..47c42958 100644 --- a/drivers/platform/tegra/dce/include/dce-util-common.h +++ b/drivers/platform/tegra/dce/include/dce-util-common.h @@ -41,6 +41,8 @@ void dce_kfree(struct tegra_dce *d, void *addr); unsigned long dce_get_nxt_pow_of_2(unsigned long *addr, u8 nbits); +void dce_usleep_range(unsigned long min, unsigned long max); + static inline void dce_bitmap_set(unsigned long *map, unsigned int start, unsigned int len) {