Skip to content

crypto: qat - add sysfs PCI reset support for QAT devices

Ahsan Atta linux-crypto stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6crypto: qat - keep VFs enabled during resetdrivers/crypto/intel/qat/qat_common/adf_sriov.c+11 -10 replies
2/6crypto: qat - notify fatal error before AER reset preparationdrivers/crypto/intel/qat/qat_common/adf_aer.c+2 -20 replies
3/6crypto: qat - centralize bus master enabledrivers/crypto/intel/qat/qat_420xx/adf_drv.c drivers/crypto/intel/qat/qat_4xxx/adf_drv.c drivers/crypto/intel/qat/qat_6xxx/adf_drv.c +9 more+10 -150 replies
4/6crypto: qat - skip restart for down devicesdrivers/crypto/intel/qat/qat_common/adf_aer.c+8 -00 replies
5/6crypto: qat - factor out AER reset helpersdrivers/crypto/intel/qat/qat_common/adf_aer.c+53 -330 replies
6/6crypto: qat - handle sysfs-triggered reset callbacksdrivers/crypto/intel/qat/qat_common/adf_aer.c+12 -00 replies

Reviews trailers per patch

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

PatchGiovanni CabidduDamian MuszynskiAndy Shevchenko
1/6R-b R-b
2/6R-b R-b
3/6R-b R-b
4/6R-b
5/6R-b R-b
6/6R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/6] crypto: qat - add sysfs PCI reset support for QAT devices

A PCI reset triggered through sysfs (/sys/bus/pci/devices/.../reset) leaves QAT devices in an unusable state because the driver has never implemented the reset_prepare() and reset_done() callbacks. The reset proceeds without quiescing the device or restoring it afterward. This series adds the missing sysfs reset support and fixes the deadlocks, state-management issues, and corner cases that surface when the reset path is actually exercised.

Note on stable backport:
Since this support was entirely absent rather than broken by a specific commit, there is no individual Fixes tag that can be cited. We believe this series warrants inclusion in stable to allow users to perform standard PCI resets on QAT devices without rendering them non-functional. We will need to revisit/retest when doing the backport as the PCI core may have changed.

In summary:
Patch #1: Skip VF disable and enable during device restart when the VF topology is already present. This avoids lock-order issues in PCI reset callbacks while keeping VF quiesce notification intact.

Patch #2: Move fatal error notification earlier in the AER path. This ensures subsystems and VFs are informed as soon as fatal error handling begins.

Patch #3: Centralize PCI bus-master enable into a single init path. Remove scattered pci_set_master()/pci_clear_master() calls so BME state is deterministic across reset flows.

Patch #4: Skip the shutdown and restart flow for devices that were already administratively down before PCI reset. PCI state is still restored, but the device remains down as expected.

Patch #5: Factor the common AER shutdown and recovery sequences into reset_prepare() and reset_done() helpers to simplify the reset path and prepare it for reuse.

Patch #6: Hook reset_prepare() and reset_done() into the QAT PCI error handler. This makes sysfs-triggered PCI reset follow the same quiesce and recovery flow as AER reset.

Ahsan Atta (6):
crypto: qat - keep VFs enabled during reset
crypto: qat - notify fatal error before AER reset preparation
crypto: qat - centralize bus master enable
crypto: qat - skip restart for down devices
crypto: qat - factor out AER reset helpers
crypto: qat - handle sysfs-triggered reset callbacks

 drivers/crypto/intel/qat/qat_420xx/adf_drv.c  |   2 -
 drivers/crypto/intel/qat/qat_4xxx/adf_drv.c   |   2 -
 drivers/crypto/intel/qat/qat_6xxx/adf_drv.c   |   2 -
 drivers/crypto/intel/qat/qat_c3xxx/adf_drv.c  |   1 -
 .../crypto/intel/qat/qat_c3xxxvf/adf_drv.c    |   1 -
 drivers/crypto/intel/qat/qat_c62x/adf_drv.c   |   1 -
 drivers/crypto/intel/qat/qat_c62xvf/adf_drv.c |   1 -
 drivers/crypto/intel/qat/qat_common/adf_aer.c | 102 +++++++++++++-----
 .../intel/qat/qat_common/adf_common_drv.h     |   1 +
 .../crypto/intel/qat/qat_common/adf_init.c    |   2 +
 .../crypto/intel/qat/qat_common/adf_sriov.c   |  12 ++-
 .../crypto/intel/qat/qat_dh895xcc/adf_drv.c   |   1 -
 .../crypto/intel/qat/qat_dh895xccvf/adf_drv.c |   1 -
 13 files changed, 87 insertions(+), 42 deletions(-)

base-commit: 6a69430dcc874c47fe5a25b70d87861c1cc9c0d8

Signature · 13 lines
2.45.0

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.