Commit 0bafb172 authored by Marek Behún's avatar Marek Behún Committed by Arnd Bergmann

firmware: turris-mox-rwtm: Do not complete if there are no waiters

Do not complete the "command done" completion if there are no waiters.
This can happen if a wait_for_completion() timed out or was interrupted.

Fixes: 389711b3 ("firmware: Add Turris Mox rWTM firmware driver")
Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 6bad1bef
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Turris Mox rWTM firmware driver * Turris Mox rWTM firmware driver
* *
* Copyright (C) 2019 Marek Behún <kabel@kernel.org> * Copyright (C) 2019, 2024 Marek Behún <kabel@kernel.org>
*/ */
#include <linux/armada-37xx-rwtm-mailbox.h> #include <linux/armada-37xx-rwtm-mailbox.h>
...@@ -174,6 +174,9 @@ static void mox_rwtm_rx_callback(struct mbox_client *cl, void *data) ...@@ -174,6 +174,9 @@ static void mox_rwtm_rx_callback(struct mbox_client *cl, void *data)
struct mox_rwtm *rwtm = dev_get_drvdata(cl->dev); struct mox_rwtm *rwtm = dev_get_drvdata(cl->dev);
struct armada_37xx_rwtm_rx_msg *msg = data; struct armada_37xx_rwtm_rx_msg *msg = data;
if (completion_done(&rwtm->cmd_done))
return;
rwtm->reply = *msg; rwtm->reply = *msg;
complete(&rwtm->cmd_done); complete(&rwtm->cmd_done);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment