Skip to contentSkip to conversation

drm/amdgpu: add RAS fatal error handler for NBIO v7.9

PATCH In review Tao Zhou 2 participants 2 messages Aug 7, 2023

Subsystems (2)
lore
Share & tools
lore

Tao Zhou

author
#0 lore raw

PATCH 1/1 drm/amdgpu: add RAS fatal error handler for NBIO v7.9

Register RAS fatal error interrupt and add handler.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c |   4 +
 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c  | 219 ++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.h  |   1 +
 3 files changed, 224 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 -0
index 832fa646b38f..bef0f9264b4f 100644
@@ -35,6 +35,7 @@
 #include "amdgpu_xgmi.h"
 #include "ivsrcid/nbio/irqsrcs_nbif_7_4.h"
 #include "nbio_v4_3.h"
+#include "nbio_v7_9.h"
 #include "atom.h"
 #include "amdgpu_reset.h"
 
@@ -2663,6 +2664,9 @@ int amdgpu_ras_init(struct amdgpu_device *adev)
 			 * check DF RAS */
 			adev->nbio.ras = &nbio_v4_3_ras;
 		break;
+	case IP_VERSION(7, 9, 0):
+		adev->nbio.ras = &nbio_v7_9_ras;
+		break;
 	default:
 		/* nbio ras is not available */
 		break;
drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c +219 -0

222 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/nbio_v7_9.h +1 -0
index 8e04eb484328..73709771950d 100644
@@ -28,5 +28,6 @@
 
 extern const struct nbio_hdp_flush_reg nbio_v7_9_hdp_flush_reg;
 extern const struct amdgpu_nbio_funcs nbio_v7_9_funcs;
+extern struct amdgpu_nbio_ras nbio_v7_9_ras;
 
 #endif
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

+static int nbio_v7_9_set_ras_err_event_athub_irq_state(struct amdgpu_device *adev, +static int nbio_v7_9_set_ras_controller_irq_state(struct amdgpu_device *adev,

both functions could be left as dummy ones since by default it is vector #1 selected in bare-metal environment. Only SRIOV PF driver needs to select vector #4.

Others look good to me. The patch is

Regards,
Hawking

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, August 7, 2023 11:06
To: [email protected]; Yang, Stanley <[email protected]>; Zhang, Hawking <[email protected]>; Li, Candice <[email protected]>; Chai, Thomas <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH] drm/amdgpu: add RAS fatal error handler for NBIO v7.9

Register RAS fatal error interrupt and add handler.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c |   4 +
 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c  | 219 ++++++++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.h  |   1 +
 3 files changed, 224 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 -0
index 832fa646b38f..bef0f9264b4f 100644
@@ -35,6 +35,7 @@
 #include "amdgpu_xgmi.h"
 #include "ivsrcid/nbio/irqsrcs_nbif_7_4.h"
 #include "nbio_v4_3.h"
+#include "nbio_v7_9.h"
 #include "atom.h"
 #include "amdgpu_reset.h"
 
@@ -2663,6 +2664,9 @@ int amdgpu_ras_init(struct amdgpu_device *adev)
                         * check DF RAS */
                        adev->nbio.ras = &nbio_v4_3_ras;
                break;
+       case IP_VERSION(7, 9, 0):
+               adev->nbio.ras = &nbio_v7_9_ras;
+               break;
        default:
                /* nbio ras is not available */
                break;
drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c +220 -0

222 lines not on this page · raw message

+};

drivers/gpu/drm/amd/amdgpu/nbio_v7_9.h +1 -1
index 8e04eb484328..73709771950d 100644
@@ -28,5 +28,6 @@
 
 extern const struct nbio_hdp_flush_reg nbio_v7_9_hdp_flush_reg;  extern const struct amdgpu_nbio_funcs nbio_v7_9_funcs;
+extern struct amdgpu_nbio_ras nbio_v7_9_ras;
 
 #endif
--

2.35.1