From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932341AbZBNBid (ORCPT ); Fri, 13 Feb 2009 20:38:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762726AbZBNBQe (ORCPT ); Fri, 13 Feb 2009 20:16:34 -0500 Received: from kroah.org ([198.145.64.141]:50430 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1762592AbZBNBQY (ORCPT ); Fri, 13 Feb 2009 20:16:24 -0500 Date: Fri, 13 Feb 2009 17:13:11 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, "David S. Miller" Subject: [patch 26/48] sungem: Soft lockup in sungem on Netra AC200 when switching interface up Message-ID: <20090214011311.GA17706@kroah.com> References: <20090214010805.419403436@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="sungem-soft-lockup-in-sungem-on-netra-ac200-when-switching-interface-up.patch" In-Reply-To: <20090214011208.GA17706@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.28-stable review patch. If anyone has any objections, please let us know. ------------------ From: Ilkka Virta [ Upstream commit 71822faa3bc0af5dbf5e333a2d085f1ed7cd809f ] From: Ilkka Virta In the lockup situation the driver seems to go off in an eternal storm of interrupts right after calling request_irq(). It doesn't actually do anything interesting in the interrupt handler. Since connecting the link afterwards works, something later in initialization must fix this. Looking at gem_do_start() and gem_open(), it seems that the only thing done while opening the device after the request_irq(), is a call to napi_enable(). I don't know what the ordering requirements are for the initialization, but I boldly tried to move the napi_enable() call inside gem_do_start() before the link state is checked and interrupts subsequently enabled, and it seems to work for me. Doesn't even break anything too obvious... Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/sungem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c @@ -2222,6 +2222,8 @@ static int gem_do_start(struct net_devic gp->running = 1; + napi_enable(&gp->napi); + if (gp->lstate == link_up) { netif_carrier_on(gp->dev); gem_set_link_modes(gp); @@ -2239,6 +2241,8 @@ static int gem_do_start(struct net_devic spin_lock_irqsave(&gp->lock, flags); spin_lock(&gp->tx_lock); + napi_disable(&gp->napi); + gp->running = 0; gem_reset(gp); gem_clean_rings(gp); @@ -2339,8 +2343,6 @@ static int gem_open(struct net_device *d if (!gp->asleep) rc = gem_do_start(dev); gp->opened = (rc == 0); - if (gp->opened) - napi_enable(&gp->napi); mutex_unlock(&gp->pm_mutex); @@ -2477,8 +2479,6 @@ static int gem_resume(struct pci_dev *pd /* Re-attach net device */ netif_device_attach(dev); - - napi_enable(&gp->napi); } spin_lock_irqsave(&gp->lock, flags);