Skip to content

Commit b57a917

Browse files
committed
experiments/cpu_pstate_latencies.py: Fix stuff
Extra pstates only for J416c, drop the second pstate field sets (still no idea what that does), fix a mask. Signed-off-by: Hector Martin <[email protected]>
1 parent cf7da86 commit b57a917

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

proxyclient/experiments/cpu_pstate_latencies.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
0x211e00000,
3232
]
3333

34-
if chip_id == 0x8112:
35-
MAX_PSTATE = [7, 17]
36-
else:
34+
if u.adt["/chosen"].target_type == "J416c":
3735
MAX_PSTATE = [7, 19]
36+
else:
37+
MAX_PSTATE = [7, 17]
3838

3939
code = u.malloc(0x1000)
4040

@@ -98,7 +98,7 @@ def bench_cpu(idx, loops=10000000):
9898
return mhz
9999

100100
def set_pstate(cluster, pstate):
101-
p.mask64(CREG[cluster] + CLUSTER_PSTATE, 0x1f01f, (1<<25) | pstate | (pstate << 12))
101+
p.mask64(CREG[cluster] + CLUSTER_PSTATE, 0x1f01f, (1<<25) | pstate)
102102

103103
print()
104104

@@ -110,7 +110,7 @@ def bench_latency(cluster, cpu, from_pstate, to_pstate, verbose=False):
110110
bench_cpu(cpu)
111111

112112
p.smp_call(cpu, util.timelog, logbuf, LOG_ITERS)
113-
psreg = (p.read64(CREG[cluster] + CLUSTER_PSTATE) & ~0x1f001f) | (1<<25) | to_pstate | (to_pstate << 12)
113+
psreg = (p.read64(CREG[cluster] + CLUSTER_PSTATE) & ~0x1f01f) | (1<<25) | to_pstate
114114
tval = p.call(util.signal_and_write, CREG[cluster] + CLUSTER_PSTATE, psreg)
115115
p.smp_wait(cpu)
116116

0 commit comments

Comments
 (0)