Re: 2.6.23-rc1-mm1

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Cedric Le Goater <clg@...>, <linux-kernel@...>, Shaohua Li <shaohua.li@...>
Date: Wednesday, July 25, 2007 - 7:26 pm

On Wednesday 25 July 2007 14:58, Andrew Morton wrote:

Maybe simpler for mm1 to go backwards in time rather than forwards.
This should fix the problem at hand.

cheers,
-Len

commit 106994f83cdd97c77bfe1b333ca369560b6d0649
Author: Len Brown <len.brown@intel.com>
Date:   Wed Jul 25 19:17:38 2007 -0400

    ACPI: revert d-states branch from Jun-17 to Jun-19 for 2.6.23-rc1-mm1
    
    Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/sleep/main.c  |   75 ---------------------------------
 drivers/pci/pci-acpi.c     |   28 +-----------
 drivers/pci/pci.c          |    8 +--
 drivers/pci/pci.h          |    2
 drivers/pnp/driver.c       |    5 --
 drivers/pnp/pnpacpi/core.c |   14 ------
 include/acpi/acpi_bus.h    |    2
 include/linux/pnp.h        |    4 -
 8 files changed, 9 insertions(+), 129 deletions(-)

diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index 34abe8e..ada2a6e 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -261,81 +261,6 @@ static struct platform_hibernation_ops acpi_hibernation_ops = {
 };
 #endif				/* CONFIG_SOFTWARE_SUSPEND */
 
-/**
- *	acpi_pm_device_sleep_state - return preferred power state of ACPI device
- *		in the system sleep state given by %acpi_target_sleep_state
- *	@dev: device to examine
- *	@wake: if set, the device should be able to wake up the system
- *	@d_min_p: used to store the upper limit of allowed states range
- *	Return value: preferred power state of the device on success, -ENODEV on
- *		failure (ie. if there's no 'struct acpi_device' for @dev)
- *
- *	Find the lowest power (highest number) ACPI device power state that
- *	device @dev can be in while the system is in the sleep state represented
- *	by %acpi_target_sleep_state.  If @wake is nonzero, the device should be
- *	able to wake up the system from this sleep state.  If @d_min_p is set,
- *	the highest power (lowest number) device power state of @dev allowed
- *	in this system sleep state is stored at the location pointed to by it.
- *
- *	The caller must ensure that @dev is valid before using this function.
- *	The caller is also responsible for figuring out if the device is
- *	supposed to be able to wake up the system and passing this information
- *	via @wake.
- */
-
-int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
-{
-	acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
-	struct acpi_device *adev;
-	char acpi_method[] = "_SxD";
-	unsigned long d_min, d_max;
-
-	if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
-		printk(KERN_ERR "ACPI handle has no context!\n");
-		return -ENODEV;
-	}
-
-	acpi_method[2] = '0' + acpi_target_sleep_state;
-	/*
-	 * If the sleep state is S0, we will return D3, but if the device has
-	 * _S0W, we will use the value from _S0W
-	 */
-	d_min = ACPI_STATE_D0;
-	d_max = ACPI_STATE_D3;
-
-	/*
-	 * If present, _SxD methods return the minimum D-state (highest power
-	 * state) we can use for the corresponding S-states.  Otherwise, the
-	 * minimum D-state is D0 (ACPI 3.x).
-	 *
-	 * NOTE: We rely on acpi_evaluate_integer() not clobbering the integer
-	 * provided -- that's our fault recovery, we ignore retval.
-	 */
-	if (acpi_target_sleep_state > ACPI_STATE_S0)
-		acpi_evaluate_integer(handle, acpi_method, NULL, &d_min);
-
-	/*
-	 * If _PRW says we can wake up the system from the target sleep state,
-	 * the D-state returned by _SxD is sufficient for that (we assume a
-	 * wakeup-aware driver if wake is set).  Still, if _SxW exists
-	 * (ACPI 3.x), it should return the maximum (lowest power) D-state that
-	 * can wake the system.  _S0W may be valid, too.
-	 */
-	if (acpi_target_sleep_state == ACPI_STATE_S0 ||
-	    (wake && adev->wakeup.state.enabled &&
-	     adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
-		acpi_method[3] = 'W';
-		acpi_evaluate_integer(handle, acpi_method, NULL, &d_max);
-		/* Sanity check */
-		if (d_max < d_min)
-			d_min = d_max;
-	}
-
-	if (d_min_p)
-		*d_min_p = d_min;
-	return d_max;
-}
-
 /*
  * Toshiba fails to preserve interrupts over S1, reinitialization
  * of 8259 is needed after S1 resume.
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 67c63d1..c806249 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -245,33 +245,16 @@ EXPORT_SYMBOL(pci_osc_control_set);
  * currently we simply return _SxD, if present.
  */
 
-static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,
-	pm_message_t state)
+static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t state)
 {
-	int acpi_state;
-
-	acpi_state = acpi_pm_device_sleep_state(&pdev->dev,
-		device_may_wakeup(&pdev->dev), NULL);
-	if (acpi_state < 0)
-		return PCI_POWER_ERROR;
-
-	switch (acpi_state) {
-	case ACPI_STATE_D0:
-		return PCI_D0;
-	case ACPI_STATE_D1:
-		return PCI_D1;
-	case ACPI_STATE_D2:
-		return PCI_D2;
-	case ACPI_STATE_D3:
-		return PCI_D3hot;
-	}
-	return PCI_POWER_ERROR;
+	/* TBD */
+
+	return -ENODEV;
 }
 
 static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 {
 	acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
-	acpi_handle tmp;
 	static int state_conv[] = {
 		[0] = 0,
 		[1] = 1,
@@ -283,9 +266,6 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 
 	if (!handle)
 		return -ENODEV;
-	/* If the ACPI device has _EJ0, ignore the device */
-	if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp)))
-		return 0;
 	return acpi_bus_set_power(handle, acpi_state);
 }
 
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b731cd1..15632b2 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -499,7 +499,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 	return 0;
 }
 
-pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
+int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
  
 /**
  * pci_choose_state - Choose the power state of a PCI device
@@ -513,15 +513,15 @@ pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state
 
 pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
 {
-	pci_power_t ret;
+	int ret;
 
 	if (!pci_find_capability(dev, PCI_CAP_ID_PM))
 		return PCI_D0;
 
 	if (platform_pci_choose_state) {
 		ret = platform_pci_choose_state(dev, state);
-		if (ret != PCI_POWER_ERROR)
-			return ret;
+		if (ret >= 0)
+			state.event = ret;
 	}
 
 	switch (state.event) {
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 3bdfc3e..5692c3f 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -7,7 +7,7 @@ extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_cleanup_rom(struct pci_dev *dev);
 
 /* Firmware callbacks */
-extern pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
+extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
 extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state);
 
 extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val);
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 1432806..e161423 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -167,8 +167,6 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state)
 	    		return error;
 	}
 
-	if (pnp_dev->protocol && pnp_dev->protocol->suspend)
-		pnp_dev->protocol->suspend(pnp_dev, state);
 	return 0;
 }
 
@@ -181,9 +179,6 @@ static int pnp_bus_resume(struct device *dev)
 	if (!pnp_drv)
 		return 0;
 
-	if (pnp_dev->protocol && pnp_dev->protocol->resume)
-		pnp_dev->protocol->resume(pnp_dev);
-
 	if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) {
 		error = pnp_start_dev(pnp_dev);
 		if (error)
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index c37a558..a005487 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -119,25 +119,11 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev)
 	return ACPI_FAILURE(status) ? -ENODEV : 0;
 }
 
-static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state)
-{
-	return acpi_bus_set_power((acpi_handle)dev->data,
-		acpi_pm_device_sleep_state(&dev->dev,
-		device_may_wakeup(&dev->dev), NULL));
-}
-
-static int pnpacpi_resume(struct pnp_dev *dev)
-{
-	return acpi_bus_set_power((acpi_handle)dev->data, ACPI_STATE_D0);
-}
-
 static struct pnp_protocol pnpacpi_protocol = {
 	.name	= "Plug and Play ACPI",
 	.get	= pnpacpi_get_resources,
 	.set	= pnpacpi_set_resources,
 	.disable = pnpacpi_disable_resources,
-	.suspend = pnpacpi_suspend,
-	.resume = pnpacpi_resume,
 };
 
 static int __init pnpacpi_add_device(struct acpi_device *device)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index a9f73ef..5e3dcf3 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -365,8 +365,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer);
 acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
 #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
 
-int acpi_pm_device_sleep_state(struct device *, int, int *);
-
 #endif				/* CONFIG_ACPI */
 
 #endif /*__ACPI_BUS_H__*/
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 66edb22..2a1897e 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -335,10 +335,6 @@ struct pnp_protocol {
 	int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res);
 	int (*disable)(struct pnp_dev *dev);
 
-	/* protocol specific suspend/resume */
-	int (*suspend)(struct pnp_dev *dev, pm_message_t state);
-	int (*resume)(struct pnp_dev *dev);
-
 	/* used by pnp layer only (look but don't touch) */
 	unsigned char		number;		/* protocol number*/
 	struct device		dev;		/* link to driver model */
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 7:03 am)
Re: 2.6.23-rc1-mm1, Grant Wilson, (Sun Jul 29, 11:49 am)
Re: 2.6.23-rc1-mm1, Dave Young, (Mon Jul 30, 5:58 am)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Mon Jul 30, 2:27 pm)
Re: 2.6.23-rc1-mm1, Christoph Hellwig, (Mon Jul 30, 2:42 pm)
Re: 2.6.23-rc1-mm1, Satyam Sharma, (Mon Jul 30, 6:18 pm)
Re: 2.6.23-rc1-mm1, Dave Young, (Mon Jul 30, 9:21 pm)
[-mm patch] security/ cleanups, Adrian Bunk, (Sun Jul 29, 11:00 am)
Re: [-mm patch] security/ cleanups, James Morris, (Mon Jul 30, 7:47 am)
[-mm patch] make struct sdio_dev_attrs[] static, Adrian Bunk, (Sun Jul 29, 10:58 am)
Re: [-mm patch] make struct sdio_dev_attrs[] static, Pierre Ossman, (Sun Jul 29, 3:29 pm)
[-mm patch] kernel/pid.c: remove unused exports, Adrian Bunk, (Sun Jul 29, 10:59 am)
[-mm patch] make scsi_host_link_pm_policy() static, Adrian Bunk, (Sun Jul 29, 10:58 am)
Re: [-mm patch] USB: make dev_attr_authorized_default static, Inaky Perez-Gonzalez, (Tue Jul 31, 3:13 pm)
[-mm patch] export v4l2_int_device_{,un}register, Adrian Bunk, (Sun Jul 29, 10:59 am)
[-mm patch] kernel/printk.c: make 2 variables static, Adrian Bunk, (Sun Jul 29, 10:59 am)
Re: [-mm patch] kernel/printk.c: make 2 variables static, Randy Dunlap, (Sun Jul 29, 12:51 pm)
[-mm patch] MTD onenand_sim.c: make struct info static, Adrian Bunk, (Sun Jul 29, 10:58 am)
[-mm patch] fs/ecryptfs/: make code static, Adrian Bunk, (Sun Jul 29, 10:57 am)
[-mm patch] make hugetlbfs_read() static, Adrian Bunk, (Sun Jul 29, 10:57 am)
[PATCH -mm] Fix libata warnings with CONFIG_PM=n, Gabriel C, (Sat Jul 28, 3:32 pm)
mm/sparse.c compile error ( Re: 2.6.23-rc1-mm1 ), Gabriel C, (Sat Jul 28, 1:07 pm)
Re: mm/sparse.c compile error ( Re: 2.6.23-rc1-mm1 ), Andrew Morton, (Sat Jul 28, 1:30 pm)
Re: mm/sparse.c compile error ( Re: 2.6.23-rc1-mm1 ), Andy Whitcroft, (Mon Jul 30, 8:16 am)
[PATCH] docs: note about select in kconfig-language.txt, Jarek Poplawski, (Mon Aug 6, 7:51 am)
[-mm patch] xtensa console.c: remove duplicate #include, Frederik Deweerdt, (Fri Jul 27, 9:28 am)
Re: 2.6.23-rc1-mm1 sparsemem_vmemamp fix., KAMEZAWA Hiroyuki, (Thu Jul 26, 8:58 am)
Re: 2.6.23-rc1-mm1 sparsemem_vmemamp fix., Andy Whitcroft, (Thu Jul 26, 10:39 am)
Re: 2.6.23-rc1-mm1 sparsemem_vmemamp fix., Andy Whitcroft, (Thu Jul 26, 10:44 am)
[-mm patch] DMA engine kconfig improvements, Adrian Bunk, (Thu Jul 26, 1:26 am)
RE: [-mm patch] DMA engine kconfig improvements, Nelson, Shannon, (Wed Aug 15, 7:36 pm)
Re: [-mm patch] DMA engine kconfig improvements, Dan Williams, (Fri Aug 3, 10:15 pm)
Re: [-mm patch] DMA engine kconfig improvements, Adrian Bunk, (Thu Aug 9, 8:43 pm)
2.6.23-rc1-mm1: git-kgdb breaks sh compilation, Adrian Bunk, (Wed Jul 25, 5:17 pm)
Re: 2.6.23-rc1-mm1: git-kgdb breaks sh compilation, Paul Mundt, (Wed Jul 25, 9:45 pm)
2.6.23-rc1-mm1: m32r is_init() compile error, Adrian Bunk, (Wed Jul 25, 5:01 pm)
Re: 2.6.23-rc1-mm1, Michal Piotrowski, (Wed Jul 25, 2:48 pm)
Re: 2.6.23-rc1-mm1, Sam Ravnborg, (Wed Jul 25, 2:53 pm)
Re: 2.6.23-rc1-mm1, H. Peter Anvin, (Wed Jul 25, 3:18 pm)
Re: 2.6.23-rc1-mm1, Gabriel C, (Wed Jul 25, 4:58 pm)
Re: 2.6.23-rc1-mm1, Gabriel C, (Wed Jul 25, 5:05 pm)
Re: 2.6.23-rc1-mm1, Greg KH, (Wed Jul 25, 8:07 pm)
Re: 2.6.23-rc1-mm1, Dave Hansen, (Thu Jul 26, 4:18 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 8:28 pm)
Re: 2.6.23-rc1-mm1, Dave Young, (Wed Jul 25, 9:55 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 10:23 pm)
Re: 2.6.23-rc1-mm1, H. Peter Anvin, (Wed Jul 25, 5:11 pm)
Re: 2.6.23-rc1-mm1, Gabriel C, (Wed Jul 25, 5:13 pm)
Re: 2.6.23-rc1-mm1, Sam Ravnborg, (Wed Jul 25, 3:21 pm)
2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Adrian Bunk, (Wed Jul 25, 2:22 pm)
Re: 2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Edward Shishkin, (Fri Jul 27, 8:35 am)
Re: 2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Richard Purdie, (Fri Jul 27, 11:11 am)
Re: 2.6.23-rc1-mm1: reiser4 &lt;-&gt; lzo compile error, Edward Shishkin, (Wed Jul 25, 2:44 pm)
2.6.23-rc1-mm1: net/ipv4/fib_trie.c compile error, Adrian Bunk, (Wed Jul 25, 2:15 pm)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Andy Whitcroft, (Wed Jul 25, 12:36 pm)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Andy Whitcroft, (Wed Jul 25, 6:41 pm)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Andrew Morton, (Thu Jul 26, 1:56 am)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Yinghai Lu, (Thu Jul 26, 1:53 pm)
2.6.23-rc1-mm1: SCSI_SRP_ATTRS compile error, Adrian Bunk, (Wed Jul 25, 2:06 pm)
Re: 2.6.23-rc1-mm1: SCSI_SRP_ATTRS compile error, FUJITA Tomonori, (Thu Jul 26, 6:49 am)
Re: 2.6.23-rc1-mm1 -- mostly fails to build, Sam Ravnborg, (Wed Jul 25, 1:04 pm)
Re: 2.6.23-rc1-mm1, Michal Piotrowski, (Wed Jul 25, 12:32 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 5:56 pm)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Wed Jul 25, 8:55 am)
Re: 2.6.23-rc1-mm1: chipsfb_pci_suspend problem, Rafael J. Wysocki, (Wed Jul 25, 9:48 am)
Re: 2.6.23-rc1-mm1: chipsfb_pci_suspend problem, Andrew Morton, (Wed Jul 25, 4:22 pm)
Re: 2.6.23-rc1-mm1: chipsfb_pci_suspend problem, Pavel Machek, (Wed Jul 25, 6:45 pm)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Wed Jul 25, 8:40 am)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 4:05 pm)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Wed Jul 25, 8:25 am)
Re: 2.6.23-rc1-mm1, Len Brown, (Wed Jul 25, 1:23 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 2:58 pm)
Re: 2.6.23-rc1-mm1, Len Brown, (Wed Jul 25, 7:26 pm)
Re: 2.6.23-rc1-mm1, Mel Gorman, (Thu Jul 26, 5:41 am)
Re: 2.6.23-rc1-mm1, Cedric Le Goater, (Thu Jul 26, 9:53 am)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Wed Jul 25, 3:13 pm)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Wed Jul 25, 4:22 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Wed Jul 25, 4:36 pm)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Wed Jul 25, 5:52 pm)
Re: 2.6.23-rc1-mm1, Andrew Morton, (Thu Jul 26, 3:25 am)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Thu Jul 26, 1:54 pm)
Re: 2.6.23-rc1-mm1, Torsten Kaiser, (Sat Jul 28, 10:03 am)