[PATCH] nfc: nxp-nci: treat -ENXIO in IRQ thread as no data available
From: Carl Lee via B4 Relay
Date: Mon May 25 2026 - 22:09:55 EST
From: Carl Lee <carl.lee@xxxxxxx>
The I2C read operation in the IRQ thread may return -ENXIO
when the controller has not yet provided data after asserting IRQ.
IRQ assertion does not guarantee that data is immediately
available on the I2C bus. In such cases, the read request may
be NACKed, resulting in -ENXIO.
Treat this condition as "no data available yet" and log it at
debug level instead of reporting it as a read failure.
This avoids misleading error messages during normal operation.
Signed-off-by: Carl Lee <carl.lee@xxxxxxx>
---
Repeated -ENXIO read errors were observed during normal NFC
operation. This appears to happen when reads are performed
before data becomes available after IRQ assertion.
Handle this case as "no data available yet" and avoid
reporting it as an error.
---
drivers/nfc/nxp-nci/i2c.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index a6c08175d9dd..1d9d7d6fd542 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -231,6 +231,14 @@ static irqreturn_t nxp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
if (info->mode == NXP_NCI_MODE_FW)
nxp_nci_fw_recv_frame(phy->ndev, NULL);
}
+ if (r == -ENXIO) {
+ /*
+ * -ENXIO may occur if the controller has not yet
+ * provided data after asserting IRQ.
+ */
+ dev_dbg(&client->dev, "No data available yet\n");
+ goto exit_irq_handled;
+ }
if (r < 0) {
nfc_err(&client->dev, "Read failed with error %d\n", r);
goto exit_irq_handled;
---
base-commit: 6a50ba100ace43f43c87384367eb2d2605fcc16c
change-id: 20260520-nfc-nxp-nci-treat-enxio-as-no-data-available-yet-acc13582b9c7
Best regards,
--
Carl Lee <carl.lee@xxxxxxx>