Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Ahsan Atta <ahsan.atta@intel.com>
To: herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com,
	Ahsan Atta <ahsan.atta@intel.com>
Subject: [PATCH 0/6] crypto: qat - add sysfs PCI reset support for QAT devices
Date: Wed, 13 May 2026 17:16:53 +0200	[thread overview]
Message-ID: <cover.1778685152.git.ahsan.atta@intel.com> (raw)

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
-- 
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.


             reply	other threads:[~2026-05-13 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 15:16 Ahsan Atta [this message]
2026-05-13 15:16 ` [PATCH 1/6] crypto: qat - keep VFs enabled during reset Ahsan Atta
2026-05-13 15:16 ` [PATCH 2/6] crypto: qat - notify fatal error before AER reset preparation Ahsan Atta
2026-05-13 15:16 ` [PATCH 3/6] crypto: qat - centralize bus master enable Ahsan Atta
2026-05-13 15:16 ` [PATCH 4/6] crypto: qat - skip restart for down devices Ahsan Atta
2026-05-13 15:16 ` [PATCH 5/6] crypto: qat - factor out AER reset helpers Ahsan Atta
2026-05-13 15:16 ` [PATCH 6/6] crypto: qat - handle sysfs-triggered reset callbacks Ahsan Atta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1778685152.git.ahsan.atta@intel.com \
    --to=ahsan.atta@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=qat-linux@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox