Skip to contentSkip to conversation

drm/amd/ras: add supported aca blocks mapping

PATCH New Alex Deucher 1 participant 4 messages Aug 21

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/4 drm/amd/ras: add supported aca blocks mapping

From: "Stanley.Yang" <[email protected]>

Add dacee_be, ucie_pcs, lsdma aca blocks mapping,
add pcs_xgmi aca block info.

---
 drivers/gpu/drm/amd/ras/core/aca.h          |  3 ++
 drivers/gpu/drm/amd/ras/core/ras_aca_v5_0.c | 54 +++++++++++++++++++++
 2 files changed, 57 insertions(+)
drivers/gpu/drm/amd/ras/core/aca.h +3 -0
index 759119bed870c..e428bf53f3ea8 100644
@@ -71,6 +71,9 @@ enum aca_ecc_hwip {
 	ACA_ECC_HWIP__MMHUB,
 	ACA_ECC_HWIP__MPIFOE,
 	ACA_ECC_HWIP__PCIE_PL,
+	ACA_ECC_HWIP__DACC_BE,
+	ACA_ECC_HWIP__UCIE_PCS,
+	ACA_ECC_HWIP__LSDMA,
 	ACA_ECC_HWIP_COUNT,
 };
 
drivers/gpu/drm/amd/ras/core/ras_aca_v5_0.c +54 -0

78 lines not on this page · raw message

Signature · 1 line
2.55.0
author maintainer
#1 lore raw

PATCH 2/4 drm/amdgpu: Add psp interrupt handling

From: Lijo Lazar <[email protected]>

Add interrupt manager for handling psp interrupts and callbacks to enable/disable psp interrupts.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h  |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c |  18 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h |   8 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 132 +++++++++++++++++++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h |  43 ++++++++
 5 files changed, 198 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +1 -0
index 444437c300886..11f834c97d937 100644
@@ -29,6 +29,7 @@
 
 #define IH_RING_SIZE	(256 * 1024)
 #define IH_SW_RING_SIZE	(16 * 1024)	/* enough for 512 CAM entries */
+#define IH_PSP_RING_SIZE (SZ_4K)
 
 struct amdgpu_device;
 struct amdgpu_iv_entry;
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +18 -0
index 95cceed4e971a..91f1ca95ea543 100644
@@ -257,6 +257,14 @@ static void amdgpu_irq_handle_ih_soft(struct work_struct *work)
 	amdgpu_ih_process(adev, &adev->irq.ih_soft);
 }
 
+static void amdgpu_irq_handle_ih_psp(struct work_struct *work)
+{
+	struct amdgpu_device *adev = container_of(work, struct amdgpu_device,
+						  irq.ih_psp_work);
+
+	amdgpu_ih_process(adev, &adev->irq.ih_psp);
+}
+
 /**
  * amdgpu_msi_ok - check whether MSI functionality is enabled
  *
@@ -332,6 +340,7 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
 	INIT_WORK(&adev->irq.ih1_work, amdgpu_irq_handle_ih1);
 	INIT_WORK(&adev->irq.ih2_work, amdgpu_irq_handle_ih2);
 	INIT_WORK(&adev->irq.ih_soft_work, amdgpu_irq_handle_ih_soft);
+	INIT_WORK(&adev->irq.ih_psp_work, amdgpu_irq_handle_ih_psp);
 
 	/* Use vector 0 for MSI-X. */
 	r = pci_irq_vector(adev->pdev, 0);
@@ -370,6 +379,7 @@ void amdgpu_irq_fini_hw(struct amdgpu_device *adev)
 	}
 
 	amdgpu_ih_ring_fini(adev, &adev->irq.ih_soft);
+	amdgpu_ih_ring_fini(adev, &adev->irq.ih_psp);
 	amdgpu_ih_ring_fini(adev, &adev->irq.ih);
 	amdgpu_ih_ring_fini(adev, &adev->irq.ih1);
 	amdgpu_ih_ring_fini(adev, &adev->irq.ih2);
@@ -548,6 +558,14 @@ void amdgpu_irq_delegate(struct amdgpu_device *adev,
 	queue_work(system_dfl_wq, &adev->irq.ih_soft_work);
 }
 
+void amdgpu_irq_psp_delegate(struct amdgpu_device *adev,
+			     struct amdgpu_iv_entry *entry,
+			     unsigned int num_dw)
+{
+	amdgpu_ih_ring_write(adev, &adev->irq.ih_psp, entry->iv_entry, num_dw);
+	schedule_work(&adev->irq.ih_psp_work);
+}
+
 /**
  * amdgpu_irq_update - update hardware interrupt state
  *
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.h +6 -2
index af72405a72262..deee64b69885d 100644
@@ -90,9 +90,10 @@ struct amdgpu_irq {
 	bool				msi_enabled; /* msi enabled */
 
 	/* interrupt rings */
-	struct amdgpu_ih_ring		ih, ih1, ih2, ih_soft;
+	struct amdgpu_ih_ring		ih, ih1, ih2, ih_soft, ih_psp;
 	const struct amdgpu_ih_funcs    *ih_funcs;
-	struct work_struct		ih1_work, ih2_work, ih_soft_work;
+	struct work_struct		ih1_work, ih2_work, ih_soft_work,
+					ih_psp_work;
 	struct amdgpu_irq_src		self_irq;
 
 	/* gen irq stuff */
@@ -134,6 +135,9 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
 void amdgpu_irq_delegate(struct amdgpu_device *adev,
 			 struct amdgpu_iv_entry *entry,
 			 unsigned int num_dw);
+void amdgpu_irq_psp_delegate(struct amdgpu_device *adev,
+			     struct amdgpu_iv_entry *entry,
+			     unsigned int num_dw);
 int amdgpu_irq_update(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
 		      unsigned type);
 int amdgpu_irq_get(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +130 -2

174 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +43 -0

71 lines not on this page · raw message

Signature · 1 line
2.55.0
author maintainer
#2 lore raw

PATCH 3/4 drm/amdgpu: Add PSP v15.0.8 interrupt handler

In reply to Alex Deucher

From: Lijo Lazar <[email protected]>

Register and add interrupt handler in PSP v15.0.8.

---
 drivers/gpu/drm/amd/amdgpu/ih_v7_0.c     | 13 +++-
 drivers/gpu/drm/amd/amdgpu/psp_v15_0_8.c | 90 ++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +12 -1
index b51dacf9e1266..6265ee4b0ff1e 100644
@@ -420,6 +420,9 @@ static int ih_v7_0_irq_init(struct amdgpu_device *adev)
 	if (adev->irq.ih_soft.ring_size)
 		adev->irq.ih_soft.enabled = true;
 
+	if (adev->irq.ih_psp.ring_size)
+		adev->irq.ih_psp.enabled = true;
+
 	return 0;
 }
 
@@ -627,6 +630,10 @@ static int ih_v7_0_sw_init(struct amdgpu_ip_block *ip_block)
 	if (r)
 		return r;
 
+	r = amdgpu_ih_ring_init(adev, &adev->irq.ih_psp, IH_PSP_RING_SIZE, true);
+	if (r)
+		return r;
+
 	r = amdgpu_irq_init(adev);
 
 	return r;
@@ -655,7 +662,11 @@ static int ih_v7_0_hw_init(struct amdgpu_ip_block *ip_block)
 
 static int ih_v7_0_hw_fini(struct amdgpu_ip_block *ip_block)
 {
-	ih_v7_0_irq_disable(ip_block->adev);
+	struct amdgpu_device *adev = ip_block->adev;
+
+	ih_v7_0_irq_disable(adev);
+
+	cancel_work_sync(&adev->irq.ih_psp_work);
 
 	return 0;
 }
drivers/gpu/drm/amd/amdgpu/psp_v15_0_8.c +90 -0

102 lines not on this page · raw message

Signature · 1 line
2.55.0
author maintainer
#3 lore raw

PATCH 4/4 drm/amdgpu: enable RAS on psp v15_0_8

In reply to Alex Deucher

From: Candice Li <[email protected]>

Enable psp v15_0_8 RAS support.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -0
index 4b19db024a049..3f3aa44921ab7 100644
@@ -3329,6 +3329,7 @@ static bool amdgpu_ras_asic_supported(struct amdgpu_device *adev)
 		case IP_VERSION(13, 0, 14):
 		case IP_VERSION(13, 0, 15):
 		case IP_VERSION(14, 0, 3):
+		case IP_VERSION(15, 0, 8):
 			return true;
 		default:
 			return false;
Signature · 1 line
2.55.0