3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 --- linux/arch/arm/mach-pxa/sharpsl_apm.c~fix_tosa_apm.patch
7 +++ linux/arch/arm/mach-pxa/sharpsl_apm.c
10 struct apm_user * next;
17 @@ -1596,12 +1598,12 @@
21 - DPRINTK("event=%d\n",event);
22 + DPRINTK("event=%d, sender=%p\n",event,sender);
24 if (user_list == NULL)
26 for (as = user_list; as != NULL; as = as->next) {
28 + if ((as == sender) || (!as->reader))
30 as->event_head = (as->event_head + 1) % APM_MAX_EVENTS;
31 if (as->event_head == as->event_tail) {
33 as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS;
35 as->events[as->event_head] = event;
38 + if ((!as->suser) || (!as->writer))
42 case APM_USER_SUSPEND:
44 #ifdef SHARPSL_NEW_IDLE
45 current->nice = save_nice;
46 current->counter = save_counter;
48 - wake_up_interruptible(&apm_waitqueue);
50 + wake_up_interruptible(&apm_waitqueue);
53 static unsigned long get_cmos_time(void)
55 * privileged operation -- cevans
57 as->suser = capable(CAP_SYS_ADMIN);
58 + as->writer = (filp->f_mode & FMODE_WRITE) == FMODE_WRITE;
59 + as->reader = (filp->f_mode & FMODE_READ) == FMODE_READ;
62 filp->private_data = as;
67 + suspends_pending = 0;
68 + standbys_pending = 0;
70 apm_proc = create_proc_info_entry("apm", 0, NULL, apm_get_info);
72 SET_MODULE_OWNER(apm_proc);