nfc: order NCI UART and firmware teardown
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 Latest4 patches 0 repliesNew
- v73 patches 0 repliesSuperseded
- v66 patches 2 repliesSuperseded
Changes in v8 from the cover letter
- keep asynchronous core completion lockless to avoid an inverse lock
Patches in v8 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | nfc: nci: uart: serialize driver selectioninclude/ net/ | +100 | 0 replies | |
| 2/4 | nfc: reject overlapping firmware downloadsdrivers/ drivers/ net/ | +12 | 0 replies | |
| 3/4 | nfc: nci: uart: quiesce callbacks during teardowndrivers/ drivers/ drivers/ +5 more | +496 | 0 replies | |
| 4/4 | nfc: nfcmrvl: stop firmware work before unregisteringdrivers/ drivers/ drivers/ +2 more | +223 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.
Cover letter [PATCH net v8 0/4] nfc: order NCI UART and firmware teardown
Make NCI UART driver selection, callback shutdown, close-time command handling, and Marvell firmware completion explicit and ordered.
Patch 1 serializes NCIUARTSETDRIVER and protects the driver registry while a transport takes its module reference. Patch 2 rejects a second firmware request without disturbing the active core state. Patch 3 orders UART publication and shutdown, preserves close-time reset and driver commands, and bounds transport draining. Patch 4 stops firmware timer, receive, and command producers before their queues and private state are released.
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 final v8 code was tested with:
- strict checkpatch and git diff checks for every patch;
- targeted W=1 builds and current sparse checks;
- full x86_64 bzImage and module builds with KASAN, UBSAN, lockdep, and
DEBUG_LIST, and separately with strict-mode KCSAN;
- 20 concurrent driver-selection cycles under each configuration;
- 5 registration/publication and 5 reset-preserving lifecycle cycles under each configuration; and
- 100 firmware teardown cycles and five timer-boundary modes under each configuration.
All test assertions completed with zero failures. Neither sanitizer run reported a memory, concurrency, locking, or undefined-behavior diagnostic. Current sparse reported only two pre-existing warnings outside the changed logic. The st-nci close path was also built and checked separately because it sends a final proprietary command from its close callback.
No in-tree selftest covers these NCI UART and nfcmrvl firmware paths. No physical Marvell controller was available for testing.
Changes since v7:
- keep asynchronous core completion lockless to avoid an inverse lock
order with driver-private locks;
- serialize transmit wakeups and retain partial frames across worker
restarts;
- publish Marvell transport state before NCI registration while keeping
receive admission closed until core queues are ready;
- close command admission and drain response work before cancellation;
- preserve the close-time reset and a driver's final close command, then
cancel any command left by an interrupted synchronous request;
- actively retry partial UART writes during the bounded close flush and
poison a line-discipline instance whose framing cannot be preserved; - stop firmware receive, timeout, and command dependencies before core workqueue teardown; and
- document lifecycle sleep, locking, lifetime, and queue-ownership contracts and refresh validation on the final tree.
v7: https://lore.kernel.org/netdev/[email protected]/
Shubham Antil (4):
nfc: nci: uart: serialize driver selection
nfc: reject overlapping firmware downloads
nfc: nci: uart: quiesce callbacks during teardown
nfc: nfcmrvl: stop firmware work before unregistering
drivers/nfc/nfcmrvl/fw_dnld.c | 237 ++++++++++++----- drivers/nfc/nfcmrvl/fw_dnld.h | 11 + drivers/nfc/nfcmrvl/main.c | 52 +++- drivers/nfc/nfcmrvl/nfcmrvl.h | 4 + drivers/nfc/nfcmrvl/uart.c | 64 ++++- include/net/nfc/nci_core.h | 29 +++ net/nfc/core.c | 20 +- net/nfc/nci/core.c | 82 ++++-- net/nfc/nci/rsp.c | 3 + net/nfc/nci/uart.c | 467 +++++++++++++++++++++++++++++----- 10 files changed, 805 insertions(+), 164 deletions(-)
base-commit: 30c71476d842b094651bd7712f6c8ee8716147d0
Signature · 1 line
2.54.0