From e93551bb3bd8ac43779fa70c7363ee2568da45ca Mon Sep 17 00:00:00 2001 From: Siew Chin Lim Date: Fri, 30 Jul 2021 00:40:48 +0800 Subject: [PATCH] fix(intel): always set doorbell to SDM after sending command This patch fixes the mailbox stall issue when sending mailbox command that is larger than mailbox command FIFO size. Large mailbox command will be sent to SDM in multiple chunks. HPS will set doorbell to SDM when command FIFO full (is_doorbell_triggered will be set to 1) to notify SDM to read the command data from FIFO, so that HPS can continue to send the next chunk of command data. However, HPS will not set the doorbell to SDM at the end if the doorbell have been set earlier due to FIFO full. This will cause SDM mailbox service stall because it is still waiting for last chunk of command data. This patch fixes the code to always set the doorbell to SDM at the end to get rid of stall issue. Signed-off-by: Siew Chin Lim Change-Id: Idbe62410a00d92a30c7aeaa26d53d79a910cac0a --- plat/intel/soc/common/soc/socfpga_mailbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plat/intel/soc/common/soc/socfpga_mailbox.c b/plat/intel/soc/common/soc/socfpga_mailbox.c index aec94af94..eba03991b 100644 --- a/plat/intel/soc/common/soc/socfpga_mailbox.c +++ b/plat/intel/soc/common/soc/socfpga_mailbox.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Intel Corporation. All rights reserved. + * Copyright (c) 2020-2022, Intel Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -107,9 +107,7 @@ static int fill_mailbox_circular_buffer(uint32_t header_cmd, uint32_t *args, } } - if (!is_doorbell_triggered) { - mmio_write_32(MBOX_OFFSET + MBOX_DOORBELL_TO_SDM, 1U); - } + mmio_write_32(MBOX_OFFSET + MBOX_DOORBELL_TO_SDM, 1U); return MBOX_RET_OK;