From: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
To: andre.przywara@arm.com
Cc: mark.rutland@arm.com, lpieralisi@kernel.org,
sudeep.holla@kernel.org, salman.nabi@arm.com,
vvidwans@nvidia.com, nirmoyd@nvidia.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
Subject: [PATCH 3/4] firmware: smccc: lfa: Fix probe and notification rollback
Date: Thu, 3 Dec 2026 09:38:16 +0800 [thread overview]
Message-ID: <20261203013817.1215179-4-jiangtianfeng@linux.alibaba.com> (raw)
In-Reply-To: <20261203013817.1215179-1-jiangtianfeng@linux.alibaba.com>
A successful ACPI or DT notification registration returns zero, so the
existing err != -ENODEV condition tears down the kset and workqueue
before returning success. Only enter teardown for real errors.
Also clean partially created child kobjects on inventory failure and
unregister notification resources before rolling back workqueue state.
Link: https://lore.kernel.org/all/c9f66683-7902-4b5c-9f76-c55b1894ce9c@nvidia.com/
Link: https://lore.kernel.org/all/705b63c3-297a-4bf8-9eb2-b826e280e7da@nvidia.com/
Signed-off-by: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
---
drivers/firmware/smccc/lfa_fw.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/smccc/lfa_fw.c b/drivers/firmware/smccc/lfa_fw.c
index 1864176f3410..0a3bbf76e5f7 100644
--- a/drivers/firmware/smccc/lfa_fw.c
+++ b/drivers/firmware/smccc/lfa_fw.c
@@ -996,6 +996,8 @@ static int lfa_smccc_probe(struct arm_smccc_device *sdev)
err = update_fw_components_tree();
if (err != 0) {
+ flush_workqueue(fw_comps_update_wq);
+ clean_fw_components_tree();
kset_unregister(lfa_kset);
destroy_workqueue(fw_comps_update_wq);
return err;
@@ -1015,7 +1017,13 @@ static int lfa_smccc_probe(struct arm_smccc_device *sdev)
* An ACPI notification or an interrupt are optional, but we must
* handle errors that occurred during their setup.
*/
- if (err != -ENODEV) {
+ if (err && err != -ENODEV) {
+ if (!acpi_disabled)
+ lfa_remove_acpi(&sdev->dev);
+ if (lfa_irq)
+ devm_free_irq(&sdev->dev, lfa_irq, NULL);
+ flush_workqueue(fw_comps_update_wq);
+ clean_fw_components_tree();
kset_unregister(lfa_kset);
destroy_workqueue(fw_comps_update_wq);
return err;
--
2.47.3
next prev parent reply other threads:[~2026-12-03 1:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 16:54 [PATCH v5 RESEND 0/6] Arm Live Firmware Activation (LFA) support Andre Przywara
2026-11-02 16:54 ` [PATCH v5 RESEND 1/6] dt-bindings: arm: Add Live Firmware Activation Andre Przywara
2026-11-02 16:54 ` [PATCH v5 RESEND 2/6] firmware: smccc: Add support for Live Firmware Activation (LFA) Andre Przywara
2026-11-04 22:50 ` Vedashree Vidwans
2026-11-02 16:54 ` [PATCH v5 RESEND 3/6] firmware: smccc: lfa: Register ACPI notification Andre Przywara
2026-11-04 20:03 ` Nirmoy Das
2026-11-04 23:02 ` Vedashree Vidwans
2026-11-02 16:54 ` [PATCH v5 RESEND 4/6] firmware: smccc: lfa: Add auto_activate sysfs file Andre Przywara
2026-11-02 16:54 ` [PATCH v5 RESEND 5/6] firmware: smccc: lfa: Register DT interrupt Andre Przywara
2026-11-03 4:20 ` kernel test robot
2026-11-03 7:50 ` kernel test robot
2026-11-03 9:25 ` kernel test robot
2026-11-02 16:54 ` [PATCH v5 RESEND 6/6] firmware: smccc: lfa: add sysfs ABI documentation Andre Przywara
2026-11-05 9:17 ` [PATCH v5 RESEND 0/6] Arm Live Firmware Activation (LFA) support Nirmoy Das
2026-12-03 1:38 ` [PATCH 0/4] firmware: smccc: lfa: Fix deterministic v5 issues Jiangtian Feng
2026-12-03 1:38 ` [PATCH 1/4] firmware: smccc: lfa: Stop PRIME retry after completion Jiangtian Feng
2026-12-03 5:56 ` [PATCH] firmware: smccc: lfa: Cancel PRIME after a partial failure Jiangtian Feng
2026-12-03 1:38 ` [PATCH 2/4] firmware: smccc: lfa: Drop nested CPU hotplug read lock Jiangtian Feng
2026-12-03 1:38 ` Jiangtian Feng [this message]
2026-12-03 1:38 ` [PATCH 4/4] firmware: smccc: lfa: Close DT IRQ mapping lifetime Jiangtian Feng
2026-12-03 9:34 ` [RFC] firmware: smccc: lfa: Inventory and notification failure recovery Jiangtian Feng
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=20261203013817.1215179-4-jiangtianfeng@linux.alibaba.com \
--to=jiangtianfeng@linux.alibaba.com \
--cc=andre.przywara@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=nirmoyd@nvidia.com \
--cc=salman.nabi@arm.com \
--cc=sudeep.holla@kernel.org \
--cc=vvidwans@nvidia.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®