Skip to content

firmware: xilinx: Clean up firmware and EL3 state on kexec

Jay Buddhabhatti linux-arm-kernel lkml 5 versions – Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 1 replyApplied
  2. v33 patches 2 repliesSuperseded
  3. v2 posting 2/23 of 4 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/20 of 3 patches0 repliesSuperseded
v14 patches9 repliesSuperseded

Changes in v4 from the cover letter

- Modified platform check to restrict kexec cleanup to Versal and Versal Net platforms only
- Used EL3 firmware instead of TF-A in descriptions and comments

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3firmware: xilinx: Add support to clear EL3 PM statedrivers/firmware/xilinx/zynqmp.c include/linux/firmware/xlnx-zynqmp.h+51 -20 replies
2/3firmware: xilinx: Release all peripheral devices from firmwaredrivers/firmware/xilinx/zynqmp.c include/linux/firmware/xlnx-zynqmp.h+18 -10 replies
3/3firmware: xilinx: Clear firmware notifiers across kexec transitionsdrivers/firmware/xilinx/zynqmp.c include/linux/firmware/xlnx-zynqmp.h+17 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchRadhey Shyam PandeyPrasanna Kumar T S M
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

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

Read the v4 thread

Cover letter [PATCH v4 0/3] firmware: xilinx: Clean up firmware and EL3 state on kexec

During a kexec restart, only the kernel is reloaded while the state held in EL3 and platform firmware persists. This leaves the freshly booted kernel out of sync with secure firmware for things like the SGI number, shutdown scope, allocated peripheral devices and registered notifier callbacks, which can lead to unexpected behaviour after a kexec.

Introduce a mechanism to clear the stale EL3 and platform firmware state so the reloaded kernel starts from a clean baseline:

- Add TF_A_CLEAR_PM_STATE to clear EL3 PM subsystem state.
- Add PM_DEV_ALL_PERIPH to release all peripheral devices in one call.
- Add PM_ALL_NOTIFIERS to unregister all notifier callbacks in one call.

On a graceful kexec reboot the cleanup is performed from zynqmp_firmware_shutdown(); on a crash (kdump) restart it is performed from zynqmp_firmware_probe() of the reloaded kernel. Each cleanup step is guarded by a feature check so it degrades gracefully on firmware versions that do not implement the new APIs.

Changes in v4:
- Modified platform check to restrict kexec cleanup to Versal and Versal Net platforms only
- Used EL3 firmware instead of TF-A in descriptions and comments

Changes in v3:
- Corrected subject prefix

Changes in v2:
- Drop patch 4/4 (feature check improvements) from this series per review feedback. Those changes are sent separately as:
"[PATCH 1/2] firmware: xilinx: Use TF-A feature check for TF-A-specific APIs" and "[PATCH 2/2] firmware: xilinx: Propagate actual error from feature check"

Jay Buddhabhatti (3):
firmware: xilinx: Add support to clear EL3 PM state
firmware: xilinx: Release all peripheral devices from firmware
firmware: xilinx: Clear firmware notifiers across kexec transitions

 drivers/firmware/xilinx/zynqmp.c     | 86 +++++++++++++++++++++++++++-
 include/linux/firmware/xlnx-zynqmp.h | 10 +++-
 2 files changed, 94 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1