Patchwork r8169: Enable suspend when device is idle from boot.

login
register
mail settings
Submitter Todd Broch
Date Dec. 29, 2011, 6:33 p.m.
Message ID <1325183594-8947-1-git-send-email-tbroch@chromium.org>
Download mbox | patch
Permalink /patch/133590/
State Awaiting Upstream
Delegated to: David Miller
Headers show

Comments

Todd Broch - Dec. 29, 2011, 6:33 p.m.
The r8169 driver supports power management and correctly transitions
from active to suspend when link transitions from connected to
disconnected.  However, if link is not connected at boot the device
remains active after the initial probe.

This change adds a check of the link status to the idle pm_op that
will schedule a suspend if inactive.

Signed-off-by: Todd Broch <tbroch@chromium.org>
---
 drivers/net/ethernet/realtek/r8169.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
David Miller - Dec. 30, 2011, 10:22 p.m.
From: Todd Broch <tbroch@chromium.org>
Date: Thu, 29 Dec 2011 10:33:14 -0800

> The r8169 driver supports power management and correctly transitions
> from active to suspend when link transitions from connected to
> disconnected.  However, if link is not connected at boot the device
> remains active after the initial probe.
> 
> This change adds a check of the link status to the idle pm_op that
> will schedule a suspend if inactive.
> 
> Signed-off-by: Todd Broch <tbroch@chromium.org>

Francois, what would you like me to do with this patch?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
fran├žois romieu - Dec. 31, 2011, 12:17 p.m.
David Miller <davem@davemloft.net> :
[...]
> Francois, what would you like me to do with this patch?

I have not tested it yet. I have no objection if a fix must go in now.

There is a slot for some sanity testing this evening.

The description of the patch implies that the initial power management
state is not right. I would be more inclined to set it correctly when
the device goes up instead of checking repeatedly for a loss of sync
through rtl8169_runtime_idle. Todd, any comment ?
David Miller - Dec. 31, 2011, 5:46 p.m.
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Sat, 31 Dec 2011 13:17:04 +0100

> David Miller <davem@davemloft.net> :
> [...]
>> Francois, what would you like me to do with this patch?
> 
> I have not tested it yet. I have no objection if a fix must go in now.

There is no rush with this, I just was seeking your opinion :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 67bf078..3dbb5fd 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6137,6 +6137,7 @@  static int rtl8169_runtime_idle(struct device *device)
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct rtl8169_private *tp = netdev_priv(dev);
 
+	__rtl8169_check_link_status(dev, tp, tp->mmio_addr, true);
 	return tp->TxDescArray ? -EBUSY : 0;
 }