netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] jme: fix irq storm after suspend/resume
@ 2011-10-22 12:56 Clemens Buchacher
  2011-10-22 13:09 ` Mohammed Shafi
  2011-10-22 16:27 ` Mantas M.
  0 siblings, 2 replies; 4+ messages in thread
From: Clemens Buchacher @ 2011-10-22 12:56 UTC (permalink / raw)
  To: Guo-Fu Tseng; +Cc: netdev, linux-kernel, Adrian Chadd, Mohammed Shafi

If the device is down during suspend/resume, interrupts are enabled
without a registered interrupt handler, causing a storm of
unhandled interrupts until the IRQ is disabled because "nobody
cared".

Instead, check that the device is up before touching it in the
suspend/resume code.

Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112

Helped-by: Adrian Chadd <adrian@freebsd.org>
Helped-by: Mohammed Shafi <shafi.wireless@gmail.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---

Unfortunately, bugzilla.kernel.org is still down. There is at least
one other person who reported the issue, and I don't have their
email address. So for now, I am the only one who tested this fix.

The patch applies to current tip (2efd7c0) of Linus' tree. I also
tested it based on v3.0 and it worked the same.

Many thanks to Adrian and Mohammed for helping me debug this issue.
See this thread for the history:
 http://mid.gmane.org/20110827113253.GA1444@ecki

 drivers/net/jme.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 3ac262f..7a8a3b6 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -3131,6 +3131,9 @@ jme_suspend(struct device *dev)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct jme_adapter *jme = netdev_priv(netdev);
 
+	if (!netif_running(netdev))
+		return 0;
+
 	atomic_dec(&jme->link_changing);
 
 	netif_device_detach(netdev);
@@ -3171,6 +3174,9 @@ jme_resume(struct device *dev)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct jme_adapter *jme = netdev_priv(netdev);
 
+	if (!netif_running(netdev))
+		return 0;
+
 	jme_clear_pm(jme);
 	jme_phy_on(jme);
 	if (test_bit(JME_FLAG_SSET, &jme->flags))
-- 
1.7.7

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

* Re: [PATCH] jme: fix irq storm after suspend/resume
  2011-10-22 12:56 [PATCH] jme: fix irq storm after suspend/resume Clemens Buchacher
@ 2011-10-22 13:09 ` Mohammed Shafi
  2011-10-22 16:27 ` Mantas M.
  1 sibling, 0 replies; 4+ messages in thread
From: Mohammed Shafi @ 2011-10-22 13:09 UTC (permalink / raw)
  To: Clemens Buchacher; +Cc: Guo-Fu Tseng, netdev, linux-kernel, Adrian Chadd

On Sat, Oct 22, 2011 at 6:26 PM, Clemens Buchacher <drizzd@aon.at> wrote:
> If the device is down during suspend/resume, interrupts are enabled
> without a registered interrupt handler, causing a storm of
> unhandled interrupts until the IRQ is disabled because "nobody
> cared".

thank you so much for fixing this. incredible persistence from your side!

>
> Instead, check that the device is up before touching it in the
> suspend/resume code.
>
> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112
>
> Helped-by: Adrian Chadd <adrian@freebsd.org>
> Helped-by: Mohammed Shafi <shafi.wireless@gmail.com>
> Signed-off-by: Clemens Buchacher <drizzd@aon.at>
> ---
>
> Unfortunately, bugzilla.kernel.org is still down. There is at least
> one other person who reported the issue, and I don't have their
> email address. So for now, I am the only one who tested this fix.
>
> The patch applies to current tip (2efd7c0) of Linus' tree. I also
> tested it based on v3.0 and it worked the same.
>
> Many thanks to Adrian and Mohammed for helping me debug this issue.
> See this thread for the history:
>  http://mid.gmane.org/20110827113253.GA1444@ecki
>
>  drivers/net/jme.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/jme.c b/drivers/net/jme.c
> index 3ac262f..7a8a3b6 100644
> --- a/drivers/net/jme.c
> +++ b/drivers/net/jme.c
> @@ -3131,6 +3131,9 @@ jme_suspend(struct device *dev)
>        struct net_device *netdev = pci_get_drvdata(pdev);
>        struct jme_adapter *jme = netdev_priv(netdev);
>
> +       if (!netif_running(netdev))
> +               return 0;
> +
>        atomic_dec(&jme->link_changing);
>
>        netif_device_detach(netdev);
> @@ -3171,6 +3174,9 @@ jme_resume(struct device *dev)
>        struct net_device *netdev = pci_get_drvdata(pdev);
>        struct jme_adapter *jme = netdev_priv(netdev);
>
> +       if (!netif_running(netdev))
> +               return 0;
> +
>        jme_clear_pm(jme);
>        jme_phy_on(jme);
>        if (test_bit(JME_FLAG_SSET, &jme->flags))
> --
> 1.7.7
>
>



-- 
shafi

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

* Re: [PATCH] jme: fix irq storm after suspend/resume
  2011-10-22 12:56 [PATCH] jme: fix irq storm after suspend/resume Clemens Buchacher
  2011-10-22 13:09 ` Mohammed Shafi
@ 2011-10-22 16:27 ` Mantas M.
  2011-10-24  6:58   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Mantas M. @ 2011-10-22 16:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

On 22/10/11 15:56, Clemens Buchacher wrote:
> If the device is down during suspend/resume, interrupts are enabled
> without a registered interrupt handler, causing a storm of
> unhandled interrupts until the IRQ is disabled because "nobody
> cared".
>
> Instead, check that the device is up before touching it in the
> suspend/resume code.
>
> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112

Just tested the patch, suspend/resume works well.

-- 
Mantas M.

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

* Re: [PATCH] jme: fix irq storm after suspend/resume
  2011-10-22 16:27 ` Mantas M.
@ 2011-10-24  6:58   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-10-24  6:58 UTC (permalink / raw)
  To: grawity; +Cc: linux-kernel, netdev

From: "Mantas M." <grawity@gmail.com>
Date: Sat, 22 Oct 2011 19:27:09 +0300

> On 22/10/11 15:56, Clemens Buchacher wrote:
>> If the device is down during suspend/resume, interrupts are enabled
>> without a registered interrupt handler, causing a storm of
>> unhandled interrupts until the IRQ is disabled because "nobody
>> cared".
>>
>> Instead, check that the device is up before touching it in the
>> suspend/resume code.
>>
>> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112
> 
> Just tested the patch, suspend/resume works well.

Applied, thanks.

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

end of thread, other threads:[~2011-10-24  6:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-22 12:56 [PATCH] jme: fix irq storm after suspend/resume Clemens Buchacher
2011-10-22 13:09 ` Mohammed Shafi
2011-10-22 16:27 ` Mantas M.
2011-10-24  6:58   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).