Skip to content

Commit 2aaa199

Browse files
yepmunchunherbertx
authored andcommitted
crypto: qat - add fatal error notification
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>
1 parent 4469f9b commit 2aaa199

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/crypto/intel/qat/qat_common/adf_heartbeat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ void adf_heartbeat_status(struct adf_accel_dev *accel_dev,
229229
"Heartbeat ERROR: QAT is not responding.\n");
230230
*hb_status = HB_DEV_UNRESPONSIVE;
231231
hb->hb_failed_counter++;
232+
if (adf_notify_fatal_error(accel_dev))
233+
dev_err(&GET_DEV(accel_dev),
234+
"Failed to notify fatal error\n");
232235
return;
233236
}
234237

drivers/crypto/intel/qat/qat_common/adf_isr.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,13 @@ static bool adf_handle_ras_int(struct adf_accel_dev *accel_dev)
139139

140140
if (ras_ops->handle_interrupt &&
141141
ras_ops->handle_interrupt(accel_dev, &reset_required)) {
142-
if (reset_required)
142+
if (reset_required) {
143143
dev_err(&GET_DEV(accel_dev), "Fatal error, reset required\n");
144+
if (adf_notify_fatal_error(accel_dev))
145+
dev_err(&GET_DEV(accel_dev),
146+
"Failed to notify fatal error\n");
147+
}
148+
144149
return true;
145150
}
146151

0 commit comments

Comments
 (0)