From: Shubham Antil <shubham@octane.security>
To: netdev@vger.kernel.org
Cc: oe-linux-nfc@lists.linux.dev, david@ixit.cz, horms@kernel.org,
gio@octane.security
Subject: [PATCH net v7 0/3] nfc: order NCI UART and firmware teardown
Date: Wed, 4 Nov 2026 11:50:23 +0530 [thread overview]
Message-ID: <20261104062026.80599-1-shubham@octane.security> (raw)
Make NCI UART driver selection, callback shutdown, and Marvell firmware
download completion explicit and ordered.
Patch 1 serializes NCIUARTSETDRIVER and protects the driver registry while
a transport takes its module reference. Patch 2 closes UART callback
admission before private state is released, publishes the Marvell transport
state before registration, and preserves the unregister-time CORE_RESET
before quiescing and halting the controller. Patch 3 drains the Marvell
firmware timer/work/command dependencies before NCI workqueues are
destroyed and prevents a new download from replacing state which is still
active or completing.
The firmware overlap guard is local to nfcmrvl. It does not change the
completion rules of other NFC drivers.
Source auditing, patch development, review triage, and test planning were
assisted by OpenAI Codex, gpt-5.6-sol. I reviewed and tested the resulting
changes and take responsibility for them under my Signed-off-by.
The series was tested from the stated net tree base with:
- strict checkpatch and git diff checks for every patch;
- targeted W=1 builds and sparse checks;
- a W=1 allmodconfig build;
- an allyesconfig W=1 compile through vmlinux.o; the final global
objtool pass could not be completed on the 8 GiB test host because its
working set required heavy disk-backed paging, while the affected NFC
objects compiled without warnings;
- a full x86_64 bzImage and module build;
- KASAN, UBSAN, lockdep, and DEBUG_LIST enabled while exercising a
pty-backed user-space controller through reset-preserving lifecycle,
concurrent driver selection, registration/publication, overlapping
firmware requests, and firmware teardown cycles;
- a separate strict-mode KCSAN run over the same lifecycle and race
surfaces.
No in-tree selftest covers these NCI UART and nfcmrvl firmware paths. No
physical Marvell controller was available for testing.
---
Changes in v7:
- drop the generic NCI unregister/reset and firmware-serialization changes
and keep both fixes local to the affected transport;
- retain the close-time CORE_RESET and halt the controller only after
unregistering;
- fold Marvell state publication into the UART teardown change so each
patch remains usable on its own;
- restart a queued frame when the transport publishes READY and balance
tx_start() with tx_done() when teardown catches an active burst;
- replace generic firmware serialization with an nfcmrvl-local
active/completing gate;
- drain both directions of the NCI command timer/work dependency and purge
commands which can no longer run;
- hold firmware frames until the reset pulse finishes, queue timeout
completion on the firmware workqueue, and preserve positive errno
reporting;
- drop the stable Cc because each patch exceeds the current stable-tree
size limit and would require separate stable handling after review;
- document the discovery, validation, test environment, tool assistance,
and selftest and hardware coverage required by current netdev rules.
v6: https://lore.kernel.org/netdev/20261021032443.44412-1-shubham@octane.security/
Shubham Antil (3):
nfc: nci: uart: serialize driver selection
nfc: nci: uart: quiesce callbacks during teardown
nfc: nfcmrvl: stop firmware work before unregistering
drivers/nfc/nfcmrvl/fw_dnld.c | 243 +++++++++++++++++++++++++---------
drivers/nfc/nfcmrvl/fw_dnld.h | 11 ++
drivers/nfc/nfcmrvl/main.c | 18 ++-
drivers/nfc/nfcmrvl/nfcmrvl.h | 2 +
drivers/nfc/nfcmrvl/uart.c | 28 +++-
include/net/nfc/nci_core.h | 6 +
net/nfc/nci/uart.c | 235 +++++++++++++++++++++++++-------
7 files changed, 419 insertions(+), 124 deletions(-)
base-commit: 21f57ec673a1917547c808cfa81890485fffa03b
--
2.54.0
next reply other threads:[~2026-11-04 6:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 6:20 Shubham Antil [this message]
2026-11-04 6:20 ` [PATCH net v7 1/3] nfc: nci: uart: serialize driver selection Shubham Antil
2026-11-07 3:23 ` netdev-bot+sashiko
2026-11-04 6:20 ` [PATCH net v7 2/3] nfc: nci: uart: quiesce callbacks during teardown Shubham Antil
2026-11-07 3:23 ` netdev-bot+sashiko
2026-11-04 6:20 ` [PATCH net v7 3/3] nfc: nfcmrvl: stop firmware work before unregistering Shubham Antil
2026-11-07 3:23 ` netdev-bot+sashiko
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=20261104062026.80599-1-shubham@octane.security \
--to=shubham@octane.security \
--cc=david@ixit.cz \
--cc=gio@octane.security \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
/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