Skip to contentSkip to conversation

drm/amdgpu: fix pm sysfs node handling (v2)

PATCH In review Alex Deucher 2 participants 2 messages May 21, 2020 – May 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix pm sysfs node handling (v2)

Fix typos that prevented them from showing up.

v2: switch other files in addition to pp_clk_voltage

Fixes 4e01847c38f7a5 ("drm/amdgpu: optimize amdgpu device attribute code")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +4 -4
index 2fc51f815eaa..e06fef6174e5 100644
@@ -1731,10 +1731,10 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 #define DEVICE_ATTR_IS(_name)	(!strcmp(attr_name, #_name))
 
 	if (DEVICE_ATTR_IS(pp_dpm_socclk)) {
-		if (asic_type <= CHIP_VEGA10)
+		if (asic_type < CHIP_VEGA10)
 			attr->states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pp_dpm_dcefclk)) {
-		if (asic_type <= CHIP_VEGA10 || asic_type == CHIP_ARCTURUS)
+		if (asic_type < CHIP_VEGA10 || asic_type == CHIP_ARCTURUS)
 			attr->states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pp_dpm_fclk)) {
 		if (asic_type < CHIP_VEGA20)
@@ -1746,7 +1746,7 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 		attr->states = ATTR_STATE_UNSUPPORTED;
 		if ((is_support_sw_smu(adev) && adev->smu.od_enabled) ||
 		    (!is_support_sw_smu(adev) && hwmgr->od_enabled))
-			attr->states = ATTR_STATE_UNSUPPORTED;
+			attr->states = ATTR_STATE_SUPPORTED;
 	} else if (DEVICE_ATTR_IS(mem_busy_percent)) {
 		if (adev->flags & AMD_IS_APU || asic_type == CHIP_VEGA10)
 			attr->states = ATTR_STATE_UNSUPPORTED;
@@ -1758,7 +1758,7 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 		if (!adev->unique_id)
 			attr->states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pp_features)) {
-		if (adev->flags & AMD_IS_APU || asic_type <= CHIP_VEGA10)
+		if (adev->flags & AMD_IS_APU || asic_type < CHIP_VEGA10)
 			attr->states = ATTR_STATE_UNSUPPORTED;
 	}
 
Signature · 6 lines
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, May 22, 2020 12:27 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu: fix pm sysfs node handling (v2)

Fix typos that prevented them from showing up.

v2: switch other files in addition to pp_clk_voltage

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +3 -3
index 2fc51f815eaa..e06fef6174e5 100644
@@ -1731,10 +1731,10 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 #define DEVICE_ATTR_IS(_name)(!strcmp(attr_name, #_name))
 
 if (DEVICE_ATTR_IS(pp_dpm_socclk)) {
-if (asic_type <= CHIP_VEGA10)
+if (asic_type < CHIP_VEGA10)
 attr->states = ATTR_STATE_UNSUPPORTED;
 } else if (DEVICE_ATTR_IS(pp_dpm_dcefclk)) {
-if (asic_type <= CHIP_VEGA10 || asic_type == CHIP_ARCTURUS)
+if (asic_type < CHIP_VEGA10 || asic_type == CHIP_ARCTURUS)
 attr->states = ATTR_STATE_UNSUPPORTED;
 } else if (DEVICE_ATTR_IS(pp_dpm_fclk)) {
 if (asic_type < CHIP_VEGA20)
@@ -1746,7 +1746,7 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 attr->states = ATTR_STATE_UNSUPPORTED;
 if ((is_support_sw_smu(adev) && adev->smu.od_enabled) ||
     (!is_support_sw_smu(adev) && hwmgr->od_enabled))
-attr->states = ATTR_STATE_UNSUPPORTED;
+attr->states = ATTR_STATE_SUPPORTED;
 } else if (DEVICE_ATTR_IS(mem_busy_percent)) {
 if (adev->flags & AMD_IS_APU || asic_type == CHIP_VEGA10)
 attr->states = ATTR_STATE_UNSUPPORTED; @@ -1758,7 +1758,7 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_

if (!adev->unique_id)
attr->states = ATTR_STATE_UNSUPPORTED;
} else if (DEVICE_ATTR_IS(pp_features)) {

-if (adev->flags & AMD_IS_APU || asic_type <= CHIP_VEGA10)
+if (adev->flags & AMD_IS_APU || asic_type < CHIP_VEGA10)

attr->states = ATTR_STATE_UNSUPPORTED;
}

--
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7Cf0caf70513f64f2e30fc08d7fda3ce90%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637256753077066180&amp;sdata=qenyCI1dUTbVXWeXiPWH2qKvSd9bVlytNeED9IR%2BX00%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx