* [PATCH] r8169: do not bring device down when suspending
@ 2009-06-11 20:48 Francois Romieu
2009-06-12 0:22 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Francois Romieu @ 2009-06-11 20:48 UTC (permalink / raw)
To: David Miller; +Cc: aeriksson, netdev, Edward Hsu
Stopping all activity through ChipCmd and blindly acking the irqs
is neither nice nor completely needed: the transition to low-power
mode does enough work and it apparently keeps the device in a sane
state.
Patch suggested by a fix for http://bugzilla.kernel.org/show_bug.cgi?id=9512
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Anders Eriksson <aeriksson@fastmail.fm>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 3b19e0c..d354a3a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3808,7 +3808,6 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct rtl8169_private *tp = netdev_priv(dev);
- void __iomem *ioaddr = tp->mmio_addr;
if (!netif_running(dev))
goto out_pci_suspend;
@@ -3816,14 +3815,6 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state)
netif_device_detach(dev);
netif_stop_queue(dev);
- spin_lock_irq(&tp->lock);
-
- rtl8169_asic_down(ioaddr);
-
- rtl8169_rx_missed(dev, ioaddr);
-
- spin_unlock_irq(&tp->lock);
-
out_pci_suspend:
pci_save_state(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev, state),
--
1.6.0.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] r8169: do not bring device down when suspending
2009-06-11 20:48 [PATCH] r8169: do not bring device down when suspending Francois Romieu
@ 2009-06-12 0:22 ` David Miller
2009-06-12 22:50 ` Francois Romieu
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-06-12 0:22 UTC (permalink / raw)
To: romieu; +Cc: aeriksson, netdev, edward_hsu
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 11 Jun 2009 22:48:51 +0200
> Stopping all activity through ChipCmd and blindly acking the irqs
> is neither nice nor completely needed: the transition to low-power
> mode does enough work and it apparently keeps the device in a sane
> state.
>
> Patch suggested by a fix for http://bugzilla.kernel.org/show_bug.cgi?id=9512
>
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Tested-by: Anders Eriksson <aeriksson@fastmail.fm>
This patch does not apply to net-next-2.6
You're patching rtl8169_suspend(), but in net-next-2.6 it does nothing
but call a function named rtl8169_net_suspend() which actually has the
code you seem to be changing.
Please submit a fixed up patch and let me know if you want me to queue
this up to -stable.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] r8169: do not bring device down when suspending
2009-06-12 0:22 ` David Miller
@ 2009-06-12 22:50 ` Francois Romieu
2009-06-13 14:15 ` Anders Eriksson
0 siblings, 1 reply; 6+ messages in thread
From: Francois Romieu @ 2009-06-12 22:50 UTC (permalink / raw)
To: aeriksson; +Cc: netdev, edward_hsu
Anders, can you try davem's net-next +
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3812,22 +3812,11 @@ static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
static void rtl8169_net_suspend(struct net_device *dev)
{
- struct rtl8169_private *tp = netdev_priv(dev);
- void __iomem *ioaddr = tp->mmio_addr;
-
if (!netif_running(dev))
return;
netif_device_detach(dev);
netif_stop_queue(dev);
-
- spin_lock_irq(&tp->lock);
-
- rtl8169_asic_down(ioaddr);
-
- rtl8169_rx_missed(dev, ioaddr);
-
- spin_unlock_irq(&tp->lock);
}
#ifdef CONFIG_PM
@@ -3877,9 +3866,17 @@ static struct dev_pm_ops rtl8169_pm_ops = {
static void rtl_shutdown(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
+ struct rtl8169_private *tp = netdev_priv(dev);
+ void __iomem *ioaddr = tp->mmio_addr;
rtl8169_net_suspend(dev);
+ spin_lock_irq(&tp->lock);
+
+ rtl8169_asic_down(ioaddr);
+
+ spin_unlock_irq(&tp->lock);
+
if (system_state == SYSTEM_POWER_OFF) {
pci_wake_from_d3(pdev, true);
pci_set_power_state(pdev, PCI_D3hot);
If it is easier for you, you can try against 2.6.30 the patch at
http://userweb.kernel.org/~romieu/r8169/2.6.30/20090612-r8169-test.patch
Thanks.
--
Ueimor
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] r8169: do not bring device down when suspending
2009-06-12 22:50 ` Francois Romieu
@ 2009-06-13 14:15 ` Anders Eriksson
0 siblings, 0 replies; 6+ messages in thread
From: Anders Eriksson @ 2009-06-13 14:15 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, edward_hsu
romieu@fr.zoreil.com said:
> If it is easier for you, you can try against 2.6.30 the patch at
> http://userweb.kernel.org/~romieu/r8169/2.6.30/20090612-r8169-test.patch
tested, and it does wake up on broadcasted and unicasted UDP magic packet, but
not any other kinds of packets. More specifically:
(Magic payload, UDP, IP dest link broadcast, eth dest broadcast) ->
wakes up on 'g' and 'b'
(Magic payload, UDP, IP dest unicast, eth dest unicast) ->
wakes up on 'g' and 'b'
(arp: eth broadcast) ->
does NOT wake up on 'b' as expected
Hmmm, maybe 'b' stands for IP broadcast and not eth broadcast? Let's see:
(ping broadcast: icmp, IP dest broadcast, eth dest broadcast) ->
does NOT wake up on 'b'.
As best I can tell, the patch fixes the g case, but something's still broken
for the other cases the device claims to support ('pumb').
-Anders
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] r8169: do not bring device down when suspending
2009-06-17 21:41 Francois Romieu
@ 2009-06-18 1:53 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-06-18 1:53 UTC (permalink / raw)
To: romieu; +Cc: edward_hsu, aeriksson, netdev
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Wed, 17 Jun 2009 23:41:45 +0200
> Stopping all activity through ChipCmd and blindly acking the irqs
> is neither nice nor completely needed: the transition to low-power
> mode does enough work and it apparently keeps the device in a sane
> state.
>
> Patch suggested by a fix for http://bugzilla.kernel.org/show_bug.cgi?id=9512
>
> The rtl_shutdown path is kept unchanged so far.
>
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Tested-by: Anders Eriksson <aeriksson@fastmail.fm>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] r8169: do not bring device down when suspending
@ 2009-06-17 21:41 Francois Romieu
2009-06-18 1:53 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Francois Romieu @ 2009-06-17 21:41 UTC (permalink / raw)
To: David S. Miller; +Cc: Edward Hsu, Anders Eriksson, netdev
Stopping all activity through ChipCmd and blindly acking the irqs
is neither nice nor completely needed: the transition to low-power
mode does enough work and it apparently keeps the device in a sane
state.
Patch suggested by a fix for http://bugzilla.kernel.org/show_bug.cgi?id=9512
The rtl_shutdown path is kept unchanged so far.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Anders Eriksson <aeriksson@fastmail.fm>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 35196fa..4e22462 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3811,22 +3811,11 @@ static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)
static void rtl8169_net_suspend(struct net_device *dev)
{
- struct rtl8169_private *tp = netdev_priv(dev);
- void __iomem *ioaddr = tp->mmio_addr;
-
if (!netif_running(dev))
return;
netif_device_detach(dev);
netif_stop_queue(dev);
-
- spin_lock_irq(&tp->lock);
-
- rtl8169_asic_down(ioaddr);
-
- rtl8169_rx_missed(dev, ioaddr);
-
- spin_unlock_irq(&tp->lock);
}
#ifdef CONFIG_PM
@@ -3876,9 +3865,17 @@ static struct dev_pm_ops rtl8169_pm_ops = {
static void rtl_shutdown(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
+ struct rtl8169_private *tp = netdev_priv(dev);
+ void __iomem *ioaddr = tp->mmio_addr;
rtl8169_net_suspend(dev);
+ spin_lock_irq(&tp->lock);
+
+ rtl8169_asic_down(ioaddr);
+
+ spin_unlock_irq(&tp->lock);
+
if (system_state == SYSTEM_POWER_OFF) {
pci_wake_from_d3(pdev, true);
pci_set_power_state(pdev, PCI_D3hot);
--
1.6.2.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-06-18 1:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-11 20:48 [PATCH] r8169: do not bring device down when suspending Francois Romieu
2009-06-12 0:22 ` David Miller
2009-06-12 22:50 ` Francois Romieu
2009-06-13 14:15 ` Anders Eriksson
2009-06-17 21:41 Francois Romieu
2009-06-18 1:53 ` David Miller
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.