Commit 55e8e46d authored by Mun Chun Yep's avatar Mun Chun Yep Committed by Aichun Shi
Browse files

crypto: qat - add fatal error notification

mainline inclusion
from mainline-v6.9-rc1
commit 2aaa1995a94a3187e52ddb9f127fa1307ee8ad00
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I9A5BW
CVE: N/A
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2aaa1995a94a3187e52ddb9f127fa1307ee8ad00



-------------------------------------

Notify a fatal error condition and optionally reset the device in
the following cases:
  * if the device reports an uncorrectable fatal error through an
    interrupt
  * if the heartbeat feature detects that the device is not
    responding

This patch is based on earlier work done by Shashank Gupta.

Intel-SIG: commit 2aaa1995a94a crypto: qat - add fatal error notification
Backport to support QAT in-tree driver

Signed-off-by: default avatarMun Chun Yep <mun.chun.yep@intel.com>
Reviewed-by: default avatarAhsan Atta <ahsan.atta@intel.com>
Reviewed-by: default avatarMarkas Rapoportas <markas.rapoportas@intel.com>
Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
[ Aichun Shi: amend commit log ]
Signed-off-by: default avatarAichun Shi <aichun.shi@intel.com>
parent efe75390
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -229,6 +229,9 @@ void adf_heartbeat_status(struct adf_accel_dev *accel_dev,
			"Heartbeat ERROR: QAT is not responding.\n");
		*hb_status = HB_DEV_UNRESPONSIVE;
		hb->hb_failed_counter++;
		if (adf_notify_fatal_error(accel_dev))
			dev_err(&GET_DEV(accel_dev),
				"Failed to notify fatal error\n");
		return;
	}

+6 −1
Original line number Diff line number Diff line
@@ -139,8 +139,13 @@ static bool adf_handle_ras_int(struct adf_accel_dev *accel_dev)

	if (ras_ops->handle_interrupt &&
	    ras_ops->handle_interrupt(accel_dev, &reset_required)) {
		if (reset_required)
		if (reset_required) {
			dev_err(&GET_DEV(accel_dev), "Fatal error, reset required\n");
			if (adf_notify_fatal_error(accel_dev))
				dev_err(&GET_DEV(accel_dev),
					"Failed to notify fatal error\n");
		}

		return true;
	}