From patchwork Sat Oct 22 12:56:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clemens Buchacher X-Patchwork-Id: 121183 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4363F1007D3 for ; Sun, 23 Oct 2011 00:26:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754415Ab1JVN0d (ORCPT ); Sat, 22 Oct 2011 09:26:33 -0400 Received: from bsmtp5.bon.at ([195.3.86.187]:39025 "EHLO lbmfmo03.bon.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753527Ab1JVN0c (ORCPT ); Sat, 22 Oct 2011 09:26:32 -0400 X-Greylist: delayed 1839 seconds by postgrey-1.27 at vger.kernel.org; Sat, 22 Oct 2011 09:26:31 EDT Received: from bsmtp.bon.at (unknown [192.168.181.104]) by lbmfmo03.bon.at (Postfix) with ESMTP id 34C99CE0CC; Sat, 22 Oct 2011 14:56:11 +0200 (CEST) Received: from localhost (unknown [80.123.242.182]) by bsmtp.bon.at (Postfix) with ESMTP id 5EE89130047; Sat, 22 Oct 2011 14:55:49 +0200 (CEST) Date: Sat, 22 Oct 2011 14:56:20 +0200 From: Clemens Buchacher To: Guo-Fu Tseng Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Adrian Chadd , Mohammed Shafi Subject: [PATCH] jme: fix irq storm after suspend/resume Message-ID: <20111022125620.GA2256@ecki.lan> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Helped-by: Mohammed Shafi Signed-off-by: Clemens Buchacher --- 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))