[2/2] qedf: use devlink to report errors and recovery

Message ID 20210331164917.24662-3-jhasan@marvell.com
State New
Headers show
Series
  • Enable devlink support
Related show

Commit Message

Javed Hasan March 31, 2021, 4:49 p.m.
Use devlink_health_report to push error indications.
We implement this in qede via callback function to make it possible
to reuse the same for other drivers sitting on top of qed in future.
Also, remove forcible recovery trigger and put it as a normal devlink
callback in qed module.

This allows user to enable/disable it via

    devlink health set pci/xxxx:xx:xx.x reporter fw_fatal auto_recover false
---
 drivers/scsi/qedf/qedf_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 6b6c3fd97798..ad125b0ff1de 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -3859,8 +3859,9 @@  void qedf_schedule_hw_err_handler(void *dev, enum qed_hw_err_type err_type)
 		/* Prevent HW attentions from being reasserted */
 		qed_ops->common->attn_clr_enable(qedf->cdev, true);
 
-		if (qedf_enable_recovery)
-			qed_ops->common->recovery_process(qedf->cdev);
+		if (qedf_enable_recovery && qedf->devlink)
+			qed_ops->common->report_fatal_error(qedf->devlink,
+				err_type);
 
 		break;
 	default: