summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/cpu_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/os/cpu_pm.c')
-rw-r--r--usr/src/uts/common/os/cpu_pm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/src/uts/common/os/cpu_pm.c b/usr/src/uts/common/os/cpu_pm.c
index 324e4168d7..b885e421b8 100644
--- a/usr/src/uts/common/os/cpu_pm.c
+++ b/usr/src/uts/common/os/cpu_pm.c
@@ -677,9 +677,13 @@ cpupm_redefine_max_activepwr_state(struct cpu *cp, int max_perf_level)
cpupm_state_t *new_state = NULL;
did = cpupm_domain_id(cp, type);
- mutex_enter(&cpu_lock);
- dom = cpupm_domain_find(did, type);
- mutex_exit(&cpu_lock);
+ if (MUTEX_HELD(&cpu_lock)) {
+ dom = cpupm_domain_find(did, type);
+ } else {
+ mutex_enter(&cpu_lock);
+ dom = cpupm_domain_find(did, type);
+ mutex_exit(&cpu_lock);
+ }
/*
* Can use a lock to avoid changing the power state of the cpu when