Skip to contentSkip to conversation

drm/amd/amdgpu: disable hwmon power1_cap* for gfx 11.0.3 on vf mode

PATCH In review Yang Wang 2 participants 7 messages Aug 26, 2025 – Aug 27, 2025

Subsystems (3)
lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: disable hwmon power1_cap* for gfx 11.0.3 on vf mode

the PPSMC_MSG_GetPptLimit msg is not valid for gfx 11.0.3 on vf mode, so skiped to create power1_cap* hwmon sysfs node.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10 -8
index d5cc4d7f84e2..c9a986cf3aef 100644
@@ -3593,14 +3593,16 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
 		effective_mode &= ~S_IWUSR;
 
 	/* not implemented yet for APUs other than GC 10.3.1 (vangogh) and 9.4.3 */
-	if (((adev->family == AMDGPU_FAMILY_SI) ||
-	     ((adev->flags & AMD_IS_APU) && (gc_ver != IP_VERSION(10, 3, 1)) &&
-	      (gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4)))) &&
-	    (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
-	     attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
-	     attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
-	     attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr))
-		return 0;
+	if (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
+	    attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
+	    attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
+	    attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr) {
+		if ((adev->family == AMDGPU_FAMILY_SI) ||
+		    ((adev->flags & AMD_IS_APU) && (gc_ver != IP_VERSION(10, 3, 1)) &&
+		     (gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4))) ||
+		    (amdgpu_sriov_vf(adev) && gc_ver == IP_VERSION(11, 0, 3)))
+			return 0;
+	}
 
 	/* not implemented yet for APUs having < GC 9.3.0 (Renoir) */
 	if (((adev->family == AMDGPU_FAMILY_SI) ||
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/1 drm/amd/amdgpu: unified amdgpu ip block name

1. Unified amdgpu ip block name print with format
{ip_type}_v{major}_{minor}_{rev}

2. Avoid IP block name conflicts for SMU/PSP ip block

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 35 ++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +33 -2
index e117494e8054..5754b1fe77be 100644
@@ -2447,6 +2447,33 @@ int amdgpu_device_ip_block_version_cmp(struct amdgpu_device *adev,
 	return 1;
 }
 
+static const char *ip_block_names[] = {
+	[AMD_IP_BLOCK_TYPE_COMMON] =  "common",
+	[AMD_IP_BLOCK_TYPE_GMC] = "gmc",
+	[AMD_IP_BLOCK_TYPE_IH] = "ih",
+	[AMD_IP_BLOCK_TYPE_SMC] = "smu",
+	[AMD_IP_BLOCK_TYPE_PSP] = "psp",
+	[AMD_IP_BLOCK_TYPE_DCE] = "dce",
+	[AMD_IP_BLOCK_TYPE_GFX] = "gfx",
+	[AMD_IP_BLOCK_TYPE_SDMA] = "sdma",
+	[AMD_IP_BLOCK_TYPE_UVD] = "uvd",
+	[AMD_IP_BLOCK_TYPE_VCE] = "vce",
+	[AMD_IP_BLOCK_TYPE_ACP] = "acp",
+	[AMD_IP_BLOCK_TYPE_VCN] = "vcn",
+	[AMD_IP_BLOCK_TYPE_MES] = "mes",
+	[AMD_IP_BLOCK_TYPE_JPEG] = "jpeg",
+	[AMD_IP_BLOCK_TYPE_VPE] = "vpe",
+	[AMD_IP_BLOCK_TYPE_UMSCH_MM] = "umsch_mm",
+	[AMD_IP_BLOCK_TYPE_ISP] = "isp",
+};
+
+static const char *ip_block_name(struct amdgpu_device *adev, enum amd_ip_block_type type)
+{
+	int idx = (int)type;
+
+	return idx < ARRAY_SIZE(ip_block_names) ? ip_block_names[idx] : "unknown";
+}
+
 /**
  * amdgpu_device_ip_block_add
  *
@@ -2475,8 +2502,12 @@ int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
 		break;
 	}
 
-	dev_info(adev->dev, "detected ip block number %d <%s>\n",
-		 adev->num_ip_blocks, ip_block_version->funcs->name);
+	dev_info(adev->dev, "detected ip block number %d <%s_v%d_%d_%d>\n",
+		 adev->num_ip_blocks,
+		 ip_block_name(adev, ip_block_version->type),
+		 ip_block_version->major,
+		 ip_block_version->minor,
+		 ip_block_version->rev);
 
 	adev->ip_blocks[adev->num_ip_blocks].adev = adev;
 
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

Quoted 5 lines · Yang Wang

1. Unified amdgpu ip block name print with format
{ip_type}_v{major}_{minor}_{rev}

2. Avoid IP block name conflicts for SMU/PSP ip block

What is the conflict?

Quoted 46 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 35 ++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +27 -0
index e117494e8054..5754b1fe77be 100644
@@ -2447,6 +2447,33 @@ int amdgpu_device_ip_block_version_cmp(struct amdgpu_device *adev,
        return 1;
 }
 
+static const char *ip_block_names[] = {
+       [AMD_IP_BLOCK_TYPE_COMMON] =  "common",
+       [AMD_IP_BLOCK_TYPE_GMC] = "gmc",
+       [AMD_IP_BLOCK_TYPE_IH] = "ih",
+       [AMD_IP_BLOCK_TYPE_SMC] = "smu",
+       [AMD_IP_BLOCK_TYPE_PSP] = "psp",
+       [AMD_IP_BLOCK_TYPE_DCE] = "dce",
+       [AMD_IP_BLOCK_TYPE_GFX] = "gfx",
+       [AMD_IP_BLOCK_TYPE_SDMA] = "sdma",
+       [AMD_IP_BLOCK_TYPE_UVD] = "uvd",
+       [AMD_IP_BLOCK_TYPE_VCE] = "vce",
+       [AMD_IP_BLOCK_TYPE_ACP] = "acp",
+       [AMD_IP_BLOCK_TYPE_VCN] = "vcn",
+       [AMD_IP_BLOCK_TYPE_MES] = "mes",
+       [AMD_IP_BLOCK_TYPE_JPEG] = "jpeg",
+       [AMD_IP_BLOCK_TYPE_VPE] = "vpe",
+       [AMD_IP_BLOCK_TYPE_UMSCH_MM] = "umsch_mm",
+       [AMD_IP_BLOCK_TYPE_ISP] = "isp",
+};
+
+static const char *ip_block_name(struct amdgpu_device *adev, enum amd_ip_block_type type)
+{
+       int idx = (int)type;
+
+       return idx < ARRAY_SIZE(ip_block_names) ? ip_block_names[idx] : "unknown";
+}
+
 /**
  * amdgpu_device_ip_block_add
  *

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_ip_block_add(struct amdgpu_device *adev, · line 2479

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
@@ -2475,8 +2502,12 @@ int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
                break;
        }
 
-       dev_info(adev->dev, "detected ip block number %d <%s>\n",
-                adev->num_ip_blocks, ip_block_version->funcs->name);

Can we keep ip_block_version->funcs->name? There is useful information encoded in that. E.g. dm vs dce_v6_0 depending on whether DC is enabled or not or powerplay vs swsmu for SMU.

Alex

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -1
+       dev_info(adev->dev, "detected ip block number %d <%s_v%d_%d_%d>\n",
+                adev->num_ip_blocks,
+                ip_block_name(adev, ip_block_version->type),
+                ip_block_version->major,
+                ip_block_version->minor,
+                ip_block_version->rev);
 
        adev->ip_blocks[adev->num_ip_blocks].adev = adev;
 
--

2.34.1

#3 lore raw

RE: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, August 26, 2025 9:49 PM
To: Wang, Yang(Kevin) <[email protected]>
Cc: [email protected]; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

Quoted 5 lines · Yang Wang

1. Unified amdgpu ip block name print with format
{ip_type}_v{major}_{minor}_{rev}

2. Avoid IP block name conflicts for SMU/PSP ip block

What is the conflict?

Kevin: all SMU/PSP IP blocks share the same name "smu"/"psp" , and there is no IP version information here.

Best Regards,
Kevin

Quoted 47 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 35
++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +26 -0
index e117494e8054..5754b1fe77be 100644
@@ -2447,6 +2447,33 @@ int amdgpu_device_ip_block_version_cmp(struct amdgpu_device *adev,
        return 1;
 }
 
+static const char *ip_block_names[] = {
+       [AMD_IP_BLOCK_TYPE_COMMON] =  "common",
+       [AMD_IP_BLOCK_TYPE_GMC] = "gmc",
+       [AMD_IP_BLOCK_TYPE_IH] = "ih",
+       [AMD_IP_BLOCK_TYPE_SMC] = "smu",
+       [AMD_IP_BLOCK_TYPE_PSP] = "psp",
+       [AMD_IP_BLOCK_TYPE_DCE] = "dce",
+       [AMD_IP_BLOCK_TYPE_GFX] = "gfx",
+       [AMD_IP_BLOCK_TYPE_SDMA] = "sdma",
+       [AMD_IP_BLOCK_TYPE_UVD] = "uvd",
+       [AMD_IP_BLOCK_TYPE_VCE] = "vce",
+       [AMD_IP_BLOCK_TYPE_ACP] = "acp",
+       [AMD_IP_BLOCK_TYPE_VCN] = "vcn",
+       [AMD_IP_BLOCK_TYPE_MES] = "mes",
+       [AMD_IP_BLOCK_TYPE_JPEG] = "jpeg",
+       [AMD_IP_BLOCK_TYPE_VPE] = "vpe",
+       [AMD_IP_BLOCK_TYPE_UMSCH_MM] = "umsch_mm",
+       [AMD_IP_BLOCK_TYPE_ISP] = "isp", };
+
+static const char *ip_block_name(struct amdgpu_device *adev, enum
+amd_ip_block_type type) {
+       int idx = (int)type;
+
+       return idx < ARRAY_SIZE(ip_block_names) ? ip_block_names[idx]
+: "unknown"; }
+
 /**
  * amdgpu_device_ip_block_add
  *

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_ip_block_add(struct amdgpu_device *adev, · line 2479

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
@@ -2475,8 +2502,12 @@ int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
                break;
        }
 
-       dev_info(adev->dev, "detected ip block number %d <%s>\n",
-                adev->num_ip_blocks, ip_block_version->funcs->name);

Can we keep ip_block_version->funcs->name? There is useful information encoded in that. E.g. dm vs dce_v6_0 depending on whether DC is enabled or not or powerplay vs swsmu for SMU.

Alex

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -1
+       dev_info(adev->dev, "detected ip block number %d <%s_v%d_%d_%d>\n",
+                adev->num_ip_blocks,
+                ip_block_name(adev, ip_block_version->type),
+                ip_block_version->major,
+                ip_block_version->minor,
+                ip_block_version->rev);
 
        adev->ip_blocks[adev->num_ip_blocks].adev = adev;
 
--

2.34.1

#4 lore raw

RE: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Wang, Yang(Kevin)
Sent: Wednesday, August 27, 2025 02:13
To: Alex Deucher <[email protected]>
Cc: [email protected]; Kamal, Asad <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, August 26, 2025 9:49 PM
To: Wang, Yang(Kevin) <[email protected]>
Cc: [email protected]; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

Quoted 5 lines · Yang Wang

1. Unified amdgpu ip block name print with format
{ip_type}_v{major}_{minor}_{rev}

2. Avoid IP block name conflicts for SMU/PSP ip block

What is the conflict?

Kevin: all SMU/PSP IP blocks share the same name "smu"/"psp" , and there is no IP version information here.

Best Regards,
Kevin

Quoted 47 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 35
++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +26 -0
index e117494e8054..5754b1fe77be 100644
@@ -2447,6 +2447,33 @@ int amdgpu_device_ip_block_version_cmp(struct amdgpu_device *adev,
        return 1;
 }
 
+static const char *ip_block_names[] = {
+       [AMD_IP_BLOCK_TYPE_COMMON] =  "common",
+       [AMD_IP_BLOCK_TYPE_GMC] = "gmc",
+       [AMD_IP_BLOCK_TYPE_IH] = "ih",
+       [AMD_IP_BLOCK_TYPE_SMC] = "smu",
+       [AMD_IP_BLOCK_TYPE_PSP] = "psp",
+       [AMD_IP_BLOCK_TYPE_DCE] = "dce",
+       [AMD_IP_BLOCK_TYPE_GFX] = "gfx",
+       [AMD_IP_BLOCK_TYPE_SDMA] = "sdma",
+       [AMD_IP_BLOCK_TYPE_UVD] = "uvd",
+       [AMD_IP_BLOCK_TYPE_VCE] = "vce",
+       [AMD_IP_BLOCK_TYPE_ACP] = "acp",
+       [AMD_IP_BLOCK_TYPE_VCN] = "vcn",
+       [AMD_IP_BLOCK_TYPE_MES] = "mes",
+       [AMD_IP_BLOCK_TYPE_JPEG] = "jpeg",
+       [AMD_IP_BLOCK_TYPE_VPE] = "vpe",
+       [AMD_IP_BLOCK_TYPE_UMSCH_MM] = "umsch_mm",
+       [AMD_IP_BLOCK_TYPE_ISP] = "isp", };
+
+static const char *ip_block_name(struct amdgpu_device *adev, enum
+amd_ip_block_type type) {
+       int idx = (int)type;
+
+       return idx < ARRAY_SIZE(ip_block_names) ? ip_block_names[idx]
+: "unknown"; }
+
 /**
  * amdgpu_device_ip_block_add
  *

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_ip_block_add(struct amdgpu_device *adev, · line 2479

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
@@ -2475,8 +2502,12 @@ int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
                break;
        }
 
-       dev_info(adev->dev, "detected ip block number %d <%s>\n",
-                adev->num_ip_blocks, ip_block_version->funcs->name);

Can we keep ip_block_version->funcs->name? There is useful information encoded in that. E.g. dm vs dce_v6_0 depending on whether DC is enabled or not or powerplay vs swsmu for SMU.

Alex

[Kevin]:
Agree, it is ok for me, please ignore this patch, thanks.

Best Regards,
Kevin

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -1
+       dev_info(adev->dev, "detected ip block number %d <%s_v%d_%d_%d>\n",
+                adev->num_ip_blocks,
+                ip_block_name(adev, ip_block_version->type),
+                ip_block_version->major,
+                ip_block_version->minor,
+                ip_block_version->rev);
 
        adev->ip_blocks[adev->num_ip_blocks].adev = adev;
 
--

2.34.1

#5 lore raw

Re: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

Quoted 89 lines · Yang(Kevin)

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Wang, Yang(Kevin)
Sent: Wednesday, August 27, 2025 02:13
To: Alex Deucher <[email protected]>
Cc: [email protected]; Kamal, Asad <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, August 26, 2025 9:49 PM
To: Wang, Yang(Kevin) <[email protected]>
Cc: [email protected]; Kamal, Asad <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: unified amdgpu ip block name

Quoted 5 lines · Yang Wang

1. Unified amdgpu ip block name print with format
{ip_type}_v{major}_{minor}_{rev}

2. Avoid IP block name conflicts for SMU/PSP ip block

What is the conflict?

Kevin: all SMU/PSP IP blocks share the same name "smu"/"psp" , and there is no IP version information here.

Best Regards,
Kevin

Quoted 47 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 35
++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +26 -0
index e117494e8054..5754b1fe77be 100644
@@ -2447,6 +2447,33 @@ int amdgpu_device_ip_block_version_cmp(struct amdgpu_device *adev,
        return 1;
 }
 
+static const char *ip_block_names[] = {
+       [AMD_IP_BLOCK_TYPE_COMMON] =  "common",
+       [AMD_IP_BLOCK_TYPE_GMC] = "gmc",
+       [AMD_IP_BLOCK_TYPE_IH] = "ih",
+       [AMD_IP_BLOCK_TYPE_SMC] = "smu",
+       [AMD_IP_BLOCK_TYPE_PSP] = "psp",
+       [AMD_IP_BLOCK_TYPE_DCE] = "dce",
+       [AMD_IP_BLOCK_TYPE_GFX] = "gfx",
+       [AMD_IP_BLOCK_TYPE_SDMA] = "sdma",
+       [AMD_IP_BLOCK_TYPE_UVD] = "uvd",
+       [AMD_IP_BLOCK_TYPE_VCE] = "vce",
+       [AMD_IP_BLOCK_TYPE_ACP] = "acp",
+       [AMD_IP_BLOCK_TYPE_VCN] = "vcn",
+       [AMD_IP_BLOCK_TYPE_MES] = "mes",
+       [AMD_IP_BLOCK_TYPE_JPEG] = "jpeg",
+       [AMD_IP_BLOCK_TYPE_VPE] = "vpe",
+       [AMD_IP_BLOCK_TYPE_UMSCH_MM] = "umsch_mm",
+       [AMD_IP_BLOCK_TYPE_ISP] = "isp", };
+
+static const char *ip_block_name(struct amdgpu_device *adev, enum
+amd_ip_block_type type) {
+       int idx = (int)type;
+
+       return idx < ARRAY_SIZE(ip_block_names) ? ip_block_names[idx]
+: "unknown"; }
+
 /**
  * amdgpu_device_ip_block_add
  *

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_ip_block_add(struct amdgpu_device *adev, · line 2479

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
@@ -2475,8 +2502,12 @@ int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
                break;
        }
 
-       dev_info(adev->dev, "detected ip block number %d <%s>\n",
-                adev->num_ip_blocks, ip_block_version->funcs->name);

Can we keep ip_block_version->funcs->name? There is useful information encoded in that. E.g. dm vs dce_v6_0 depending on whether DC is enabled or not or powerplay vs swsmu for SMU.

Quoted 4 lines

Alex

[Kevin]:
Agree, it is ok for me, please ignore this patch, thanks.

I think the patch is a nice cleanup, just include the name as well. E.g.,

+ dev_info(adev->dev, "detected ip block number %d
<%s_v%d_%d_%d> (%s)\n",

 +                adev->num_ip_blocks,
 +                ip_block_name(adev, ip_block_version->type),
 +                ip_block_version->major,
 +                ip_block_version->minor,
 +                ip_block_version->rev,
 +                ip_block_version->funcs->name);

Alex

Quoted 16 lines

Best Regards,
Kevin

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -1
+       dev_info(adev->dev, "detected ip block number %d <%s_v%d_%d_%d>\n",
+                adev->num_ip_blocks,
+                ip_block_name(adev, ip_block_version->type),
+                ip_block_version->major,
+                ip_block_version->minor,
+                ip_block_version->rev);
 
        adev->ip_blocks[adev->num_ip_blocks].adev = adev;
 
--

2.34.1

Acked-by on v1 1/1
#6 lore raw
In reply to Yang Wang
Quoted 6 lines · Yang Wang

the PPSMC_MSG_GetPptLimit msg is not valid for gfx 11.0.3 on vf mode, so skiped to create power1_cap* hwmon sysfs node.

Quoted 36 lines
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10 -9
index d5cc4d7f84e2..c9a986cf3aef 100644
@@ -3593,14 +3593,16 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
                effective_mode &= ~S_IWUSR;
 
        /* not implemented yet for APUs other than GC 10.3.1 (vangogh) and 9.4.3 */
-       if (((adev->family == AMDGPU_FAMILY_SI) ||
-            ((adev->flags & AMD_IS_APU) && (gc_ver != IP_VERSION(10, 3, 1)) &&
-             (gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4)))) &&
-           (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
-            attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
-            attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
-            attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr))
-               return 0;
+       if (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
+           attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
+           attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
+           attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr) {
+               if ((adev->family == AMDGPU_FAMILY_SI) ||
+                   ((adev->flags & AMD_IS_APU) && (gc_ver != IP_VERSION(10, 3, 1)) &&
+                    (gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4))) ||
+                   (amdgpu_sriov_vf(adev) && gc_ver == IP_VERSION(11, 0, 3)))
+                       return 0;
+       }
 
        /* not implemented yet for APUs having < GC 9.3.0 (Renoir) */
        if (((adev->family == AMDGPU_FAMILY_SI) ||
--

2.34.1