[PATCH AUTOSEL 6.19-5.10] nfc: nxp-nci: remove interrupt trigger type

Sasha Levin
2026-02-14T21:26:17Z

From: Carl Lee <carl.lee@amd.com>

[ Upstream commit 57be33f85e369ce9f69f61eaa34734e0d3bd47a7 ]

For NXP NCI devices (e.g. PN7150), the interrupt is level-triggered and
active high, not edge-triggered.

Using IRQF_TRIGGER_RISING in the driver can cause interrupts to fail
to trigger correctly.

Remove IRQF_TRIGGER_RISING and rely on the IRQ trigger type configured
via Device Tree.

Signed-off-by: Carl Lee <carl.lee@amd.com>
Link: https://patch.msgid.link/20260205-fc-nxp-nci-remove-interrupt-trigger-type-v2-1-79d2ed4a7e42@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## Analysis of nfc: nxp-nci: remove interrupt trigger type

### 1. COMMIT MESSAGE ANALYSIS

The commit states that for NXP NCI devices (e.g., PN7150), the interrupt
is **level-triggered and active high**, not edge-triggered. The driver
was incorrectly using `IRQF_TRIGGER_RISING`, which can cause
**interrupts to fail to trigger correctly**. The fix removes the
hardcoded trigger type and relies on the Device Tree configuration
instead.

Key phrases:
- "interrupts to fail to trigger correctly" — this is a real hardware
bug affecting functionality
- "level-triggered and active high, not edge-triggered" — clear
technical justification

### 2. CODE CHANGE ANALYSIS

The change is a **single-line modification**:

```c
- IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+ IRQF_ONESHOT,
```

This removes `IRQF_TRIGGER_RISING` from the `request_threaded_irq()`
call, leaving only `IRQF_ONESHOT`. When no trigger type is specified,
the kernel uses the trigger type configured by the platform (Device Tree
or ACPI), which is the correct behavior for this device.

**Bug mechanism**: The PN7150 NFC chip uses a level-triggered, active-
high interrupt. When the driver hardcodes `IRQF_TRIGGER_RISING` (edge-
triggered), it can:
- Miss interrupts if the line stays high (level vs edge semantic
mismatch)
- Cause the NFC controller to become unresponsive because the driver
never sees the interrupt
- On some interrupt controllers, specifying a conflicting trigger type
can cause the IRQ to not work at all

### 3. CLASSIFICATION

This is a **hardware bug fix**. The driver had an incorrect interrupt
configuration that causes the device to malfunction. It falls into the
category of fixing a real bug that prevents hardware from working
correctly.

This is NOT a feature addition, API change, or refactoring. It's
correcting an incorrect driver parameter.

### 4. SCOPE AND RISK ASSESSMENT

- **Size**: 1 line changed in 1 file — minimal scope
- **Risk**: Very low. Removing the hardcoded trigger type and deferring
to DT/platform configuration is the standard, correct approach in
modern Linux kernel drivers. Many other drivers have undergone similar
changes.
- **Subsystem**: NFC driver (nxp-nci) — niche but has real users (NFC on
embedded/mobile platforms)
- **Regression potential**: Low. If a system was working with
`IRQF_TRIGGER_RISING` before, it means either (a) the DT already
specified the correct trigger type (in which case removing the driver
override changes nothing) or (b) the interrupt controller happened to
work with the wrong trigger type. In case (b), the DT should already
have the correct type defined, and this change makes the driver
correctly defer to it.

### 5. USER IMPACT

NXP PN7150 is a commonly used NFC controller, found in embedded systems
and IoT devices — exactly the kind of platforms running stable kernels.
Users affected by this bug would see their NFC controller fail to work
properly (missed interrupts = no NFC communication). This is a
**complete functionality failure** for affected users.

The "v2" in the link suggests this went through review iteration,
indicating careful consideration.

### 6. STABILITY INDICATORS

- Signed by AMD engineer (Carl Lee)
- Accepted by networking maintainer (Jakub Kicinski)
- Clear, well-documented commit message explaining the technical issue
- The fix follows established kernel patterns (relying on DT for IRQ
type)

### 7. DEPENDENCY CHECK

This is a standalone, self-contained fix. It has no dependencies on
other commits. The `nxp-nci` driver exists in all recent stable trees,
and the `request_threaded_irq()` call with `IRQF_TRIGGER_RISING |
IRQF_ONESHOT` has been there since the driver was introduced. The fix
will apply cleanly to stable trees.

### Summary

This is a small, surgical, one-line fix that corrects an incorrect
interrupt trigger type in the NXP NCI NFC driver. The bug causes
interrupts to fail to trigger correctly, making the NFC hardware non-
functional in some configurations. The fix is obviously correct
(removing a wrong hardcoded value in favor of the platform-specified
one), has minimal regression risk, and affects real hardware users. It
meets all stable kernel criteria.

**YES**

drivers/nfc/nxp-nci/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 049662ffdf972..6a5ce8ff91f0b 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -305,7 +305,7 @@ static int nxp_nci_i2c_probe(struct i2c_client *client)

r = request_threaded_irq(client->irq, NULL,
nxp_nci_i2c_irq_thread_fn,
- IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+ IRQF_ONESHOT,
NXP_NCI_I2C_DRIVER_NAME, phy);
if (r < 0)
nfc_err(&client->dev, "Unable to register IRQ handler\n");
--
2.51.0