rk29: vpu_service: fix bug on power on and power maintain timer
author陈恒明 <chm@rock-chips.com>
Tue, 27 Sep 2011 08:29:39 +0000 (16:29 +0800)
committer陈恒明 <chm@rock-chips.com>
Tue, 27 Sep 2011 08:29:39 +0000 (16:29 +0800)
operation conflict

arch/arm/mach-rk29/vpu_service.c

index 6c26538a6231bea97a103c1493c8befffd98e438..2f70a8331d8d8889e9cf32bf63eef3fc55f5521d 100644 (file)
@@ -274,6 +274,7 @@ static void vpu_service_power_maintain(void)
 
 static void vpu_service_power_on(void)
 {
+       spin_lock_bh(&service.lock);
        if (!service.enabled) {
                service.enabled = true;
                printk("vpu: power on\n");
@@ -289,7 +290,9 @@ static void vpu_service_power_on(void)
                service.timer.expires = jiffies + POWER_OFF_DELAY;
                service.timer.function = vpu_service_power_off_work_func;
                add_timer(&service.timer);
+               spin_unlock_bh(&service.lock);
        } else {
+               spin_unlock_bh(&service.lock);
                vpu_service_power_maintain();
        }
 }