drm/amdgpu/gmc10: print client id string for gfxhub
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Sep 2020 21:49:47 +0000 (17:49 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Sep 2020 18:48:27 +0000 (14:48 -0400)
Print the name of the client rather than the number.  This
makes it easier to debug what block is causing the fault.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c

index 76acd7f7723e116caa2f332cb95ca55fa27b7c82..b882ac59879a0bfe5ebae0e0893a4c2421abfab7 100644 (file)
 
 #include "soc15_common.h"
 
+static const char *gfxhub_client_ids[] = {
+       "CB/DB",
+       "Reserved",
+       "GE1",
+       "GE2",
+       "CPF",
+       "CPC",
+       "CPG",
+       "RLC",
+       "TCP",
+       "SQC (inst)",
+       "SQC (data)",
+       "SQG",
+       "Reserved",
+       "SDMA0",
+       "SDMA1",
+       "GCR",
+       "SDMA2",
+       "SDMA3",
+};
+
 static uint32_t gfxhub_v2_0_get_invalidate_req(unsigned int vmid,
                                               uint32_t flush_type)
 {
@@ -55,12 +76,15 @@ static void
 gfxhub_v2_0_print_l2_protection_fault_status(struct amdgpu_device *adev,
                                             uint32_t status)
 {
+       u32 cid = REG_GET_FIELD(status,
+                               GCVM_L2_PROTECTION_FAULT_STATUS, CID);
+
        dev_err(adev->dev,
                "GCVM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
                status);
-       dev_err(adev->dev, "\t Faulty UTCL2 client ID: 0x%lx\n",
-               REG_GET_FIELD(status,
-               GCVM_L2_PROTECTION_FAULT_STATUS, CID));
+       dev_err(adev->dev, "\t Faulty UTCL2 client ID: %s (0x%x)\n",
+               cid >= ARRAY_SIZE(gfxhub_client_ids) ? "unknown" : gfxhub_client_ids[cid],
+               cid);
        dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n",
                REG_GET_FIELD(status,
                GCVM_L2_PROTECTION_FAULT_STATUS, MORE_FAULTS));
index 80c906a0383f905aaca7d3ef479f231da4ba62fa..237a9ff5afa0b23f745279d38c5eeed62c2042fd 100644 (file)
 
 #include "soc15_common.h"
 
+static const char *gfxhub_client_ids[] = {
+       "CB/DB",
+       "Reserved",
+       "GE1",
+       "GE2",
+       "CPF",
+       "CPC",
+       "CPG",
+       "RLC",
+       "TCP",
+       "SQC (inst)",
+       "SQC (data)",
+       "SQG",
+       "Reserved",
+       "SDMA0",
+       "SDMA1",
+       "GCR",
+       "SDMA2",
+       "SDMA3",
+};
+
 static uint32_t gfxhub_v2_1_get_invalidate_req(unsigned int vmid,
                                               uint32_t flush_type)
 {
@@ -55,12 +76,15 @@ static void
 gfxhub_v2_1_print_l2_protection_fault_status(struct amdgpu_device *adev,
                                             uint32_t status)
 {
+       u32 cid = REG_GET_FIELD(status,
+                               GCVM_L2_PROTECTION_FAULT_STATUS, CID);
+
        dev_err(adev->dev,
                "GCVM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
                status);
-       dev_err(adev->dev, "\t Faulty UTCL2 client ID: 0x%lx\n",
-               REG_GET_FIELD(status,
-               GCVM_L2_PROTECTION_FAULT_STATUS, CID));
+       dev_err(adev->dev, "\t Faulty UTCL2 client ID: %s (0x%x)\n",
+               cid >= ARRAY_SIZE(gfxhub_client_ids) ? "unknown" : gfxhub_client_ids[cid],
+               cid);
        dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n",
                REG_GET_FIELD(status,
                GCVM_L2_PROTECTION_FAULT_STATUS, MORE_FAULTS));