pm_qos_requirement-fix Signed-off-by: John Kacur Add a raw spinlock for the target value. Index: linux-2.6.26.1-rt1.jk/kernel/pm_qos_params.c =================================================================== --- linux-2.6.26.1-rt1.jk.orig/kernel/pm_qos_params.c +++ linux-2.6.26.1-rt1.jk/kernel/pm_qos_params.c @@ -111,6 +111,7 @@ static struct pm_qos_object *pm_qos_arra }; static DEFINE_SPINLOCK(pm_qos_lock); +static DEFINE_RAW_SPINLOCK(pm_qos_rawlock); static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos); @@ -149,13 +150,15 @@ static void update_target(int target) extreme_value = pm_qos_array[target]->comparitor( extreme_value, node->value); } + spin_unlock_irqrestore(&pm_qos_lock, flags); + spin_lock_irqsave(&pm_qos_rawlock, flags); if (pm_qos_array[target]->target_value != extreme_value) { call_notifier = 1; pm_qos_array[target]->target_value = extreme_value; pr_debug(KERN_ERR "new target for qos %d is %d\n", target, pm_qos_array[target]->target_value); } - spin_unlock_irqrestore(&pm_qos_lock, flags); + spin_unlock_irqrestore(&pm_qos_rawlock, flags); if (call_notifier) blocking_notifier_call_chain(pm_qos_array[target]->notifiers, @@ -195,9 +198,9 @@ int pm_qos_requirement(int pm_qos_class) int ret_val; unsigned long flags; - spin_lock_irqsave(&pm_qos_lock, flags); + spin_lock_irqsave(&pm_qos_rawlock, flags); ret_val = pm_qos_array[pm_qos_class]->target_value; - spin_unlock_irqrestore(&pm_qos_lock, flags); + spin_unlock_irqrestore(&pm_qos_rawlock, flags); return ret_val; }