-/* $OpenBSD: k1x-pstate.c,v 1.10 2017/12/27 17:41:54 fcambus Exp $ */
+/* $OpenBSD: k1x-pstate.c,v 1.11 2021/08/11 18:31:48 tb Exp $ */
/*
* Copyright (c) 2011 Bryan Steele <brynet@gmail.com>
*
u_int64_t msr;
int i, cfid, fid = cstate->state_table[level].fid;
- msr = rdmsr(MSR_K1X_STATUS);
- cfid = K1X_FID(msr);
-
- if (fid == cfid)
- return;
-
- if (cfid != fid) {
- wrmsr(MSR_K1X_CONTROL, fid);
- for (i = 0; i < 100; i++) {
- msr = rdmsr(MSR_K1X_STATUS);
- if (K1X_FID(msr) == fid)
- break;
- DELAY(100);
- }
+ wrmsr(MSR_K1X_CONTROL, fid);
+ for (i = 0; i < 100; i++) {
+ msr = rdmsr(MSR_K1X_STATUS);
cfid = K1X_FID(msr);
+ if (cfid == fid)
+ break;
+ DELAY(100);
}
if (cfid == fid) {
cpuspeed = cstate->state_table[level].freq;