[PATCH] NFC: nxp-nci: fix deadlock between firmware download and IRQ handler
From: Ian Ray
Date: Wed Jun 24 2026 - 12:00:05 EST
The firmware download work function holds `info_lock' while calling the
nxp_nci_fw_send(), which waits for a completion.
The completion is signalled by the IRQ thread handler, which also takes
`info_lock', causing a deadlock.
Fix by dropping the mutex while waiting for the completion.
Signed-off-by: Ian Ray <ian.ray@xxxxxxxxxxxxxxxx>
---
drivers/nfc/nxp-nci/firmware.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c
index a9533977aff8..38fcac26ce56 100644
--- a/drivers/nfc/nxp-nci/firmware.c
+++ b/drivers/nfc/nxp-nci/firmware.c
@@ -154,8 +154,13 @@ static int nxp_nci_fw_send(struct nxp_nci_info *info)
if (fw_info->fw)
schedule_work(&fw_info->work);
} else {
+ mutex_unlock(&info->info_lock);
+
completion_rc = wait_for_completion_interruptible_timeout(
&fw_info->cmd_completion, NXP_NCI_FW_ANSWER_TIMEOUT);
+
+ mutex_lock(&info->info_lock);
+
if (completion_rc == 0)
return -ETIMEDOUT;
}
--
2.47.3