73 lines
2.3 KiB
Diff
73 lines
2.3 KiB
Diff
Subject: acpi-gpe-use-wait-simple.patch
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Tue, 13 Dec 2011 17:14:35 +0100
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
---
|
|
drivers/acpi/ec.c | 8 ++++----
|
|
drivers/acpi/internal.h | 4 +++-
|
|
2 files changed, 7 insertions(+), 5 deletions(-)
|
|
|
|
Index: linux-3.2/drivers/acpi/ec.c
|
|
===================================================================
|
|
--- linux-3.2.orig/drivers/acpi/ec.c
|
|
+++ linux-3.2/drivers/acpi/ec.c
|
|
@@ -222,7 +222,7 @@ static int ec_poll(struct acpi_ec *ec)
|
|
if (ec_transaction_done(ec))
|
|
return 0;
|
|
} else {
|
|
- if (wait_event_timeout(ec->wait,
|
|
+ if (swait_event_timeout(ec->wait,
|
|
ec_transaction_done(ec),
|
|
msecs_to_jiffies(1)))
|
|
return 0;
|
|
@@ -272,7 +272,7 @@ static int ec_wait_ibf0(struct acpi_ec *
|
|
unsigned long delay = jiffies + msecs_to_jiffies(ec_delay);
|
|
/* interrupt wait manually if GPE mode is not active */
|
|
while (time_before(jiffies, delay))
|
|
- if (wait_event_timeout(ec->wait, ec_check_ibf0(ec),
|
|
+ if (swait_event_timeout(ec->wait, ec_check_ibf0(ec),
|
|
msecs_to_jiffies(1)))
|
|
return 0;
|
|
return -ETIME;
|
|
@@ -612,7 +612,7 @@ static u32 acpi_ec_gpe_handler(acpi_hand
|
|
advance_transaction(ec, acpi_ec_read_status(ec));
|
|
if (ec_transaction_done(ec) &&
|
|
(acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) == 0) {
|
|
- wake_up(&ec->wait);
|
|
+ swait_wake(&ec->wait);
|
|
ec_check_sci(ec, acpi_ec_read_status(ec));
|
|
}
|
|
return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
|
|
@@ -676,7 +676,7 @@ static struct acpi_ec *make_acpi_ec(void
|
|
return NULL;
|
|
ec->flags = 1 << EC_FLAGS_QUERY_PENDING;
|
|
mutex_init(&ec->lock);
|
|
- init_waitqueue_head(&ec->wait);
|
|
+ init_swait_head(&ec->wait);
|
|
INIT_LIST_HEAD(&ec->list);
|
|
raw_spin_lock_init(&ec->curr_lock);
|
|
return ec;
|
|
Index: linux-3.2/drivers/acpi/internal.h
|
|
===================================================================
|
|
--- linux-3.2.orig/drivers/acpi/internal.h
|
|
+++ linux-3.2/drivers/acpi/internal.h
|
|
@@ -23,6 +23,8 @@
|
|
|
|
#define PREFIX "ACPI: "
|
|
|
|
+#include <linux/wait-simple.h>
|
|
+
|
|
int init_acpi_device_notify(void);
|
|
int acpi_scan_init(void);
|
|
int acpi_sysfs_init(void);
|
|
@@ -59,7 +61,7 @@ struct acpi_ec {
|
|
unsigned long global_lock;
|
|
unsigned long flags;
|
|
struct mutex lock;
|
|
- wait_queue_head_t wait;
|
|
+ struct swait_head wait;
|
|
struct list_head list;
|
|
struct transaction *curr;
|
|
raw_spinlock_t curr_lock;
|