Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139539854
D12260.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12260.id.diff
View Options
Index: head/sys/x86/cpufreq/hwpstate.c
===================================================================
--- head/sys/x86/cpufreq/hwpstate.c
+++ head/sys/x86/cpufreq/hwpstate.c
@@ -160,6 +160,7 @@
static int
hwpstate_goto_pstate(device_t dev, int pstate)
{
+ sbintime_t sbt;
int i;
uint64_t msr;
int j;
@@ -170,7 +171,7 @@
/* get the current pstate limit */
msr = rdmsr(MSR_AMD_10H_11H_LIMIT);
limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr);
- if(limit > id)
+ if (limit > id)
id = limit;
/*
@@ -184,7 +185,7 @@
sched_bind(curthread, i);
thread_unlock(curthread);
HWPSTATE_DEBUG(dev, "setting P%d-state on cpu%d\n",
- id, PCPU_GET(cpuid));
+ id, PCPU_GET(cpuid));
/* Go To Px-state */
wrmsr(MSR_AMD_10H_11H_CONTROL, id);
}
@@ -194,13 +195,14 @@
sched_bind(curthread, i);
thread_unlock(curthread);
/* wait loop (100*100 usec is enough ?) */
- for(j = 0; j < 100; j++){
+ for (j = 0; j < 100; j++){
/* get the result. not assure msr=id */
msr = rdmsr(MSR_AMD_10H_11H_STATUS);
- if(msr == id){
+ if (msr == id)
break;
- }
- DELAY(100);
+ sbt = SBT_1MS / 10;
+ tsleep_sbt(dev, PZERO, "pstate_goto", sbt,
+ sbt >> tc_precexp, 0);
}
HWPSTATE_DEBUG(dev, "result: P%d-state on cpu%d\n",
(int)msr, PCPU_GET(cpuid));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 14, 6:30 AM (10 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26943706
Default Alt Text
D12260.id.diff (1 KB)
Attached To
Mode
D12260: cpufreq(4) hwpstate: Yield CPU awaiting frequency change
Attached
Detach File
Event Timeline
Log In to Comment