summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Muller <mullerf@google.com>2022-07-14 12:33:29 -0700
committerFlorian Muller <mullerf@google.com>2022-07-14 21:00:09 +0000
commit21b2d5311576a06e7b2d3ed007688bea6720922d (patch)
tree482902674af118342e567e4e899ebf452bc02996
parent4e0a06b80dc5ad8479b72b40e2f241c24e5c3c1b (diff)
downloadexynos-21b2d5311576a06e7b2d3ed007688bea6720922d.tar.gz
abox: Fix IPC related issues
1. Update Calliope state to CALLIOPE_ENABLING as soon as the work to download the abox FW has started. Otherwise we might run into a race condition where the state is still CALLIOPE_DISABLED, which wouldn't be expected here and would lead to an error. 2. Check for abox boot done (check for Calliope state CALLIOPE_ENABLING vs CALLIOPE_ENABLED) when sending IPC and behave accordingly depending of the state in order to prevent "Transaction timeout" issue with abox. Test: Manual Bug: 238920301 Bug: 238470383 Signed-off-by: Florian Muller <mullerf@google.com> Change-Id: I7073991656559a45e6c56ac6c2d134cc7fd3217b
-rw-r--r--sound/soc/samsung/abox/abox.c3
-rw-r--r--sound/soc/samsung/abox/abox_rdma.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/samsung/abox/abox.c b/sound/soc/samsung/abox/abox.c
index 97c9d12e122b..954b7e64c6d6 100644
--- a/sound/soc/samsung/abox/abox.c
+++ b/sound/soc/samsung/abox/abox.c
@@ -5793,6 +5793,8 @@ static void abox_download_work_func(struct work_struct *work)
dev_info(dev, "%s\n", __func__);
+ data->calliope_state = CALLIOPE_ENABLING;
+
ret = abox_download_firmware(pdev);
if (ret < 0) {
if (ret != -EAGAIN)
@@ -5809,7 +5811,6 @@ static void abox_download_work_func(struct work_struct *work)
abox_cpu_power(true);
abox_cpu_enable(true);
- data->calliope_state = CALLIOPE_ENABLING;
abox_pad_retention(false);
#ifdef MANUAL_SECURITY_CHANGE
diff --git a/sound/soc/samsung/abox/abox_rdma.c b/sound/soc/samsung/abox/abox_rdma.c
index b0aecdebf89b..f812256727bf 100644
--- a/sound/soc/samsung/abox/abox_rdma.c
+++ b/sound/soc/samsung/abox/abox_rdma.c
@@ -242,6 +242,7 @@ static int abox_rdma_mailbox_send_cmd(struct device *dev, unsigned int cmd)
struct abox_dma_data *dma_data = dev_get_drvdata(dev);
struct device *dev_abox = dma_data->dev_abox;
struct abox_compr_data *data = &dma_data->compr_data;
+ struct abox_data *abox_data = dma_data->abox_data;
ABOX_IPC_MSG ipc;
int ret, n, ack;
@@ -300,7 +301,10 @@ static int abox_rdma_mailbox_send_cmd(struct device *dev, unsigned int cmd)
abox_rdma_mailbox_write(dev, COMPR_HANDLE_ID, data->handle_id);
abox_rdma_mailbox_write(dev, COMPR_CMD_CODE, cmd);
- ret = abox_request_ipc(dev_abox, IPC_OFFLOAD, &ipc, 0, 1, 1);
+ if (abox_data->calliope_state == CALLIOPE_ENABLED)
+ ret = abox_request_ipc(dev_abox, IPC_OFFLOAD, &ipc, 0, 1, 1);
+ else if (abox_data->calliope_state == CALLIOPE_ENABLING)
+ ret = abox_request_ipc(dev_abox, IPC_OFFLOAD, &ipc, 0, 0, 1);
for (n = 0, ack = 0; n < 2000; n++) {
/* Wait for ACK */