summaryrefslogtreecommitdiff
path: root/packages/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/fix_tosa_apm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/fix_tosa_apm.patch')
-rw-r--r--packages/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/fix_tosa_apm.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/packages/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/fix_tosa_apm.patch b/packages/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/fix_tosa_apm.patch
index e69de29bb2..092b0dcf49 100644
--- a/packages/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/fix_tosa_apm.patch
+++ b/packages/linux/openzaurus-pxa-2.4.18-rmk7-pxa3-embedix20031107/fix_tosa_apm.patch
@@ -0,0 +1,72 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- linux/arch/arm/mach-pxa/sharpsl_apm.c~fix_tosa_apm.patch
++++ linux/arch/arm/mach-pxa/sharpsl_apm.c
+@@ -254,6 +254,8 @@
+ int magic;
+ struct apm_user * next;
+ int suser: 1;
++ int reader: 1;
++ int writer: 1;
+ int suspend_wait: 1;
+ int suspend_result;
+ int suspends_pending;
+@@ -1596,12 +1598,12 @@
+ {
+ struct apm_user * as;
+
+- DPRINTK("event=%d\n",event);
++ DPRINTK("event=%d, sender=%p\n",event,sender);
+
+ if (user_list == NULL)
+ return;
+ for (as = user_list; as != NULL; as = as->next) {
+- if (as == sender)
++ if ((as == sender) || (!as->reader))
+ continue;
+ as->event_head = (as->event_head + 1) % APM_MAX_EVENTS;
+ if (as->event_head == as->event_tail) {
+@@ -1611,8 +1613,8 @@
+ as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS;
+ }
+ as->events[as->event_head] = event;
+- if (!as->suser)
+- continue;
++ if ((!as->suser) || (!as->writer))
++ continue;
+ switch (event) {
+ case APM_SYS_SUSPEND:
+ case APM_USER_SUSPEND:
+@@ -1630,9 +1632,8 @@
+ #ifdef SHARPSL_NEW_IDLE
+ current->nice = save_nice;
+ current->counter = save_counter;
+-#else
+- wake_up_interruptible(&apm_waitqueue);
+ #endif
++ wake_up_interruptible(&apm_waitqueue);
+ }
+
+ static unsigned long get_cmos_time(void)
+@@ -2532,6 +2533,8 @@
+ * privileged operation -- cevans
+ */
+ as->suser = capable(CAP_SYS_ADMIN);
++ as->writer = (filp->f_mode & FMODE_WRITE) == FMODE_WRITE;
++ as->reader = (filp->f_mode & FMODE_READ) == FMODE_READ;
+ as->next = user_list;
+ user_list = as;
+ filp->private_data = as;
+@@ -3000,6 +3003,9 @@
+ #endif
+ #endif
+
++ suspends_pending = 0;
++ standbys_pending = 0;
++
+ apm_proc = create_proc_info_entry("apm", 0, NULL, apm_get_info);
+ if (apm_proc)
+ SET_MODULE_OWNER(apm_proc);