Skip to contentSkip to conversation

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

PATCH In review Yang Wang 3 participants 4 messages Nov 30, 2023

Subsystems (2)
lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c +1 -1
index 54f2f346579e..210aea590a52 100644
@@ -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);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Yang Wang

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.

May refine the subject to "Fix missing mca debugfs node"

Thanks,
Lijo

Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c +1 -1
index 54f2f346579e..210aea590a52 100644
@@ -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);
author Reviewed-by Lijo Lazar
#2 lore raw

[AMD Official Use Only - General]

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Thursday, November 30, 2023 1:13 PM
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix miss to create mca debugfs node issue

Quoted 6 lines · Yang Wang

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.

May refine the subject to "Fix missing mca debugfs node"

[kevin]:
Thanks, will change it before submitting.

Best Regards,
Kevin

Thanks,
Lijo

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c +2 -1
index 54f2f346579e..210aea590a52 100644
@@ -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);

Reviewed-by on v1 1/1
#3 lore raw
In reply to Yang Wang

[AMD Official Use Only - General]

Regards,
Bob

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yang Wang
Sent: Thursday, November 30, 2023 1:09 PM
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Zhang, Hawking <[email protected]>
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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c +2 -2
index 54f2f346579e..210aea590a52 100644
@@ -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