Skip to content

platform/x86: dell: dcdbas: Fix SMI completion wait and buffer handling

Rosen Penev platform-driver-x86 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 4 repliesIn review
  2. v24 patches 1 replySuperseded
  3. v15 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- Patch 1: use readx_poll_timeout_atomic() instead of read_poll_timeout_atomic().
- v2: https://lore.kernel.org/platform-driver-x86/[email protected]/

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4platform/x86: dell: dcdbas: Actually wait for the host control SMIdrivers/platform/x86/dell/dcdbas.c drivers/platform/x86/dell/dcdbas.h+12 -151 reply
2/4platform/x86: dell: dcdbas: Suppress bind attributes of the platform driverdrivers/platform/x86/dell/dcdbas.c+1 -01 reply
3/4platform/x86: dell: dcdbas: Release the SMI buffer in removedrivers/platform/x86/dell/dcdbas.c+26 -181 reply
4/4platform/x86: dell: dcdbas: Validate the WSMT buffer descriptiondrivers/platform/x86/dell/dcdbas.c+9 -01 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchAndy Shevchenko
1/4R-b
2/4R-b
3/4
4/4R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/4] platform/x86: dell: dcdbas: Fix SMI completion wait and buffer handling

Fixes for dcdbas.

Patch 1 fixes the host control SMI wait for types 2 and 3, which the compiler removed entirely because the status was a plain memory read, and converts the type 1 wait along with it. Patches 2 and 3 fix the SMI buffer lifetime on unbind and module removal. Patch 4 hardens the validation of the firmware-provided WSMT buffer description.

These patches were developed with the help of an AI coding assistant (Claude Opus 5.5): it reviewed the drivers, found the issues and drafted the fixes and changelogs. I reviewed every change and I am responsible for them.

All patches build cleanly with W=1.

Tested on a Dell Precision M4800 running v7.2.15, using the equivalent backports built as out-of-tree modules:
the driver probes, and growing smi_data_buf_size and then unloading and reloading dcdbas with dell-smbios on top is clean, with the buffer freed on remove. The host control SMI (only used at power-off) and the WSMT paths were not exercised.

Changes in v3:
- Patch 1: use readx_poll_timeout_atomic() instead of read_poll_timeout_atomic().
- v2: https://lore.kernel.org/platform-driver-x86/[email protected]/

Changes in v2:
- Squash the type 1 read_poll_timeout_atomic() conversion (v1 patch 5) into patch 1, so both waits in host_control_smi() change at once.
- Patch 1: include iopoll.h instead of io.h, and return the error from read_poll_timeout_atomic() (-ETIMEDOUT) instead of -ETIME.
- Patch 2: add a Fixes tag.
- Patch 3: make the dcdbas_release_buffer() comment a plain comment instead of malformed kernel-doc.
- Patch 4: the problems were found by code reading, so drop the Fixes
tags and describe the patch as hardening; reject remap_size < 8
instead of <= 8, as an 8 byte mapping just gives an empty buffer.
- v1: https://lore.kernel.org/platform-driver-x86/[email protected]/

Rosen Penev (4):
platform/x86: dell: dcdbas: Actually wait for the host control SMI platform/x86: dell: dcdbas: Suppress bind attributes of the platform
driver
platform/x86: dell: dcdbas: Release the SMI buffer in remove platform/x86: dell: dcdbas: Validate the WSMT buffer description

 drivers/platform/x86/dell/dcdbas.c | 80 ++++++++++++++++++------------
 drivers/platform/x86/dell/dcdbas.h |  1 -
 2 files changed, 48 insertions(+), 33 deletions(-)

base-commit: 2800868f63227c8237d70c41e70d441c919620d6

Signature · 1 line
2.56.1