From 631f4aafe9feef93c2570b65ff67bfee50fb63e8 Mon Sep 17 00:00:00 2001 From: Santosh Reddy Galma Date: Sun, 17 Apr 2022 10:18:52 +0000 Subject: [PATCH] platform: tegra: dce: fix async events handling - when there are multiple async events back to back from DCE with very short time gap between 2 events(for example, in case of DP MST, 2 heads could be sending flip event notification back to back at almost same time), there is a possibility of 2nd async event getting processed very late when shared mailbox register is set to zero as part of processing 1st async event and before processing of 2nd async event. - current change fixes it by processing all pending IVC frames for IPC channel when processing an async event. - change few error logs to info logs as these are not actually errors. Bug 3582863 Bug 3429668 Change-Id: I29b1813bed50c4583e37f02bf656802081ccf9d3 Signed-off-by: Santosh Reddy Galma Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2698560 (cherry picked from commit dd1abfa6eaab6e4f599d8c97bdccc7cbb67e1341) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2700438 Reviewed-by: svcacv Reviewed-by: svc_kernel_abi Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Arun Swain GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/dce/dce-client-ipc.c | 17 ++++++++++------- drivers/platform/tegra/dce/dce-ipc.c | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/platform/tegra/dce/dce-client-ipc.c b/drivers/platform/tegra/dce/dce-client-ipc.c index 59c94f78..0fe190ec 100644 --- a/drivers/platform/tegra/dce/dce-client-ipc.c +++ b/drivers/platform/tegra/dce/dce-client-ipc.c @@ -332,14 +332,17 @@ static void dce_client_process_event_ipc(struct tegra_dce *d, } msg_length = DCE_CLIENT_MAX_IPC_MSG_SIZE; - ret = dce_ipc_read_message(d, cl->int_type, msg_data, msg_length); - if (ret) { - dce_err(d, "Error in reading DCE msg for ch_type [%d]", - cl->int_type); - goto done; - } + do { + ret = dce_ipc_read_message(d, cl->int_type, msg_data, msg_length); + if (ret) { + dce_info(d, "Error in reading DCE msg for ch_type [%d]", + cl->int_type); + goto done; + } + + cl->callback_fn(cl->handle, cl->type, msg_length, msg_data, cl->data); + } while (dce_ipc_is_data_available(d, cl->int_type)); - cl->callback_fn(cl->handle, cl->type, msg_length, msg_data, cl->data); done: if (msg_data) dce_kfree(d, msg_data); diff --git a/drivers/platform/tegra/dce/dce-ipc.c b/drivers/platform/tegra/dce/dce-ipc.c index e1e98260..00af55cd 100644 --- a/drivers/platform/tegra/dce/dce-ipc.c +++ b/drivers/platform/tegra/dce/dce-ipc.c @@ -675,7 +675,7 @@ int dce_ipc_read_message(struct tegra_dce *d, u32 ch_type, ret = _dce_ipc_get_next_read_buff(ch); if (ret) { - dce_err(ch->d, "Error getting next free buf to read"); + dce_info(ch->d, "Error getting next free buf to read"); goto out; }