[PATCH] drm/amdgpu: fix miss to create mca debugfs node issue

Zhou, Bob Bob.Zhou at amd.com
Thu Nov 30 06:22:04 UTC 2023


[AMD Official Use Only - General]

Reviewed-by: Bob Zhou <bob.zhou at amd.com>

Regards,
Bob

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Yang Wang
Sent: Thursday, November 30, 2023 1:09 PM
To: amd-gfx at lists.freedesktop.org
Cc: Lazar, Lijo <Lijo.Lazar at amd.com>; Wang, Yang(Kevin) <KevinYang.Wang at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: [PATCH] drm/amdgpu: fix miss to create mca debugfs node issue

Use amdgpu_ip_version() helper function to check ip version.

The ip verison contains other information, use the helper function to avoid reading wrong value.

Signed-off-by: Yang Wang <kevinyang.wang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c
index 54f2f346579e..210aea590a52 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c
@@ -485,7 +485,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(mca_debug_mode_fops, NULL, amdgpu_mca_smu_debug_mode_se  void amdgpu_mca_smu_debugfs_init(struct amdgpu_device *adev, struct dentry *root)  {  #if defined(CONFIG_DEBUG_FS)
-       if (!root || adev->ip_versions[MP1_HWIP][0] != IP_VERSION(13, 0, 6))
+       if (!root || amdgpu_ip_version(adev, MP1_HWIP, 0) != IP_VERSION(13, 0,
+6))
                return;

        debugfs_create_file("mca_debug_mode", 0200, root, adev, &mca_debug_mode_fops);
--
2.34.1



More information about the amd-gfx mailing list