Re: [PATCH 8/9] PCI / ACPI / PM: Platform support for PCI PME wake-up (rev. 7)

Rafael J. Wysocki
2010-02-11T00:56:54Z

On Thursday 11 February 2010, Rafael J. Wysocki wrote:
> On Thursday 11 February 2010, Gary Hade wrote:
> > On Wed, Feb 10, 2010 at 11:58:00PM +0100, Rafael J. Wysocki wrote:
> > > On Wednesday 10 February 2010, Gary Hade wrote:
> ...
> > > > Yes, 6/9 also appeared to be the most likely suspect to me and
> > > > I was already doing what you asked except in the opposite order.
> > > > With 1/9 through 6/9 both the hot-add and hot-remove issues still
> > > > reproduced. After removing 6/9 both issues disappeared.
> > >
> > > Thanks for verifying, I've already started to look for bugs in it.
> >
> > Thanks!
> >
> > >
> > > What's your kernel command line, BTW?
> >
> > root=/dev/disk/by-id/scsi-35000c5000036ffcb-part7 ip=9.47.66.9:9.47.67.50:9.47.66.1:255.255.254.0 resume=/dev/disk/by-id/scsi-35000c50000370247-part3 crashkernel=256M-:128M console=tty0 console=ttyS0,115200 pci=use_crs pci=norom
>
> Thanks. We found a bug in the patch, but it would require you to use a
> specific command line switch to trigger, which you don't use.
>
> I'll let you know if I have anything to test.

OK, please try the patch below on top of [1-6/9].

Rafael

---
drivers/acpi/acpica/evgpeblk.c | 4 ++++
drivers/acpi/acpica/evxface.c | 14 ++++++++++++++
2 files changed, 18 insertions(+)

Index: linux-2.6/drivers/acpi/acpica/evxface.c
===================================================================
--- linux-2.6.orig/drivers/acpi/acpica/evxface.c
+++ linux-2.6/drivers/acpi/acpica/evxface.c
@@ -617,6 +617,13 @@ acpi_install_gpe_handler(acpi_handle gpe
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);
@@ -709,6 +716,13 @@ acpi_remove_gpe_handler(acpi_handle gpe_
return_ACPI_STATUS(status);
}

+ /* Disable the GPE before removing the handler */
+
+ status = acpi_ev_disable_gpe(gpe_event_info);
+ if (ACPI_FAILURE(status)) {
+ goto unlock_and_exit;
+ }
+
/* Remove the handler */

flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
Index: linux-2.6/drivers/acpi/acpica/evgpeblk.c
===================================================================
--- linux-2.6.orig/drivers/acpi/acpica/evgpeblk.c
+++ linux-2.6/drivers/acpi/acpica/evgpeblk.c
@@ -335,6 +335,10 @@ acpi_ev_save_method_info(acpi_handle obj
gpe_event_info->dispatch.method_node =
(struct acpi_namespace_node *)obj_handle;

+ /* Update enable mask, but don't enable the HW GPE as of yet */
+
+ status = acpi_ev_enable_gpe(gpe_event_info, FALSE);
+
ACPI_DEBUG_PRINT((ACPI_DB_LOAD,
"Registered GPE method %s as GPE number 0x%.2X\n",
name, gpe_number));