All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sky2: Do not use legacy PCI power management
@ 2010-12-26 18:44 Rafael J. Wysocki
  2010-12-30 18:52 ` [PATCH] skge: " Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2010-12-26 18:44 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Miller, Linux-pm mailing list

From: Rafael J. Wysocki <rjw@sisk.pl>

The sky2 driver uses the legacy PCI power management, so it has to do
some PCI-specific things in its ->suspend() and ->resume() callbacks,
which isn't necessary and should better be done by the PCI
sybsystem-level power management code.  Moreover, it uses
device_set_wakeup_enable() incorrectly (that function should be
used when the WoL setting is changed rather than during suspend).

Convert sky2 to the new PCI power management framework and make it
let the PCI subsystem take care of all the PCI-specific aspects of
device handling during system power transitions.

Tested on a desktop machine with a Marvell 88E8056 PCI-E adapter.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/net/sky2.c |   54 +++++++++++++++++++++++++++--------------------------
 1 file changed, 28 insertions(+), 26 deletions(-)

Index: linux-2.6/drivers/net/sky2.c
===================================================================
--- linux-2.6.orig/drivers/net/sky2.c
+++ linux-2.6/drivers/net/sky2.c
@@ -3398,12 +3398,24 @@ static int sky2_set_wol(struct net_devic
 {
 	struct sky2_port *sky2 = netdev_priv(dev);
 	struct sky2_hw *hw = sky2->hw;
+	bool enable_wakeup = false;
+	int i;
 
 	if ((wol->wolopts & ~sky2_wol_supported(sky2->hw)) ||
 	    !device_can_wakeup(&hw->pdev->dev))
 		return -EOPNOTSUPP;
 
 	sky2->wol = wol->wolopts;
+
+	for (i = 0; i < hw->ports; i++) {
+		struct net_device *dev = hw->dev[i];
+		struct sky2_port *sky2 = netdev_priv(dev);
+
+		if (sky2->wol)
+			enable_wakeup = true;
+	}
+	device_set_wakeup_enable(&hw->pdev->dev, enable_wakeup);
+
 	return 0;
 }
 
@@ -4920,10 +4932,11 @@ static void __devexit sky2_remove(struct
 	pci_set_drvdata(pdev, NULL);
 }
 
-static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
+static int sky2_suspend(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	struct sky2_hw *hw = pci_get_drvdata(pdev);
-	int i, wol = 0;
+	int i;
 
 	if (!hw)
 		return 0;
@@ -4940,41 +4953,24 @@ static int sky2_suspend(struct pci_dev *
 
 		if (sky2->wol)
 			sky2_wol_init(sky2);
-
-		wol |= sky2->wol;
 	}
 
-	device_set_wakeup_enable(&pdev->dev, wol != 0);
-
 	sky2_power_aux(hw);
 	rtnl_unlock();
 
-	pci_save_state(pdev);
-	pci_enable_wake(pdev, pci_choose_state(pdev, state), wol);
-	pci_set_power_state(pdev, pci_choose_state(pdev, state));
-
 	return 0;
 }
 
 #ifdef CONFIG_PM
-static int sky2_resume(struct pci_dev *pdev)
+static int sky2_resume(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	struct sky2_hw *hw = pci_get_drvdata(pdev);
 	int err;
 
 	if (!hw)
 		return 0;
 
-	err = pci_set_power_state(pdev, PCI_D0);
-	if (err)
-		goto out;
-
-	err = pci_restore_state(pdev);
-	if (err)
-		goto out;
-
-	pci_enable_wake(pdev, PCI_D0, 0);
-
 	/* Re-enable all clocks */
 	err = pci_write_config_dword(pdev, PCI_DEV_REG3, 0);
 	if (err) {
@@ -4994,11 +4990,20 @@ out:
 	pci_disable_device(pdev);
 	return err;
 }
+
+static SIMPLE_DEV_PM_OPS(sky2_pm_ops, sky2_suspend, sky2_resume);
+#define SKY2_PM_OPS (&sky2_pm_ops)
+
+#else
+
+#define SKY2_PM_OPS NULL
 #endif
 
 static void sky2_shutdown(struct pci_dev *pdev)
 {
-	sky2_suspend(pdev, PMSG_SUSPEND);
+	sky2_suspend(&pdev->dev);
+	pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
+	pci_set_power_state(pdev, PCI_D3hot);
 }
 
 static struct pci_driver sky2_driver = {
@@ -5006,11 +5011,8 @@ static struct pci_driver sky2_driver = {
 	.id_table = sky2_id_table,
 	.probe = sky2_probe,
 	.remove = __devexit_p(sky2_remove),
-#ifdef CONFIG_PM
-	.suspend = sky2_suspend,
-	.resume = sky2_resume,
-#endif
 	.shutdown = sky2_shutdown,
+	.driver.pm = SKY2_PM_OPS,
 };
 
 static int __init sky2_init_module(void)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] skge: Do not use legacy PCI power management
  2010-12-26 18:44 [PATCH] sky2: Do not use legacy PCI power management Rafael J. Wysocki
  2010-12-30 18:52 ` [PATCH] skge: " Stephen Hemminger
@ 2010-12-30 18:52 ` Stephen Hemminger
  2010-12-30 22:50   ` Rafael J. Wysocki
  2010-12-30 22:50   ` Rafael J. Wysocki
  2010-12-31 18:15 ` [PATCH] sky2: " Stephen Hemminger
  2010-12-31 18:15 ` Stephen Hemminger
  3 siblings, 2 replies; 10+ messages in thread
From: Stephen Hemminger @ 2010-12-30 18:52 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: netdev, David Miller, Linux-pm mailing list

The skge driver used the legacy PCI power management, and did its
own PCI callbacks.  Use the same code model as Rafael's changes to
sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
device handling during system power transitions.

Compile tested only (so far).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/skge.c	2010-12-30 10:19:01.191095951 -0800
+++ b/drivers/net/skge.c	2010-12-30 10:49:30.780295215 -0800
@@ -4044,53 +4044,40 @@ static void __devexit skge_remove(struct
 }
 
 #ifdef CONFIG_PM
-static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
+static int skge_suspend(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
-	int i, err, wol = 0;
+	int i;
 
 	if (!hw)
 		return 0;
 
-	err = pci_save_state(pdev);
-	if (err)
-		return err;
-
 	for (i = 0; i < hw->ports; i++) {
 		struct net_device *dev = hw->dev[i];
 		struct skge_port *skge = netdev_priv(dev);
 
 		if (netif_running(dev))
 			skge_down(dev);
+
 		if (skge->wol)
 			skge_wol_init(skge);
-
-		wol |= skge->wol;
 	}
 
 	skge_write32(hw, B0_IMSK, 0);
 
-	pci_prepare_to_sleep(pdev);
-
 	return 0;
 }
 
-static int skge_resume(struct pci_dev *pdev)
+static int skge_resume(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
 	int i, err;
 
 	if (!hw)
 		return 0;
 
-	err = pci_back_from_sleep(pdev);
-	if (err)
-		goto out;
-
-	err = pci_restore_state(pdev);
-	if (err)
-		goto out;
-
 	err = skge_reset(hw);
 	if (err)
 		goto out;
@@ -4111,12 +4098,19 @@ static int skge_resume(struct pci_dev *p
 out:
 	return err;
 }
+
+static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume);
+#define SKGE_PM_OPS (&skge_pm_ops)
+
+#else
+
+#define SKGE_PM_OPS NULL
 #endif
 
 static void skge_shutdown(struct pci_dev *pdev)
 {
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
-	int i, wol = 0;
+	int i;
 
 	if (!hw)
 		return;
@@ -4127,15 +4121,10 @@ static void skge_shutdown(struct pci_dev
 
 		if (skge->wol)
 			skge_wol_init(skge);
-		wol |= skge->wol;
 	}
 
-	if (pci_enable_wake(pdev, PCI_D3cold, wol))
-		pci_enable_wake(pdev, PCI_D3hot, wol);
-
-	pci_disable_device(pdev);
+	pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
 	pci_set_power_state(pdev, PCI_D3hot);
-
 }
 
 static struct pci_driver skge_driver = {
@@ -4143,11 +4132,8 @@ static struct pci_driver skge_driver = {
 	.id_table =     skge_id_table,
 	.probe =        skge_probe,
 	.remove =       __devexit_p(skge_remove),
-#ifdef CONFIG_PM
-	.suspend = 	skge_suspend,
-	.resume = 	skge_resume,
-#endif
 	.shutdown =	skge_shutdown,
+	.driver.pm =	SKGE_PM_OPS,
 };
 
 static struct dmi_system_id skge_32bit_dma_boards[] = {

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] skge: Do not use legacy PCI power management
  2010-12-26 18:44 [PATCH] sky2: Do not use legacy PCI power management Rafael J. Wysocki
@ 2010-12-30 18:52 ` Stephen Hemminger
  2010-12-30 18:52 ` Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2010-12-30 18:52 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: netdev, Linux-pm mailing list, David Miller

The skge driver used the legacy PCI power management, and did its
own PCI callbacks.  Use the same code model as Rafael's changes to
sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
device handling during system power transitions.

Compile tested only (so far).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/skge.c	2010-12-30 10:19:01.191095951 -0800
+++ b/drivers/net/skge.c	2010-12-30 10:49:30.780295215 -0800
@@ -4044,53 +4044,40 @@ static void __devexit skge_remove(struct
 }
 
 #ifdef CONFIG_PM
-static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
+static int skge_suspend(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
-	int i, err, wol = 0;
+	int i;
 
 	if (!hw)
 		return 0;
 
-	err = pci_save_state(pdev);
-	if (err)
-		return err;
-
 	for (i = 0; i < hw->ports; i++) {
 		struct net_device *dev = hw->dev[i];
 		struct skge_port *skge = netdev_priv(dev);
 
 		if (netif_running(dev))
 			skge_down(dev);
+
 		if (skge->wol)
 			skge_wol_init(skge);
-
-		wol |= skge->wol;
 	}
 
 	skge_write32(hw, B0_IMSK, 0);
 
-	pci_prepare_to_sleep(pdev);
-
 	return 0;
 }
 
-static int skge_resume(struct pci_dev *pdev)
+static int skge_resume(struct device *dev)
 {
+	struct pci_dev *pdev = to_pci_dev(dev);
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
 	int i, err;
 
 	if (!hw)
 		return 0;
 
-	err = pci_back_from_sleep(pdev);
-	if (err)
-		goto out;
-
-	err = pci_restore_state(pdev);
-	if (err)
-		goto out;
-
 	err = skge_reset(hw);
 	if (err)
 		goto out;
@@ -4111,12 +4098,19 @@ static int skge_resume(struct pci_dev *p
 out:
 	return err;
 }
+
+static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume);
+#define SKGE_PM_OPS (&skge_pm_ops)
+
+#else
+
+#define SKGE_PM_OPS NULL
 #endif
 
 static void skge_shutdown(struct pci_dev *pdev)
 {
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
-	int i, wol = 0;
+	int i;
 
 	if (!hw)
 		return;
@@ -4127,15 +4121,10 @@ static void skge_shutdown(struct pci_dev
 
 		if (skge->wol)
 			skge_wol_init(skge);
-		wol |= skge->wol;
 	}
 
-	if (pci_enable_wake(pdev, PCI_D3cold, wol))
-		pci_enable_wake(pdev, PCI_D3hot, wol);
-
-	pci_disable_device(pdev);
+	pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
 	pci_set_power_state(pdev, PCI_D3hot);
-
 }
 
 static struct pci_driver skge_driver = {
@@ -4143,11 +4132,8 @@ static struct pci_driver skge_driver = {
 	.id_table =     skge_id_table,
 	.probe =        skge_probe,
 	.remove =       __devexit_p(skge_remove),
-#ifdef CONFIG_PM
-	.suspend = 	skge_suspend,
-	.resume = 	skge_resume,
-#endif
 	.shutdown =	skge_shutdown,
+	.driver.pm =	SKGE_PM_OPS,
 };
 
 static struct dmi_system_id skge_32bit_dma_boards[] = {

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] skge: Do not use legacy PCI power management
  2010-12-30 18:52 ` Stephen Hemminger
  2010-12-30 22:50   ` Rafael J. Wysocki
@ 2010-12-30 22:50   ` Rafael J. Wysocki
  2010-12-31 20:50     ` David Miller
  2010-12-31 20:50     ` David Miller
  1 sibling, 2 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2010-12-30 22:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, David Miller, Linux-pm mailing list

On Thursday, December 30, 2010, Stephen Hemminger wrote:
> The skge driver used the legacy PCI power management, and did its
> own PCI callbacks.  Use the same code model as Rafael's changes to
> sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
> device handling during system power transitions.
> 
> Compile tested only (so far).
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>

> --- a/drivers/net/skge.c	2010-12-30 10:19:01.191095951 -0800
> +++ b/drivers/net/skge.c	2010-12-30 10:49:30.780295215 -0800
> @@ -4044,53 +4044,40 @@ static void __devexit skge_remove(struct
>  }
>  
>  #ifdef CONFIG_PM
> -static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
> +static int skge_suspend(struct device *dev)
>  {
> +	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct skge_hw *hw  = pci_get_drvdata(pdev);
> -	int i, err, wol = 0;
> +	int i;
>  
>  	if (!hw)
>  		return 0;
>  
> -	err = pci_save_state(pdev);
> -	if (err)
> -		return err;
> -
>  	for (i = 0; i < hw->ports; i++) {
>  		struct net_device *dev = hw->dev[i];
>  		struct skge_port *skge = netdev_priv(dev);
>  
>  		if (netif_running(dev))
>  			skge_down(dev);
> +
>  		if (skge->wol)
>  			skge_wol_init(skge);
> -
> -		wol |= skge->wol;
>  	}
>  
>  	skge_write32(hw, B0_IMSK, 0);
>  
> -	pci_prepare_to_sleep(pdev);
> -
>  	return 0;
>  }
>  
> -static int skge_resume(struct pci_dev *pdev)
> +static int skge_resume(struct device *dev)
>  {
> +	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct skge_hw *hw  = pci_get_drvdata(pdev);
>  	int i, err;
>  
>  	if (!hw)
>  		return 0;
>  
> -	err = pci_back_from_sleep(pdev);
> -	if (err)
> -		goto out;
> -
> -	err = pci_restore_state(pdev);
> -	if (err)
> -		goto out;
> -
>  	err = skge_reset(hw);
>  	if (err)
>  		goto out;
> @@ -4111,12 +4098,19 @@ static int skge_resume(struct pci_dev *p
>  out:
>  	return err;
>  }
> +
> +static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume);
> +#define SKGE_PM_OPS (&skge_pm_ops)
> +
> +#else
> +
> +#define SKGE_PM_OPS NULL
>  #endif
>  
>  static void skge_shutdown(struct pci_dev *pdev)
>  {
>  	struct skge_hw *hw  = pci_get_drvdata(pdev);
> -	int i, wol = 0;
> +	int i;
>  
>  	if (!hw)
>  		return;
> @@ -4127,15 +4121,10 @@ static void skge_shutdown(struct pci_dev
>  
>  		if (skge->wol)
>  			skge_wol_init(skge);
> -		wol |= skge->wol;
>  	}
>  
> -	if (pci_enable_wake(pdev, PCI_D3cold, wol))
> -		pci_enable_wake(pdev, PCI_D3hot, wol);
> -
> -	pci_disable_device(pdev);
> +	pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
>  	pci_set_power_state(pdev, PCI_D3hot);
> -
>  }
>  
>  static struct pci_driver skge_driver = {
> @@ -4143,11 +4132,8 @@ static struct pci_driver skge_driver = {
>  	.id_table =     skge_id_table,
>  	.probe =        skge_probe,
>  	.remove =       __devexit_p(skge_remove),
> -#ifdef CONFIG_PM
> -	.suspend = 	skge_suspend,
> -	.resume = 	skge_resume,
> -#endif
>  	.shutdown =	skge_shutdown,
> +	.driver.pm =	SKGE_PM_OPS,
>  };
>  
>  static struct dmi_system_id skge_32bit_dma_boards[] = {
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] skge: Do not use legacy PCI power management
  2010-12-30 18:52 ` Stephen Hemminger
@ 2010-12-30 22:50   ` Rafael J. Wysocki
  2010-12-30 22:50   ` Rafael J. Wysocki
  1 sibling, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2010-12-30 22:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Linux-pm mailing list, David Miller

On Thursday, December 30, 2010, Stephen Hemminger wrote:
> The skge driver used the legacy PCI power management, and did its
> own PCI callbacks.  Use the same code model as Rafael's changes to
> sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
> device handling during system power transitions.
> 
> Compile tested only (so far).
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>

> --- a/drivers/net/skge.c	2010-12-30 10:19:01.191095951 -0800
> +++ b/drivers/net/skge.c	2010-12-30 10:49:30.780295215 -0800
> @@ -4044,53 +4044,40 @@ static void __devexit skge_remove(struct
>  }
>  
>  #ifdef CONFIG_PM
> -static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
> +static int skge_suspend(struct device *dev)
>  {
> +	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct skge_hw *hw  = pci_get_drvdata(pdev);
> -	int i, err, wol = 0;
> +	int i;
>  
>  	if (!hw)
>  		return 0;
>  
> -	err = pci_save_state(pdev);
> -	if (err)
> -		return err;
> -
>  	for (i = 0; i < hw->ports; i++) {
>  		struct net_device *dev = hw->dev[i];
>  		struct skge_port *skge = netdev_priv(dev);
>  
>  		if (netif_running(dev))
>  			skge_down(dev);
> +
>  		if (skge->wol)
>  			skge_wol_init(skge);
> -
> -		wol |= skge->wol;
>  	}
>  
>  	skge_write32(hw, B0_IMSK, 0);
>  
> -	pci_prepare_to_sleep(pdev);
> -
>  	return 0;
>  }
>  
> -static int skge_resume(struct pci_dev *pdev)
> +static int skge_resume(struct device *dev)
>  {
> +	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct skge_hw *hw  = pci_get_drvdata(pdev);
>  	int i, err;
>  
>  	if (!hw)
>  		return 0;
>  
> -	err = pci_back_from_sleep(pdev);
> -	if (err)
> -		goto out;
> -
> -	err = pci_restore_state(pdev);
> -	if (err)
> -		goto out;
> -
>  	err = skge_reset(hw);
>  	if (err)
>  		goto out;
> @@ -4111,12 +4098,19 @@ static int skge_resume(struct pci_dev *p
>  out:
>  	return err;
>  }
> +
> +static SIMPLE_DEV_PM_OPS(skge_pm_ops, skge_suspend, skge_resume);
> +#define SKGE_PM_OPS (&skge_pm_ops)
> +
> +#else
> +
> +#define SKGE_PM_OPS NULL
>  #endif
>  
>  static void skge_shutdown(struct pci_dev *pdev)
>  {
>  	struct skge_hw *hw  = pci_get_drvdata(pdev);
> -	int i, wol = 0;
> +	int i;
>  
>  	if (!hw)
>  		return;
> @@ -4127,15 +4121,10 @@ static void skge_shutdown(struct pci_dev
>  
>  		if (skge->wol)
>  			skge_wol_init(skge);
> -		wol |= skge->wol;
>  	}
>  
> -	if (pci_enable_wake(pdev, PCI_D3cold, wol))
> -		pci_enable_wake(pdev, PCI_D3hot, wol);
> -
> -	pci_disable_device(pdev);
> +	pci_wake_from_d3(pdev, device_may_wakeup(&pdev->dev));
>  	pci_set_power_state(pdev, PCI_D3hot);
> -
>  }
>  
>  static struct pci_driver skge_driver = {
> @@ -4143,11 +4132,8 @@ static struct pci_driver skge_driver = {
>  	.id_table =     skge_id_table,
>  	.probe =        skge_probe,
>  	.remove =       __devexit_p(skge_remove),
> -#ifdef CONFIG_PM
> -	.suspend = 	skge_suspend,
> -	.resume = 	skge_resume,
> -#endif
>  	.shutdown =	skge_shutdown,
> +	.driver.pm =	SKGE_PM_OPS,
>  };
>  
>  static struct dmi_system_id skge_32bit_dma_boards[] = {
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: Do not use legacy PCI power management
  2010-12-26 18:44 [PATCH] sky2: Do not use legacy PCI power management Rafael J. Wysocki
  2010-12-30 18:52 ` [PATCH] skge: " Stephen Hemminger
  2010-12-30 18:52 ` Stephen Hemminger
@ 2010-12-31 18:15 ` Stephen Hemminger
  2010-12-31 19:14   ` David Miller
  2010-12-31 18:15 ` Stephen Hemminger
  3 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2010-12-31 18:15 UTC (permalink / raw)
  To: Rafael J. Wysocki, David Miller
  Cc: netdev, Stephen Hemminger, Linux-pm mailing list

On Sun, 26 Dec 2010 19:44:32 +0100
"Rafael J. Wysocki" <rjw@sisk.pl> wrote:

> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> The sky2 driver uses the legacy PCI power management, so it has to do
> some PCI-specific things in its ->suspend() and ->resume() callbacks,
> which isn't necessary and should better be done by the PCI
> sybsystem-level power management code.  Moreover, it uses
> device_set_wakeup_enable() incorrectly (that function should be
> used when the WoL setting is changed rather than during suspend).
> 
> Convert sky2 to the new PCI power management framework and make it
> let the PCI subsystem take care of all the PCI-specific aspects of
> device handling during system power transitions.
> 
> Tested on a desktop machine with a Marvell 88E8056 PCI-E adapter.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Tested on 88E8055 (laptop), my desktop machines have video issues and
won't suspend/resume.

Acked-by: Stephen Hemminger <shemminger@vyatta.com>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: Do not use legacy PCI power management
  2010-12-26 18:44 [PATCH] sky2: Do not use legacy PCI power management Rafael J. Wysocki
                   ` (2 preceding siblings ...)
  2010-12-31 18:15 ` [PATCH] sky2: " Stephen Hemminger
@ 2010-12-31 18:15 ` Stephen Hemminger
  3 siblings, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2010-12-31 18:15 UTC (permalink / raw)
  To: Rafael J. Wysocki, David Miller
  Cc: netdev, Linux-pm mailing list, Stephen Hemminger

On Sun, 26 Dec 2010 19:44:32 +0100
"Rafael J. Wysocki" <rjw@sisk.pl> wrote:

> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> The sky2 driver uses the legacy PCI power management, so it has to do
> some PCI-specific things in its ->suspend() and ->resume() callbacks,
> which isn't necessary and should better be done by the PCI
> sybsystem-level power management code.  Moreover, it uses
> device_set_wakeup_enable() incorrectly (that function should be
> used when the WoL setting is changed rather than during suspend).
> 
> Convert sky2 to the new PCI power management framework and make it
> let the PCI subsystem take care of all the PCI-specific aspects of
> device handling during system power transitions.
> 
> Tested on a desktop machine with a Marvell 88E8056 PCI-E adapter.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Tested on 88E8055 (laptop), my desktop machines have video issues and
won't suspend/resume.

Acked-by: Stephen Hemminger <shemminger@vyatta.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: Do not use legacy PCI power management
  2010-12-31 18:15 ` [PATCH] sky2: " Stephen Hemminger
@ 2010-12-31 19:14   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-12-31 19:14 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, linux-pm, shemminger

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 31 Dec 2010 10:15:21 -0800

> On Sun, 26 Dec 2010 19:44:32 +0100
> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> 
>> From: Rafael J. Wysocki <rjw@sisk.pl>
>> 
>> The sky2 driver uses the legacy PCI power management, so it has to do
>> some PCI-specific things in its ->suspend() and ->resume() callbacks,
>> which isn't necessary and should better be done by the PCI
>> sybsystem-level power management code.  Moreover, it uses
>> device_set_wakeup_enable() incorrectly (that function should be
>> used when the WoL setting is changed rather than during suspend).
>> 
>> Convert sky2 to the new PCI power management framework and make it
>> let the PCI subsystem take care of all the PCI-specific aspects of
>> device handling during system power transitions.
>> 
>> Tested on a desktop machine with a Marvell 88E8056 PCI-E adapter.
>> 
>> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> 
> Tested on 88E8055 (laptop), my desktop machines have video issues and
> won't suspend/resume.
> 
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] skge: Do not use legacy PCI power management
  2010-12-30 22:50   ` Rafael J. Wysocki
  2010-12-31 20:50     ` David Miller
@ 2010-12-31 20:50     ` David Miller
  1 sibling, 0 replies; 10+ messages in thread
From: David Miller @ 2010-12-31 20:50 UTC (permalink / raw)
  To: rjw; +Cc: shemminger, netdev, linux-pm

From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Thu, 30 Dec 2010 23:50:01 +0100

> On Thursday, December 30, 2010, Stephen Hemminger wrote:
>> The skge driver used the legacy PCI power management, and did its
>> own PCI callbacks.  Use the same code model as Rafael's changes to
>> sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
>> device handling during system power transitions.
>> 
>> Compile tested only (so far).
>> 
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Acked-by: Rafael J. Wysocki <rjw@sisk.pl>

Applied to net-next-2.6, thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] skge: Do not use legacy PCI power management
  2010-12-30 22:50   ` Rafael J. Wysocki
@ 2010-12-31 20:50     ` David Miller
  2010-12-31 20:50     ` David Miller
  1 sibling, 0 replies; 10+ messages in thread
From: David Miller @ 2010-12-31 20:50 UTC (permalink / raw)
  To: rjw; +Cc: netdev, shemminger, linux-pm

From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Thu, 30 Dec 2010 23:50:01 +0100

> On Thursday, December 30, 2010, Stephen Hemminger wrote:
>> The skge driver used the legacy PCI power management, and did its
>> own PCI callbacks.  Use the same code model as Rafael's changes to
>> sky2. Let the PCI subsystem take care of all the PCI-specific aspects of
>> device handling during system power transitions.
>> 
>> Compile tested only (so far).
>> 
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Acked-by: Rafael J. Wysocki <rjw@sisk.pl>

Applied to net-next-2.6, thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-12-31 20:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-26 18:44 [PATCH] sky2: Do not use legacy PCI power management Rafael J. Wysocki
2010-12-30 18:52 ` [PATCH] skge: " Stephen Hemminger
2010-12-30 18:52 ` Stephen Hemminger
2010-12-30 22:50   ` Rafael J. Wysocki
2010-12-30 22:50   ` Rafael J. Wysocki
2010-12-31 20:50     ` David Miller
2010-12-31 20:50     ` David Miller
2010-12-31 18:15 ` [PATCH] sky2: " Stephen Hemminger
2010-12-31 19:14   ` David Miller
2010-12-31 18:15 ` Stephen Hemminger

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.