* [PATCH net-next v5 0/6] pds_core: Add PLDM firmware update and host backed memory support
@ 2026-06-15 21:49 Nikhil P. Rao
0 siblings, 0 replies; only message in thread
From: Nikhil P. Rao @ 2026-06-15 21:49 UTC (permalink / raw)
To: netdev
Cc: kuba, brett.creeley, eric.joyner, andrew+netdev, davem, edumazet,
pabeni, jacob.e.keller, Nikhil P. Rao
This series adds PLDM-based firmware update support to the pds_core
driver. PLDM (Platform Level Data Model) is a DMTF standard for firmware
management that provides a vendor-neutral interface for firmware updates.
The implementation uses the kernel's pldmfw library for package parsing
and component matching. Users can update entire firmware packages or
individual components via devlink flash. Component information is
displayed via devlink info, showing firmware versions and update status
for each component.
The series also adds host backed memory support, allowing firmware to
request memory pages from the host for its operations.
Changes since v4 (sashiko review, Simon Horman):
- Invalidate cached component info in recovery path to ensure stale
versions are not reported after firmware changes
- Fix v1 error handling: propagate errors from pdsc_dl_fw_list_info_get()
instead of masking them
- Fix v2 error handling: fall back to dev_info.fw_version only when
pdsc_get_component_info() fails; propagate devlink errors so partial
replies are discarded
- Clean up max_fw_slots comment to clarify it contains component count
Changes since v3:
- Changed "fw.mainfw" to just "fw" for main firmware (Jakub Kicinski).
Gold slot main firmware is reported as "fw.gold".
- Removed redundant memset before alloc_pages (Paolo Abeni)
- Changed dev_err to dev_warn for alloc_pages failure (Paolo Abeni)
- Only report dev_info.fw_version for identity version 1 (version 2+
reports firmware via PLDM component info)
- Fixed checkpatch alignment issue by extracting pdsc_dl_info_get_v1()
helper function
Changes since v2:
- Use driver-defined component names instead of passing through firmware
names (Jakub Kicinski). Added component_type enum that firmware populates,
driver maps to stable names like fw.mainfw, fw.goldfw, fw.bootloader.
Added documentation of firmware version names to pds_core.rst.
- Fixed bugs identified by sashiko:
Patch 2 (identity version 2):
- Fix comment using wrong macro names (IDENTIFY vs IDENTITY)
Patch 3 (PLDM firmware update):
- DMA-after-free on EAGAIN/ETIMEDOUT: when a command times out or
returns busy, firmware may still be accessing the DMA buffer; defer
freeing until a subsequent command succeeds
- Use dev_warn_once for incompatible firmware version (ver==0)
- Clear component cache after flash to show updated versions
Patch 4 (component info):
- Fix min_t(u8) truncation of max_fw_slots (u16) to min_t(u16)
- Fix F_FIXED early return skipping F_RUNNING flag check
- Don't fail devlink info if component query fails; use dev_warn_once
and continue to report generic fields (fw, asic.id, serial_number)
Patch 5 (host backed memory):
- Switch from adminq to devcmd; fixes both workqueue self-deadlock
during recovery (adminq completion runs on same wq as health_thread)
and health_work re-queued after cancel (adminq timeout re-queues work)
- Remove MEM_DEL from teardown path; fixes both MEM_DEL sent twice
for same tag and num_host_mem_reqs ambiguous semantics (now only
tracks pages to free). pci_clear_master guarantees DMA quiescence.
- Fix PDSC_HOST_MEM_MAX_CONTIG to 4MB constant (was arch-dependent)
- Not fixed: pdsc_host_mem_add() failure ignored; partial host memory
is acceptable and firmware handles fewer regions than requested
Patch 6 (debugfs):
- Move pdsc_debugfs_del_host_mem() before pdsc_host_mem_free() to
fix use-after-free race with debugfs readers
- Use %u for unsigned types and %pad for dma_addr_t
- Remove "file exists" check (now dead code since teardown removes file)
Note: The following fix was submitted separately via net:
- DMA in flight during teardown (call pci_clear_master before freeing
host memory):
https://lore.kernel.org/all/20260604213637.3844317-1-nikhil.rao@amd.com/
Changes since v1:
- Removed redefinition of __counted_by kernel primitive (Jakub Kicinski)
- Fixed kdoc warnings in pds_core_if.h
- Fixed checkpatch warnings
- Fixed bugs identified by sashiko:
Patch 2 (identity version 2):
- Zero data region before firmware commands
- Suppress expected error message during identify probe
Patch 3 (PLDM firmware update):
- Memory leak in pdsc_send_component_image() error path
- Memory leak in pdsc_flash_component() error path
- Missing devcmd_lock in pdsc_devcmd_finalize_update()
- Fixed dma_mapping_error() return value handling (returns boolean, not error code)
- Skip logic for components with index > 255
Patch 4 (component info):
- Added generic fw version display for all identity versions
- Handle components with both RUNNING and STARTUP flags
Patch 5 (host backed memory):
- Race between pdsc_remove and health thread (use-after-free)
- Set missing index field in MEM_QUERY command
- Host memory allocation size and zeroing
- Don't free host memory on MEM_ADD timeout (firmware may still be using it)
Patch 6 (debugfs):
- Fix dentry reference leak in debugfs_lookup (missing dput)
- Improvements:
- Cache component info to avoid repeated firmware queries (patch 4)
Note: The following fix for an existing bug was submitted separately
via net:
- Timeout error overwritten with stale status:
https://lore.kernel.org/netdev/20260515212907.998028-1-nikhil.rao@amd.com/
Link to v4: https://lore.kernel.org/netdev/20260614-upstream_v4-v4-0-f1c5765d90c2@amd.com/
Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
Brett Creeley (4):
pds_core: add support for quiet devcmd failures
pds_core: add support for identity version 2
pds_core: add PLDM firmware update support via devlink flash
pds_core: add PLDM component info display
Vamsi Atluri (2):
pds_core: add host backed memory support for firmware
pds_core: add debugfs support for host backed memory
.../device_drivers/ethernet/amd/pds_core.rst | 84 ++
drivers/net/ethernet/amd/Kconfig | 1 +
drivers/net/ethernet/amd/pds_core/core.c | 164 ++++
drivers/net/ethernet/amd/pds_core/core.h | 52 +-
drivers/net/ethernet/amd/pds_core/debugfs.c | 45 +
drivers/net/ethernet/amd/pds_core/dev.c | 136 ++-
drivers/net/ethernet/amd/pds_core/devlink.c | 137 ++-
drivers/net/ethernet/amd/pds_core/fw.c | 780 +++++++++++++++++-
drivers/net/ethernet/amd/pds_core/main.c | 11 +-
include/linux/pds/pds_core_if.h | 470 +++++++++++
10 files changed, 1857 insertions(+), 23 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-15 21:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 21:49 [PATCH net-next v5 0/6] pds_core: Add PLDM firmware update and host backed memory support Nikhil P. Rao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox