Skip to contentSkip to conversation

Make current GPE changes to be consistent with ACPICA code base

PATCH In review Lin Ming 2 participants 5 messages Apr 6, 2010 – Apr 7, 2010

Subsystems (2)
lore
Share & tools
lore

Lin Ming

author
#0 lore raw

PATCH 1/1 Make current GPE changes to be consistent with ACPICA code base

Hi, Rafael

Bob has ported the major GPE changes into ACPICA code base.
http://git.moblin.org/cgit.cgi/acpica/commit/?id=45f0b38a921f3b2af7574d553a6c2e557d0567ed

But Bob's port and your original patch have some differences, so I made below patch to make linux acpica code consistent with ACPICA code base.

I have build and tested it, would you please help to review? If everything is OK, I'll include it in the next linux acpica update and send it to Len.

Most changes are about comments and coding styles. Other noticeable changes are:

A new function acpi_ev_low_get_gpe_info, returns the event_info struct associated with a GPE.

A new field gpe_count in struct acpi_gpe_block_info to record the number of individual GPEs in block.

Rename acpi_ev_save_method_info to acpi_ev_match_gpe_method.

Remove parameter flags from acpi_clear_gpe/acpi_get_gpe_status, use GPE lock instead of the events mutex.

---
 drivers/acpi/acpica/acevents.h |    7 +-
 drivers/acpi/acpica/aclocal.h  |    5 +-
 drivers/acpi/acpica/evgpe.c    |  153 +++++++++++++++++++++++---------
 drivers/acpi/acpica/evgpeblk.c |  143 ++++++++++++++++--------------
 drivers/acpi/acpica/evxface.c  |   20 +++--
 drivers/acpi/acpica/evxfevnt.c |  191 +++++++++++++++++++++++----------------
 drivers/acpi/acpica/exoparg2.c |   27 ------
 drivers/acpi/scan.c            |    2 +-
 drivers/acpi/system.c          |    5 +-
 include/acpi/acexcep.h         |    2 +-
 include/acpi/acpixf.h          |   11 ++-
 include/acpi/actypes.h         |   42 ++++-----
 12 files changed, 346 insertions(+), 262 deletions(-)
drivers/acpi/acpica/acevents.h +4 -3
index 3e6ba99..5e094a2 100644
@@ -85,6 +85,10 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
 struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
 						       u32 gpe_number);
 
+struct acpi_gpe_event_info *acpi_ev_low_get_gpe_info(u32 gpe_number,
+						     struct acpi_gpe_block_info
+						     *gpe_block);
+
 /*
  * evgpeblk
  */
@@ -118,9 +122,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info,
 
 u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
 
-acpi_status
-acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info);
-
 acpi_status acpi_ev_gpe_initialize(void);
 
 /*
drivers/acpi/acpica/aclocal.h +3 -2
index 24b8faa..5a6203a 100644
@@ -427,8 +427,8 @@ struct acpi_gpe_event_info {
 	struct acpi_gpe_register_info *register_info;	/* Backpointer to register info */
 	u8 flags;		/* Misc info about this GPE */
 	u8 gpe_number;		/* This GPE */
-	u8 runtime_count;
-	u8 wakeup_count;
+	u8 runtime_count;	/* References to a run GPE */
+	u8 wakeup_count;	/* References to a wake GPE */
 };
 
 /* Information about a GPE register pair, one per each status/enable pair in an array */
@@ -454,6 +454,7 @@ struct acpi_gpe_block_info {
 	struct acpi_gpe_event_info *event_info;	/* One for each GPE */
 	struct acpi_generic_address block_address;	/* Base address of the block */
 	u32 register_count;	/* Number of register pairs in block */
+	u16 gpe_count;		/* Number of individual GPEs in block */
 	u8 block_base_number;	/* Base GPE number for this block */
 };
 
drivers/acpi/acpica/evgpe.c +109 -44

250 lines not on this page · raw message

drivers/acpi/acpica/evgpeblk.c +76 -67

310 lines not on this page · raw message

drivers/acpi/acpica/evxface.c +11 -9
index ca04823..cc82502 100644
@@ -682,14 +682,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
 	/* Parameter validation */
 
-	if ((!address) || (type > ACPI_GPE_XRUPT_TYPE_MASK)) {
-		status = AE_BAD_PARAMETER;
-		goto exit;
+	if ((!address) || (type & ~ACPI_GPE_XRUPT_TYPE_MASK)) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
 	if (ACPI_FAILURE(status)) {
-		goto exit;
+		return_ACPI_STATUS(status);
 	}
 
 	/* Ensure that we have a valid GPE number */
@@ -720,6 +719,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 	handler->context = context;
 	handler->method_node = gpe_event_info->dispatch.method_node;
 
+	/* Disable the GPE before installing the handler */
+
+	status = acpi_ev_disable_gpe(gpe_event_info);
+	if (ACPI_FAILURE (status)) {
+		goto unlock_and_exit;
+	}
+
 	/* Install the handler */
 
 	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
@@ -733,12 +739,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
 	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 
-      unlock_and_exit:
+unlock_and_exit:
 	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
-      exit:
-	if (ACPI_FAILURE(status))
-		ACPI_EXCEPTION((AE_INFO, status,
-				"Installing notify handler failed"));
 	return_ACPI_STATUS(status);
 }
 
drivers/acpi/acpica/evxfevnt.c +113 -78

353 lines not on this page · raw message

drivers/acpi/acpica/exoparg2.c +0 -27
index 3f3f48b..10e104c 100644
@@ -119,33 +119,6 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
 			status = AE_AML_OPERAND_TYPE;
 			break;
 		}
-#ifdef ACPI_GPE_NOTIFY_CHECK
-		/*
-		 * GPE method wake/notify check.  Here, we want to ensure that we
-		 * don't receive any "DeviceWake" Notifies from a GPE _Lxx or _Exx
-		 * GPE method during system runtime.  If we do, the GPE is marked
-		 * as "wake-only" and disabled.
-		 *
-		 * 1) Is the Notify() value == device_wake?
-		 * 2) Is this a GPE deferred method?  (An _Lxx or _Exx method)
-		 * 3) Did the original GPE happen at system runtime?
-		 *    (versus during wake)
-		 *
-		 * If all three cases are true, this is a wake-only GPE that should
-		 * be disabled at runtime.
-		 */
-		if (value == 2) {	/* device_wake */
-			status =
-			    acpi_ev_check_for_wake_only_gpe(walk_state->
-							    gpe_event_info);
-			if (ACPI_FAILURE(status)) {
-
-				/* AE_WAKE_ONLY_GPE only error, means ignore this notify */
-
-				return_ACPI_STATUS(AE_OK)
-			}
-		}
-#endif
 
 		/*
 		 * Dispatch the notify to the appropriate handler
drivers/acpi/scan.c +1 -1
index 95c90ff..9e5396a 100644
@@ -764,7 +764,7 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
 	}
 
 	status = acpi_get_gpe_status(NULL, device->wakeup.gpe_number,
-					ACPI_NOT_ISR, &event_status);
+					&event_status);
 	if (status == AE_OK)
 		device->wakeup.flags.run_wake =
 				!!(event_status & ACPI_EVENT_FLAG_HANDLE);
drivers/acpi/system.c +2 -3
index 743f244..b6093bc 100644
@@ -302,8 +302,7 @@ static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle)
 				"Invalid GPE 0x%x\n", index));
 			goto end;
 		}
-		result = acpi_get_gpe_status(*handle, index,
-						ACPI_NOT_ISR, status);
+		result = acpi_get_gpe_status(*handle, index, status);
 	} else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
 		result = acpi_get_event_status(index - num_gpes, status);
 
@@ -394,7 +393,7 @@ static ssize_t counter_set(struct kobject *kobj,
 			result = acpi_set_gpe(handle, index, ACPI_GPE_ENABLE);
 		else if (!strcmp(buf, "clear\n") &&
 				(status & ACPI_EVENT_FLAG_SET))
-			result = acpi_clear_gpe(handle, index, ACPI_NOT_ISR);
+			result = acpi_clear_gpe(handle, index);
 		else
 			all_counters[index].count = strtoul(buf, NULL, 0);
 	} else if (index < num_gpes + ACPI_NUM_FIXED_EVENTS) {
include/acpi/acexcep.h +1 -1
index 5b2e5e8..5958d78 100644
@@ -87,7 +87,7 @@
 #define AE_NO_GLOBAL_LOCK               (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL)
 #define AE_ABORT_METHOD                 (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL)
 #define AE_SAME_HANDLER                 (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
-#define AE_WAKE_ONLY_GPE                (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
+#define AE_NO_HANDLER                   (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
 #define AE_OWNER_ID_LIMIT               (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
 
 #define AE_CODE_ENV_MAX                 0x001B
include/acpi/acpixf.h +6 -5
index f753222..c82c3b5 100644
@@ -284,16 +284,17 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
  */
 acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action);
 
-acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type);
+acpi_status
+acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type);
 
-acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type);
+acpi_status
+acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type);
 
-acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
+acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number);
 
 acpi_status
 acpi_get_gpe_status(acpi_handle gpe_device,
-		    u32 gpe_number,
-		    u32 flags, acpi_event_status * event_status);
+		    u32 gpe_number, acpi_event_status *event_status);
 
 acpi_status acpi_disable_all_gpes(void);
 
include/acpi/actypes.h +20 -22

64 lines not on this page · raw message

#1 lore raw
Quoted 11 lines · Lin Ming

Hi, Rafael

Bob has ported the major GPE changes into ACPICA code base.
http://git.moblin.org/cgit.cgi/acpica/commit/?id=45f0b38a921f3b2af7574d553a6c2e557d0567ed

But Bob's port and your original patch have some differences, so I made below patch to make linux acpica code consistent with ACPICA code base.

I have build and tested it, would you please help to review? If everything is OK, I'll include it in the next linux acpica update and send it to Len.

While I'm generally fine with the code, it looks like the $subject patch includes the patches I sent earlier (slightly reworked):
https://patchwork.kernel.org/patch/90471/
https://patchwork.kernel.org/patch/86237/

I'll appreciate it if there's a notice in the changelog that the patch is based on them.

Also, please add my sign-off to the final submission to indicate that some changes in the patch are in fact from me.

Thanks,
Rafael

author
#2 lore raw
Quoted 13 lines · Rafael J. Wysocki
Quoted 11 lines · Lin Ming

Hi, Rafael

Bob has ported the major GPE changes into ACPICA code base.
http://git.moblin.org/cgit.cgi/acpica/commit/?id=45f0b38a921f3b2af7574d553a6c2e557d0567ed

But Bob's port and your original patch have some differences, so I made below patch to make linux acpica code consistent with ACPICA code base.

I have build and tested it, would you please help to review? If everything is OK, I'll include it in the next linux acpica update and send it to Len.

Quoted 7 lines

While I'm generally fine with the code, it looks like the $subject patch includes the patches I sent earlier (slightly reworked):
https://patchwork.kernel.org/patch/90471/
https://patchwork.kernel.org/patch/86237/

I'll appreciate it if there's a notice in the changelog that the patch is based on them.

We ported your code to ACPICA code base.
I'll add the changelog to notice that.

Quoted 3 lines

Also, please add my sign-off to the final submission to indicate that some changes in the patch are in fact from me.

Sure.

Thanks,
Lin Ming

author
#3 lore raw
Quoted 22 lines · Lin Ming
Quoted 13 lines · Rafael J. Wysocki
Quoted 11 lines · Lin Ming

Hi, Rafael

Bob has ported the major GPE changes into ACPICA code base.
http://git.moblin.org/cgit.cgi/acpica/commit/?id=45f0b38a921f3b2af7574d553a6c2e557d0567ed

But Bob's port and your original patch have some differences, so I made below patch to make linux acpica code consistent with ACPICA code base.

I have build and tested it, would you please help to review? If everything is OK, I'll include it in the next linux acpica update and send it to Len.

Quoted 7 lines

While I'm generally fine with the code, it looks like the $subject patch includes the patches I sent earlier (slightly reworked):
https://patchwork.kernel.org/patch/90471/
https://patchwork.kernel.org/patch/86237/

I'll appreciate it if there's a notice in the changelog that the patch is based on them.

Quoted 8 lines

We ported your code to ACPICA code base.
I'll add the changelog to notice that.

Quoted 3 lines

Also, please add my sign-off to the final submission to indicate that some changes in the patch are in fact from me.

Sure.

Hi,

How about below one?

Quoted 1 line

From d79bb1feba87a22dece4ee7cfc30a2965ab54e02 Mon Sep 17 00:00:00 2001

From: Lin Ming <[email protected]>
Date: Tue, 6 Apr 2010 14:52:37 +0800
Subject: [PATCH] Minimize the differences between linux GPE code and ACPICA code base

We have ported Rafael's major GPE changes
(ACPI: Use GPE reference counting to support shared GPEs) into ACPICA code base. But the port and Rafael's original patch have some differences, so we made below patch to make linux GPE code consistent with ACPICA code base.

Most changes are about comments and coding styles. Other noticeable changes are based on:

Rafael: Reduce code duplication related to GPE lookup
https://patchwork.kernel.org/patch/86237/

Rafeal: Always use the same lock for GPE locking
https://patchwork.kernel.org/patch/90471/

A new field gpe_count in struct acpi_gpe_block_info to record the number of individual GPEs in block.

Rename acpi_ev_save_method_info to acpi_ev_match_gpe_method.

---
 drivers/acpi/acpica/acevents.h |    7 +-
 drivers/acpi/acpica/aclocal.h  |    5 +-
 drivers/acpi/acpica/evgpe.c    |  153 +++++++++++++++++++++++---------
 drivers/acpi/acpica/evgpeblk.c |  143 ++++++++++++++++--------------
 drivers/acpi/acpica/evxface.c  |   20 +++--
 drivers/acpi/acpica/evxfevnt.c |  191 +++++++++++++++++++++++----------------
 drivers/acpi/acpica/exoparg2.c |   27 ------
 drivers/acpi/scan.c            |    2 +-
 drivers/acpi/system.c          |    5 +-
 include/acpi/acexcep.h         |    2 +-
 include/acpi/acpixf.h          |   11 ++-
 include/acpi/actypes.h         |   42 ++++-----
 12 files changed, 346 insertions(+), 262 deletions(-)
drivers/acpi/acpica/acevents.h +4 -3
index 3e6ba99..5e094a2 100644
@@ -85,6 +85,10 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
 struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
 						       u32 gpe_number);
 
+struct acpi_gpe_event_info *acpi_ev_low_get_gpe_info(u32 gpe_number,
+						     struct acpi_gpe_block_info
+						     *gpe_block);
+
 /*
  * evgpeblk
  */
@@ -118,9 +122,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info,
 
 u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
 
-acpi_status
-acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info);
-
 acpi_status acpi_ev_gpe_initialize(void);
 
 /*
drivers/acpi/acpica/aclocal.h +3 -2
index 24b8faa..5a6203a 100644
@@ -427,8 +427,8 @@ struct acpi_gpe_event_info {
 	struct acpi_gpe_register_info *register_info;	/* Backpointer to register info */
 	u8 flags;		/* Misc info about this GPE */
 	u8 gpe_number;		/* This GPE */
-	u8 runtime_count;
-	u8 wakeup_count;
+	u8 runtime_count;	/* References to a run GPE */
+	u8 wakeup_count;	/* References to a wake GPE */
 };
 
 /* Information about a GPE register pair, one per each status/enable pair in an array */
@@ -454,6 +454,7 @@ struct acpi_gpe_block_info {
 	struct acpi_gpe_event_info *event_info;	/* One for each GPE */
 	struct acpi_generic_address block_address;	/* Base address of the block */
 	u32 register_count;	/* Number of register pairs in block */
+	u16 gpe_count;		/* Number of individual GPEs in block */
 	u8 block_base_number;	/* Base GPE number for this block */
 };
 
drivers/acpi/acpica/evgpe.c +109 -44

250 lines not on this page · raw message

drivers/acpi/acpica/evgpeblk.c +76 -67

310 lines not on this page · raw message

drivers/acpi/acpica/evxface.c +11 -9
index ca04823..cc82502 100644
@@ -682,14 +682,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
 	/* Parameter validation */
 
-	if ((!address) || (type > ACPI_GPE_XRUPT_TYPE_MASK)) {
-		status = AE_BAD_PARAMETER;
-		goto exit;
+	if ((!address) || (type & ~ACPI_GPE_XRUPT_TYPE_MASK)) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
 	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
 	if (ACPI_FAILURE(status)) {
-		goto exit;
+		return_ACPI_STATUS(status);
 	}
 
 	/* Ensure that we have a valid GPE number */
@@ -720,6 +719,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 	handler->context = context;
 	handler->method_node = gpe_event_info->dispatch.method_node;
 
+	/* Disable the GPE before installing the handler */
+
+	status = acpi_ev_disable_gpe(gpe_event_info);
+	if (ACPI_FAILURE (status)) {
+		goto unlock_and_exit;
+	}
+
 	/* Install the handler */
 
 	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
@@ -733,12 +739,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
 	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 
-      unlock_and_exit:
+unlock_and_exit:
 	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
-      exit:
-	if (ACPI_FAILURE(status))
-		ACPI_EXCEPTION((AE_INFO, status,
-				"Installing notify handler failed"));
 	return_ACPI_STATUS(status);
 }
 
drivers/acpi/acpica/evxfevnt.c +113 -78

353 lines not on this page · raw message

drivers/acpi/acpica/exoparg2.c +0 -27
index 3f3f48b..10e104c 100644
@@ -119,33 +119,6 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
 			status = AE_AML_OPERAND_TYPE;
 			break;
 		}
-#ifdef ACPI_GPE_NOTIFY_CHECK
-		/*
-		 * GPE method wake/notify check.  Here, we want to ensure that we
-		 * don't receive any "DeviceWake" Notifies from a GPE _Lxx or _Exx
-		 * GPE method during system runtime.  If we do, the GPE is marked
-		 * as "wake-only" and disabled.
-		 *
-		 * 1) Is the Notify() value == device_wake?
-		 * 2) Is this a GPE deferred method?  (An _Lxx or _Exx method)
-		 * 3) Did the original GPE happen at system runtime?
-		 *    (versus during wake)
-		 *
-		 * If all three cases are true, this is a wake-only GPE that should
-		 * be disabled at runtime.
-		 */
-		if (value == 2) {	/* device_wake */
-			status =
-			    acpi_ev_check_for_wake_only_gpe(walk_state->
-							    gpe_event_info);
-			if (ACPI_FAILURE(status)) {
-
-				/* AE_WAKE_ONLY_GPE only error, means ignore this notify */
-
-				return_ACPI_STATUS(AE_OK)
-			}
-		}
-#endif
 
 		/*
 		 * Dispatch the notify to the appropriate handler
drivers/acpi/scan.c +1 -1
index 95c90ff..9e5396a 100644
@@ -764,7 +764,7 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
 	}
 
 	status = acpi_get_gpe_status(NULL, device->wakeup.gpe_number,
-					ACPI_NOT_ISR, &event_status);
+					&event_status);
 	if (status == AE_OK)
 		device->wakeup.flags.run_wake =
 				!!(event_status & ACPI_EVENT_FLAG_HANDLE);
drivers/acpi/system.c +2 -3
index 743f244..b6093bc 100644
@@ -302,8 +302,7 @@ static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle)
 				"Invalid GPE 0x%x\n", index));
 			goto end;
 		}
-		result = acpi_get_gpe_status(*handle, index,
-						ACPI_NOT_ISR, status);
+		result = acpi_get_gpe_status(*handle, index, status);
 	} else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS))
 		result = acpi_get_event_status(index - num_gpes, status);
 
@@ -394,7 +393,7 @@ static ssize_t counter_set(struct kobject *kobj,
 			result = acpi_set_gpe(handle, index, ACPI_GPE_ENABLE);
 		else if (!strcmp(buf, "clear\n") &&
 				(status & ACPI_EVENT_FLAG_SET))
-			result = acpi_clear_gpe(handle, index, ACPI_NOT_ISR);
+			result = acpi_clear_gpe(handle, index);
 		else
 			all_counters[index].count = strtoul(buf, NULL, 0);
 	} else if (index < num_gpes + ACPI_NUM_FIXED_EVENTS) {
include/acpi/acexcep.h +1 -1
index 5b2e5e8..5958d78 100644
@@ -87,7 +87,7 @@
 #define AE_NO_GLOBAL_LOCK               (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL)
 #define AE_ABORT_METHOD                 (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL)
 #define AE_SAME_HANDLER                 (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
-#define AE_WAKE_ONLY_GPE                (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
+#define AE_NO_HANDLER                   (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
 #define AE_OWNER_ID_LIMIT               (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
 
 #define AE_CODE_ENV_MAX                 0x001B
include/acpi/acpixf.h +6 -5
index f753222..c82c3b5 100644
@@ -284,16 +284,17 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
  */
 acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action);
 
-acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type);
+acpi_status
+acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type);
 
-acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type);
+acpi_status
+acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type);
 
-acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
+acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number);
 
 acpi_status
 acpi_get_gpe_status(acpi_handle gpe_device,
-		    u32 gpe_number,
-		    u32 flags, acpi_event_status * event_status);
+		    u32 gpe_number, acpi_event_status *event_status);
 
 acpi_status acpi_disable_all_gpes(void);
 
include/acpi/actypes.h +20 -22

64 lines not on this page · raw message

#4 lore raw
Quoted 27 lines · Lin Ming
Quoted 26 lines · Lin Ming
Quoted 13 lines · Rafael J. Wysocki
Quoted 11 lines · Lin Ming

Hi, Rafael

Bob has ported the major GPE changes into ACPICA code base.
http://git.moblin.org/cgit.cgi/acpica/commit/?id=45f0b38a921f3b2af7574d553a6c2e557d0567ed

But Bob's port and your original patch have some differences, so I made below patch to make linux acpica code consistent with ACPICA code base.

I have build and tested it, would you please help to review? If everything is OK, I'll include it in the next linux acpica update and send it to Len.

Quoted 7 lines

While I'm generally fine with the code, it looks like the $subject patch includes the patches I sent earlier (slightly reworked):
https://patchwork.kernel.org/patch/90471/
https://patchwork.kernel.org/patch/86237/

I'll appreciate it if there's a notice in the changelog that the patch is based on them.

We ported your code to ACPICA code base.
I'll add the changelog to notice that.

Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Also, please add my sign-off to the final submission to indicate that some changes in the patch are in fact from me.

Sure.

Hi,

How about below one?

Works for me.

Quoted 19 lines
Quoted 1 line

From d79bb1feba87a22dece4ee7cfc30a2965ab54e02 Mon Sep 17 00:00:00 2001

From: Lin Ming <[email protected]>
Date: Tue, 6 Apr 2010 14:52:37 +0800
Subject: [PATCH] Minimize the differences between linux GPE code and ACPICA code base

We have ported Rafael's major GPE changes
(ACPI: Use GPE reference counting to support shared GPEs) into ACPICA code base. But the port and Rafael's original patch have some differences, so we made below patch to make linux GPE code consistent with ACPICA code base.

Most changes are about comments and coding styles. Other noticeable changes are based on:

Rafael: Reduce code duplication related to GPE lookup
https://patchwork.kernel.org/patch/86237/

Rafeal: Always use the same lock for GPE locking
https://patchwork.kernel.org/patch/90471/

Quoted 8 lines

A new field gpe_count in struct acpi_gpe_block_info to record the number of individual GPEs in block.

Rename acpi_ev_save_method_info to acpi_ev_match_gpe_method.

Thanks,
Rafael