Skip to content

firmware: arm_ffa: Fix cleanup, notification, and discovery paths

Sudeep Holla linux-arm-kernel lkml 2 versions – Applied

Status from this message: Applied to sudeep.holla/linux (for-next/ffa/fixes), thanks!

Get series with b4
b4 am [email protected] change-id 20260423-ffa_fixes-4ad33f0ee250

Versions newest first

  1. v2 Latest11 patches 1 replyApplied
  2. v18 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Addressed valid comments from sashiko
(https://sashiko.dev/#/patchset/[email protected])
- Added couple of new fixes based on the review
- Link to v1: https://patch.msgid.link/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/11firmware: arm_ffa: Check for NULL FF-A ID table while driver registrationdrivers/firmware/arm_ffa/bus.c+3 -10 replies
2/11firmware: arm_ffa: Skip free_pages on RX buffer alloc failuredrivers/firmware/arm_ffa/driver.c+1 -10 replies
3/11firmware: arm_ffa: Avoid collapsing NPI work from different CPUsdrivers/firmware/arm_ffa/driver.c+8 -50 replies
4/11firmware: arm_ffa: Fix per-vcpu self notifications handling in workqueuedrivers/firmware/arm_ffa/driver.c+1 -10 replies
5/11firmware: arm_ffa: Unregister bus notifier on teardown for FF-A v1.0drivers/firmware/arm_ffa/driver.c+15 -00 replies
6/11firmware: arm_ffa: Bound PARTITION_INFO_GET_REGS copiesdrivers/firmware/arm_ffa/driver.c+21 -20 replies
7/11firmware: arm_ffa: Keep framework RX release under lockdrivers/firmware/arm_ffa/driver.c+13 -160 replies
8/11firmware: arm_ffa: Validate framework notification message layoutdrivers/firmware/arm_ffa/driver.c+16 -20 replies
9/11firmware: arm_ffa: Align RxTx buffer size before mappingdrivers/firmware/arm_ffa/driver.c+2 -10 replies
10/11firmware: arm_ffa: Snapshot notifier callbacks under lockdrivers/firmware/arm_ffa/driver.c+23 -120 replies
11/11firmware: arm_ffa: Fix sched-recv callback partition lookupdrivers/firmware/arm_ffa/driver.c+3 -30 replies

Reviews trailers per patch

1 of 11 patches has a Reviewed-by or Acked-by.

PatchSebastian Ene
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11R-b
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/11] firmware: arm_ffa: Fix cleanup, notification, and discovery paths

Hi all,

This series fixes a set of issues in the FF-A driver around init cleanup, framework notification handling, v1.0 notifier lifetime, and partition discovery.

The fixes are all small and localized, but together they tighten a few important paths:

- fix the early init unwind path when RX buffer allocation fails
- align the stored RX/TX buffer size with the size actually mapped to firmware
- ensure the framework notification handler always releases the RX buffer correctly
- validate framework notification payload bounds before copying data out of the shared RX buffer
- fix the partition lookup used for sched-recv callback registration
- unregister the FF-A v1.0 bus notifier during teardown
- bound the register-based partition discovery copies against the caller buffer
- reject FF-A driver registration without an ID table
- fix per-vcpu drivers own notifications handling in workqueue
- make NPI per cpu work item to avoid collapsing already queued work

This is the outcome of the self-initiated review of the entire driver following the oversight of Sashiko’s review on one of the patches that was merged.

https://sashiko.dev/#/patchset/[email protected]

---
Changes in v2:
- Addressed valid comments from sashiko
(https://sashiko.dev/#/patchset/[email protected])
- Added couple of new fixes based on the review
- Link to v1: https://patch.msgid.link/[email protected]

---
Sudeep Holla (11):
firmware: arm_ffa: Check for NULL FF-A ID table while driver registration
firmware: arm_ffa: Skip free_pages on RX buffer alloc failure
firmware: arm_ffa: Avoid collapsing NPI work from different CPUs
firmware: arm_ffa: Fix per-vcpu self notifications handling in workqueue
firmware: arm_ffa: Unregister bus notifier on teardown for FF-A v1.0
firmware: arm_ffa: Bound PARTITION_INFO_GET_REGS copies
firmware: arm_ffa: Keep framework RX release under lock
firmware: arm_ffa: Validate framework notification message layout
firmware: arm_ffa: Align RxTx buffer size before mapping
firmware: arm_ffa: Snapshot notifier callbacks under lock
firmware: arm_ffa: Fix sched-recv callback partition lookup

 drivers/firmware/arm_ffa/bus.c    |   4 +-
 drivers/firmware/arm_ffa/driver.c | 138 +++++++++++++++++++++++++++-----------
 2 files changed, 102 insertions(+), 40 deletions(-)

---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260423-ffa_fixes-4ad33f0ee250

Signature · 2 lines
Regards,
Sudeep