From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796043768; b=jxDD1em03kd+mudLqG9rUI+poXskmnNgAXzvfOof+quMUlBOJS5aA/XfuZJNo4alcZPU 7eJQH2Vg6ZdbpMlyb74nqkew2T/sj7aloL2AIL7sqlZERN82KVhYMYLyL0ytUcMo+p0Hq M+uR94+1YHEB6K9kALSpIoWHffzDxQw+U8O6TvbYBTjk7iyq1L5rzU5LbQqOQZCVbrtzj YXCY+MAQCIuXEVt7RTdfAKpcIvQXx659x8wIK6MfYP92hquf3Z8HA6UTY1MtMung6a26X 9rItgWINJCltWFTMk505O/t6IwMXTlYXk8IPKruryWPMIyt0CNxnAZQ3N4gLWiuIe4Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796043768; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=/CdbN+BIGW+IddhqiOfqdgJQ7fgcuHWgUeGOANWHQwM=; b=YKr9iB9816FG+SuapA0NWN3NzPnRMXZ+5PKwTPfHZhDsG5skP83TnZ2Nq1x2TAUHXWuQ KBzQ2NSokTTtaNByp9lU+vpnBCf47o1bwtfGMCZELPauQ3rYyXwXUWoYqVri9BzIHOCnk cTZjwiF6XDSddbtUJ+bAAuRgFVpZAcobJCegl1UN/ypU/Em1UhH/0SeM7V7isZdx5eav8 mNeFqKhKIqVZDtPDUXgHm3QewIlMWCbyBr/CTMwBPbHl8jLp1znsM6/JynnseLyRC+BIn yqYjZuMGbjSHZohYl+6Usm0p245vwDTsMJXBRtFu09wRIPSNcSqiK1H1vGzNIHz6TXA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=octane.security; spf=pass smtp.mailfrom=octane.security; dkim=pass header.d=octane.security header.i=@octane.security header.a=rsa-sha256 header.s=google header.b=mAGRH9g2; arc=none smtp.remote-ip=74.125.82.171 Received: from mail-dy1-f171.google.com (mail-dy1-f171.google.com [74.125.82.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2B01606A320 for ; Mon, 30 Nov 2026 13:02:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A2B01606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=octane.security Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=octane.security Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=octane.security header.i=@octane.security header.a=rsa-sha256 header.s=google header.b=mAGRH9g2 Received: by mail-dy1-f171.google.com with SMTP id 5a478bee46e88-386c71feeeaso7396625eec.0 for ; Mon, 30 Nov 2026 05:02:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=octane.security; s=google; t=1796043767; x=1796648567; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=/CdbN+BIGW+IddhqiOfqdgJQ7fgcuHWgUeGOANWHQwM=; b=mAGRH9g2Sw8fKP9X9DyVfWvUsIR2w4FQVRxNuBfS3PJ6clozJNYcNvcBkGLvuAtbbb i/cmM9w5Q3mLwqZg+pxb6k5g8FaBLba3Gaik+n9PQAD0UcgGjoqWnallkoSfO+P2/hwm xeB9wxsbvIALxnoy7r9pIazb+an2umX0qW1Og4ANrORKPpqW+Rxq1q1+7HLFAdKsuKsP dj037buj0ccnXOJ8cJjsIt7cp8RojwZkPULUE3Ua6zhftqvYYfE6gJT68w5UHntEMjXr wY6asCetxrG7gP42BTy4m6I2lPExNegfbovtaUp9kweokrZNIFCTBnqQq0rC2lOxk3wT DB3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796043767; x=1796648567; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/CdbN+BIGW+IddhqiOfqdgJQ7fgcuHWgUeGOANWHQwM=; b=P8GiHtws7csIIfX5+UketH9RpuXGxLyKhDZx80xdfpD9rM673/TH4zqJkg/WTV+e+P hqgYcvXeD9F3xy3QiJgJzzqRY4nnxcDKj16MqqBFnaKO2PMmyYg9BqWWIRjWFiUW6ya7 SEE5drAxam2cE/NZ0xo0bQ9Qnd+7mRz6JTciyHyPYehL+vQtI97AePflobnK6F5OAht7 Zz9OcLG/A8wv5gHufooMhYfbw3c3Ii7jzt5rHpcr+1GiOnr+s0/+75Cz5tZTBonqD/B8 MOT54CN8z76+hxcjPuQtigf1PdNCGyBgGTmURCMwSZxUYfFp23nsZdezVvwgf/dcK0pB FWQA== X-Gm-Message-State: APuU4Z+cyjsjCz5blX6w9RSPb6xEYXolP7LwsbNRanszAxV0gwvLIXhk fqoxTuW8ZnbBSreDUkBaxr2faVPT1ys816/Uge97Lj403a9pQtTGIMSdFhNRoG6ER8k2KuCPviE /1k1Z X-Gm-Gg: AZFdTZdTZiCRDSnz7nQpF+eV0BAKIlXYfUe6paoKXC+T2pZMIWdKgUWtMxekbV3Me4W PhSI1KYl3dRv3McyTuS+owz95aLM+vqRH8O0jixSON2IoacPZCprl2QTmuhyJc9FjqmpIYHf+Qj GzvewiJCDj3lyJOfGNGDxtfC+e8uFmC+jPuOEFNPjiX1LJ/YGXfxVLzEfr7/bTOQRsa/389xJyG VT7u7paWCc7j3FqY35l91cbDm6Asg5dcNmGj2U0cr3vklAGTXhmutHcFgn2HHrJ7M5Cmr1gcC0X RgkZl2ioouAtzjmqlrSURHfQppMKxm80nocDrOT5gpXbXx/Cp603x8Br/Xd/jTcvHQjK7oPj4D6 oA+vVmpMh2gy5DUEa1VMnP+1C8keeWZ/aHMNtbOWFJ3cY8lGekQnDGUsoP2kCfHOJV3DKVIgNv+ 0uxTLc1r4q3TNZvV21TOgBvXIbVdEB/wnRZGiGP9j/N2cPqc+RoCwBLTlmEjKEiecNcBukHQVdH tMAGYu4ebyXPEGWfP6ptLtoTAf0qxm7FBtVk62HcxnrU0D1xYzlksFvAxIB/h7CsrsUUukL5Lc7 6TU+/Pw4uZlWsfq3whwdMZQ8dl+RE+mnssXHa9O4v3Lgviul+8BL+8cAGmrfHlQ4en1cyp6AkAb zNIZfWOzl84pVhnl0LaaWORTkxzHYaenHJS+hr4dFdy16c8A7lg== X-Received: by 2002:a05:7300:8816:b0:385:5b47:8aad with SMTP id 5a478bee46e88-38570451daemr34783851eec.19.1796043765709; Mon, 30 Nov 2026 05:02:45 -0800 (PST) Received: from localhost.localdomain ([157.119.125.90]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-385677c0c1dsm111829929eec.21.2026.11.30.05.02.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Nov 2026 05:02:45 -0800 (PST) From: Shubham Antil To: netdev@vger.kernel.org Cc: Simon Horman , gio@octane.security, David Heidelberg , oe-linux-nfc@lists.linux.dev Subject: [PATCH net v9 0/3] nfc: nfcmrvl: split firmware teardown fixes Date: Mon, 30 Nov 2026 18:32:37 +0530 Message-ID: <20261130130240.65411-1-shubham@octane.security> X-Mailer: git-send-email 2.54.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The v8 series combined the firmware teardown fix with unrelated UART work. This standalone submission applies directly to the base below and divides the change into core infrastructure, firmware worker synchronization, and the nfcmrvl unregister hook. The first patch adds the NCI pre-unregister shutdown stage and a terminal command-drain helper. It prevents a close-time response from scheduling command work after that drain. The second patch serializes Marvell firmware completion, timeout, and receive work. The final patch invokes the abort while the NCI workqueues are still alive. The issue was found during an AI-assisted source audit using OpenAI Codex, gpt-5.6-sol. The active-download detach condition was reproduced at runtime by starting a firmware download and removing the N_NCI line discipline. One hundred immediate detach iterations and timed completion-boundary modes were exercised. No production incident or pre-fix sanitizer report was captured. Patch development and test planning used the same assistant. Each mail patch was applied independently to the base below on the Linux test host. The affected NFC objects built after every patch with W=1 and sparse. A KASAN, UBSAN, and lockdep kernel completed 100 immediate firmware-download detach iterations and the timed completion modes without a diagnostic, failure, or remaining device. No physical Marvell controller was available. Changes since v8: - make firmware teardown a standalone submission on the original base - split NCI infrastructure, firmware synchronization, and driver hookup - drain late responses before the command work and timer are cancelled - leave overlapping-download admission to its independent patch set - correct the command-drain helper name in the changelog - remove an obsolete write-only completion marker - add the requested AI-assistance trailer Shubham Antil (3): nfc: nci: add a pre-unregister shutdown stage nfc: nfcmrvl: serialize firmware completion and teardown nfc: nfcmrvl: abort firmware work before unregistering drivers/nfc/nfcmrvl/fw_dnld.c | 231 ++++++++++++++++++++++++++++++------------ drivers/nfc/nfcmrvl/fw_dnld.h | 10 ++ drivers/nfc/nfcmrvl/main.c | 10 +- include/net/nfc/nci_core.h | 9 ++ net/nfc/nci/core.c | 31 ++++-- net/nfc/nci/rsp.c | 3 + 6 files changed, 222 insertions(+), 72 deletions(-) base-commit: 30c71476d842b094651bd7712f6c8ee8716147d0 -- 2.54.0