Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@kernel.org>
To: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: Cristian Marussi <cristian.marussi@arm.com>,
	 Sudeep Holla <sudeep.holla@kernel.org>,
	 Sudeep Holla <sudeep.holla@kernel.org>,
	Sashiko <sashiko-bot@kernel.org>
Subject: [PATCH 0/9] firmware: arm_scmi: Fix SCMI core cleanup paths
Date: Tue, 30 Jun 2026 10:05:56 +0100	[thread overview]
Message-ID: <20260630-scmi_core_fixes-v1-0-f932c1e51992@kernel.org> (raw)

This series fixes a set of SCMI core and mailbox transport lifetime issues
found around device creation, channel setup failure and teardown paths.
They were mostly found by Sashiko[1] when reviewing some other series.
Posting these separately as the issues or the fixes are not related to [2]

Here is the attempt to fix them, some of them can be dropped if it is too
theoretical. I have addressed all the issues that made sense to me at the
time of reading the report.

The fixes tighten ownership of OF node references, make transport devices
reachable by explicit teardown without exposing them to normal SCMI driver
binding, and ensure partially initialized channels are unwound consistently on
probe/setup failures. The series also fixes races around requested-device
notifier teardown and RCU-protected protocol lookups.

The mailbox transport fixes are split by the feature that introduced the
leaking channel: one for unidirectional mailbox channels and one for P2A
completion channels.

Summary:

- Fix OF node reference ownership for generated SCMI devices.
- Allow explicit teardown lookup of internal transport devices.
- Clean up TX/RX channels when SCMI channel setup fails midway.
- Fix SCMI device lifetime handling around child lookup and bus ID reuse.
- Free transport resources when IDR insertion fails after channel setup.
- Unregister requested-device notifier before active protocol IDR teardown.
- Unwind mailbox channels on TX receiver and P2A receiver setup failures.
- Protect requested-device protocol lookup with RCU.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

[1] https://sashiko.dev/#/patchset/20260525-acpi_scmi_pcc-v2-0-4f38938d08d8@arm.com
[2] https://patch.msgid.link/20260525-acpi_scmi_pcc-v2-0-4f38938d08d8@arm.com

---
Sudeep Holla (9):
      firmware: arm_scmi: Fix OF node reference handling
      firmware: arm_scmi: Fix transport device teardown lookup
      firmware: arm_scmi: Clean up channels on setup failure
      firmware: arm_scmi: Fix SCMI device destroy lifetimes
      firmware: arm_scmi: Free transport channel on IDR failure
      firmware: arm_scmi: Unregister device notifier before IDR teardown
      firmware: arm_scmi: Unwind TX receiver mailbox setup failure
      firmware: arm_scmi: Unwind P2A receiver mailbox setup failure
      firmware: arm_scmi: Protect device request lookup with RCU

 drivers/firmware/arm_scmi/bus.c                | 50 +++++++++++++++++---------
 drivers/firmware/arm_scmi/common.h             |  2 ++
 drivers/firmware/arm_scmi/driver.c             | 21 ++++++-----
 drivers/firmware/arm_scmi/transports/mailbox.c | 12 +++++--
 4 files changed, 57 insertions(+), 28 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260629-scmi_core_fixes-da3cd753b4ea


-- 
Regards,
Sudeep



             reply	other threads:[~2026-06-30  9:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  9:05 Sudeep Holla [this message]
2026-06-30  9:05 ` [PATCH 1/9] firmware: arm_scmi: Fix OF node reference handling Sudeep Holla
2026-06-30  9:05 ` [PATCH 2/9] firmware: arm_scmi: Fix transport device teardown lookup Sudeep Holla
2026-06-30  9:05 ` [PATCH 3/9] firmware: arm_scmi: Clean up channels on setup failure Sudeep Holla
2026-06-30  9:06 ` [PATCH 4/9] firmware: arm_scmi: Fix SCMI device destroy lifetimes Sudeep Holla
2026-06-30  9:06 ` [PATCH 5/9] firmware: arm_scmi: Free transport channel on IDR failure Sudeep Holla
2026-06-30  9:06 ` [PATCH 6/9] firmware: arm_scmi: Unregister device notifier before IDR teardown Sudeep Holla
2026-06-30  9:06 ` [PATCH 7/9] firmware: arm_scmi: Unwind TX receiver mailbox setup failure Sudeep Holla
2026-06-30  9:06 ` [PATCH 8/9] firmware: arm_scmi: Unwind P2A " Sudeep Holla
2026-06-30  9:06 ` [PATCH 9/9] firmware: arm_scmi: Protect device request lookup with RCU Sudeep Holla

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=20260630-scmi_core_fixes-v1-0-f932c1e51992@kernel.org \
    --to=sudeep.holla@kernel.org \
    --cc=arm-scmi@vger.kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=sashiko-bot@kernel.org \
    /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