Skip to content

Commit f6141b0

Browse files
committed
fix: pstate file exist but not enable
Issue: linuxdeepin/developer-center#5761 Log:
1 parent bbc8f26 commit f6141b0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

system/power1/manager.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const (
3131
configManagerId = "org.desktopspec.ConfigManager"
3232
_configHwSystem = "/usr/share/uos-hw-config"
3333
intelPstatePath = "/sys/devices/system/cpu/intel_pstate"
34-
AmdPstatePath = "/sys/devices/system/cpu/amd_pstate"
34+
amdPstatePath = "/sys/devices/system/cpu/amd_pstate"
3535
amdGPUPath = "/sys/class/drm/card0/device/power_dpm_force_performance_level"
3636
)
3737

@@ -151,8 +151,7 @@ func newManager(service *dbusutil.Service) (*Manager, error) {
151151
}
152152
// check pstate , if has pstate, it is intel pstate mode , then
153153
// we need another logic
154-
m.hasPstate = dutils.IsFileExist(intelPstatePath) || dutils.IsFileExist(AmdPstatePath)
155-
// check if amd is used
154+
m.hasPstate = (dutils.IsFileExist(intelPstatePath) || dutils.IsFileExist(amdPstatePath)) && dutils.IsFileExist(pstateConfPath) // check if amd is used
156155
m.hasAmddpm = dutils.IsFileExist(amdGPUPath)
157156

158157
m.refreshSystemPowerPerformance()

0 commit comments

Comments
 (0)