Re: [PATCH] nfc: nxp-nci: i2c: Do not keep a fault taken in reset across power-up
From: David Heidelberg
Date: Sun Nov 22 2026 - 21:12:52 EST
On 22/11/2026 06:13, EMCP333 via B4 Relay wrote:
From: EMCP333 <emcp@xxxxxxxx>Thank you for your contribution, sadly I would need you to use a real name following the [1]
On a OnePlus 6T (PN553), the controller powers up once after boot and
never again. Each power-down logs a read error, and every later
power-up times out:
nxp-nci_i2c 3-0028: NFC: Read failed with error -121
nci: __nci_request: wait_for_completion_interruptible_timeout failed 0
nxp_nci_close() holds info_lock while it drops EN and sets the mode to
COLD, and the IRQ thread takes the same lock. An interrupt raised as
the controller goes into reset is therefore handled after close() has
finished, in COLD mode, where the IRQ thread treats it as -EREMOTEIO and
records it in hard_fault. set_mode() clears hard_fault only on entry to
COLD, which has already happened, so the fault survives into the next
power-up: nxp_nci_i2c_write() returns it for CORE_RESET without touching
the bus, and the request times out.
Do not count an interrupt taken while the controller is held in reset
as a fault, and clear hard_fault on every mode change, since each one
drives EN/FW and so resets the controller.
Tested on a OnePlus 6T with this change on the postmarketOS sdm845
kernel (6.18): five power-up/power-down cycles through the NFC netlink
interface all succeed, 0.03-0.04 s each, with no read errors. Without
it, every power-up after the first times out.
The code and this changelog were prepared with the help of an AI coding
assistant. The submitter has reviewed both and takes responsibility for
them.
Fixes: 6be88670fc59 ("NFC: nxp-nci_i2c: Add I2C support to NXP NCI driver")
Signed-off-by: EMCP333 <emcp@xxxxxxxx>
|| using a known identity (sorry, no anonymous contributions.)
Thanks
David
[1] https://docs.kernel.org/process/submitting-patches.html