mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Heidelberg <david@ixit.cz>
To: emcp@enser.io
Cc: oe-linux-nfc@lists.linux.dev, linux-kernel@vger.kernel.org,
	"Clément Perrochaud" <clement.perrochaud@nxp.com>,
	"Samuel Ortiz" <sameo@linux.intel.com>
Subject: Re: [PATCH] nfc: nxp-nci: i2c: Do not keep a fault taken in reset across power-up
Date: Mon, 23 Nov 2026 03:12:34 +0100	[thread overview]
Message-ID: <2e4a2767-ab88-4255-88d5-335cbafe90b3@ixit.cz> (raw)
In-Reply-To: <20261122-b4-nxp-nci-cold-fault-v1-1-fad784c73cfe@enser.io>

On 22/11/2026 06:13, EMCP333 via B4 Relay wrote:
> From: EMCP333 <emcp@enser.io>
> 
> 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@enser.io>
Thank you for your contribution, sadly I would need you to use a real name 
following the [1]

|| using a known identity (sorry, no anonymous contributions.)

Thanks
David

[1] https://docs.kernel.org/process/submitting-patches.html

      reply	other threads:[~2026-11-23  2:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  5:13 EMCP333 via B4 Relay
2026-11-23  2:12 ` David Heidelberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e4a2767-ab88-4255-88d5-335cbafe90b3@ixit.cz \
    --to=david@ixit.cz \
    --cc=clement.perrochaud@nxp.com \
    --cc=emcp@enser.io \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-linux-nfc@lists.linux.dev \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®