All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] acpi-remove-the-wakeuprun_wake_count-device-field.patch removed from -mm tree
@ 2011-02-14 20:19 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2011-02-14 20:19 UTC (permalink / raw)
  To: rjw, jbarnes, lenb, mjg59, mm-commits


The patch titled
     acpi: remove the wakeup.run_wake_count device field
has been removed from the -mm tree.  Its filename was
     acpi-remove-the-wakeuprun_wake_count-device-field.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: acpi: remove the wakeup.run_wake_count device field
From: Rafael J. Wysocki <rjw@sisk.pl>

The wakeup.run_wake_count ACPI device field is only used by the PCI
runtime PM code to "protect" devices from being prepared for generating
wakeup signals more than once in a row.  However, it really doesn't
provide any protection, because (1) all of the functions it is supposed to
protect use their own reference counters effectively ensuring that the
device will be set up for generating wakeup signals just once and (2) the
PCI runtime PM code uses wakeup.run_wake_count in a racy way, since
nothing prevents acpi_dev_run_wake() from being called concurrently from
two different threads for the same device.

Remove the wakeup.run_wake_count ACPI device field which is unnecessary,
confusing and used in a wrong way.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/acpi/button.c   |    2 --
 drivers/acpi/scan.c     |    1 -
 drivers/pci/pci-acpi.c  |   16 ++++------------
 include/acpi/acpi_bus.h |    1 -
 4 files changed, 4 insertions(+), 16 deletions(-)

diff -puN drivers/acpi/button.c~acpi-remove-the-wakeuprun_wake_count-device-field drivers/acpi/button.c
--- a/drivers/acpi/button.c~acpi-remove-the-wakeuprun_wake_count-device-field
+++ a/drivers/acpi/button.c
@@ -430,7 +430,6 @@ static int acpi_button_add(struct acpi_d
 		/* Button's GPE is run-wake GPE */
 		acpi_enable_gpe(device->wakeup.gpe_device,
 				device->wakeup.gpe_number);
-		device->wakeup.run_wake_count++;
 		device_set_wakeup_enable(&device->dev, true);
 	}
 
@@ -453,7 +452,6 @@ static int acpi_button_remove(struct acp
 	if (device->wakeup.flags.valid) {
 		acpi_disable_gpe(device->wakeup.gpe_device,
 				device->wakeup.gpe_number);
-		device->wakeup.run_wake_count--;
 		device_set_wakeup_enable(&device->dev, false);
 	}
 
diff -puN drivers/acpi/scan.c~acpi-remove-the-wakeuprun_wake_count-device-field drivers/acpi/scan.c
--- a/drivers/acpi/scan.c~acpi-remove-the-wakeuprun_wake_count-device-field
+++ a/drivers/acpi/scan.c
@@ -797,7 +797,6 @@ static void acpi_bus_set_run_wake_flags(
 	acpi_status status;
 	acpi_event_status event_status;
 
-	device->wakeup.run_wake_count = 0;
 	device->wakeup.flags.notifier_present = 0;
 
 	/* Power button, Lid switch always enable wakeup */
diff -puN drivers/pci/pci-acpi.c~acpi-remove-the-wakeuprun_wake_count-device-field drivers/pci/pci-acpi.c
--- a/drivers/pci/pci-acpi.c~acpi-remove-the-wakeuprun_wake_count-device-field
+++ a/drivers/pci/pci-acpi.c
@@ -293,19 +293,11 @@ static int acpi_dev_run_wake(struct devi
 	}
 
 	if (enable) {
-		if (!dev->wakeup.run_wake_count++) {
-			acpi_enable_wakeup_device_power(dev, ACPI_STATE_S0);
-			acpi_enable_gpe(dev->wakeup.gpe_device,
-					dev->wakeup.gpe_number);
-		}
-	} else if (dev->wakeup.run_wake_count > 0) {
-		if (!--dev->wakeup.run_wake_count) {
-			acpi_disable_gpe(dev->wakeup.gpe_device,
-					 dev->wakeup.gpe_number);
-			acpi_disable_wakeup_device_power(dev);
-		}
+		acpi_enable_wakeup_device_power(dev, ACPI_STATE_S0);
+		acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number);
 	} else {
-		error = -EALREADY;
+		acpi_disable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number);
+		acpi_disable_wakeup_device_power(dev);
 	}
 
 	return error;
diff -puN include/acpi/acpi_bus.h~acpi-remove-the-wakeuprun_wake_count-device-field include/acpi/acpi_bus.h
--- a/include/acpi/acpi_bus.h~acpi-remove-the-wakeuprun_wake_count-device-field
+++ a/include/acpi/acpi_bus.h
@@ -250,7 +250,6 @@ struct acpi_device_wakeup {
 	struct acpi_handle_list resources;
 	struct acpi_device_wakeup_flags flags;
 	int prepare_count;
-	int run_wake_count;
 };
 
 /* Device */
_

Patches currently in -mm which might be from rjw@sisk.pl are

linux-next.patch
usb-yurex-recognize-generalkeys-wireless-presenter-as-generic-hid.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-14 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14 20:19 [merged] acpi-remove-the-wakeuprun_wake_count-device-field.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.