Skip to content

Commit 0bafb17

Browse files
elkabloarndb
authored andcommitted
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: 389711b ("firmware: Add Turris Mox rWTM firmware driver") Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 6bad1be commit 0bafb17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/firmware/turris-mox-rwtm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Turris Mox rWTM firmware driver
44
*
5-
* Copyright (C) 2019 Marek Behún <[email protected]>
5+
* Copyright (C) 2019, 2024 Marek Behún <[email protected]>
66
*/
77

88
#include <linux/armada-37xx-rwtm-mailbox.h>
@@ -174,6 +174,9 @@ static void mox_rwtm_rx_callback(struct mbox_client *cl, void *data)
174174
struct mox_rwtm *rwtm = dev_get_drvdata(cl->dev);
175175
struct armada_37xx_rwtm_rx_msg *msg = data;
176176

177+
if (completion_done(&rwtm->cmd_done))
178+
return;
179+
177180
rwtm->reply = *msg;
178181
complete(&rwtm->cmd_done);
179182
}

0 commit comments

Comments
 (0)