]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
crypto: qat - add fatal error notification
authorMun Chun Yep <mun.chun.yep@intel.com>
Fri, 2 Feb 2024 10:53:21 +0000 (18:53 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Feb 2024 04:57:18 +0000 (12:57 +0800)
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.

Signed-off-by: Mun Chun Yep <mun.chun.yep@intel.com>
Reviewed-by: Ahsan Atta <ahsan.atta@intel.com>
Reviewed-by: Markas Rapoportas <markas.rapoportas@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/intel/qat/qat_common/adf_heartbeat.c
drivers/crypto/intel/qat/qat_common/adf_isr.c

index f88b1bc6857ee70d1399668c7d72c4c03faae117..fe8428d4ff392abbbe2477df173e4b03c84311b4 100644 (file)
@@ -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;
        }
 
index a13d9885d60f80f3c5f5bff816ee1284bfa3b2e8..020d213f4c991d7808b02aad86057733c135fff7 100644 (file)
@@ -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;
        }