Bug 14925

Summary: sky2 panic under load
Product: Drivers Reporter: Rafael J. Wysocki (rjw)
Component: NetworkAssignee: drivers_network (drivers_network)
Status: CLOSED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.32.1 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 14885    
Attachments: Proposed fix for sky2 panic under load issue

Description Rafael J. Wysocki 2009-12-29 00:17:20 UTC
Subject    : sky2 panic in 2.6.32.1 under load
Submitter  : "Berck E. Nash" <flyboy@gmail.com>
Date       : 2009-12-21 23:52
References : http://marc.info/?l=linux-kernel&m=126143955730347&w=4
References : http://marc.info/?l=linux-kernel&m=126160893126548&w=4
Handled-By : Stephen Hemminger <shemminger@vyatta.com>
Notify-Also : Michael Breuer <mbreuer@majjas.com>
Notify-Also : Daniel Hazelton <dhazelton@enter.net>
Notify-Also : netdev@vger.kernel.org
Notify-Also : Berck Nash <flyboy@gmail.com>

This entry is being used for tracking a regression from 2.6.32.  Please don't
close it until the problem is fixed in the mainline.
Comment 1 Mike McCormack 2009-12-31 12:38:29 UTC
Created attachment 24391 [details]
Proposed fix for sky2 panic under load issue

Does this help?  (Sent to netdev mailing list too)

sky2_xmit_frame appears to be racing with sky2_restart.  The patch should make sure no call to sky2_xmit_frame is in progress after sky2_detach finishes.
Comment 2 Rafael J. Wysocki 2010-01-11 19:27:31 UTC
On Monday 11 January 2010, Berck E. Nash wrote:
> Rafael J. Wysocki wrote:
> > This message has been generated automatically as a part of a report
> > of recent regressions.
> > 
> > The following bug entry is on the current list of known regressions
> > from 2.6.32.  Please verify if it still should be listed and let me know
> > (either way).
> > 
> > 
> > Bug-Entry   : http://bugzilla.kernel.org/show_bug.cgi?id=14925
> > Subject             : sky2 panic under load
> > Submitter   : Berck E. Nash <flyboy@gmail.com>
> > Date                : 2009-12-21 23:52 (21 days old)
> > References  : http://marc.info/?l=linux-kernel&m=126143955730347&w=4
> >               http://marc.info/?l=linux-kernel&m=126160893126548&w=4
> > Handled-By  : Stephen Hemminger <shemminger@vyatta.com>
> 
> The patch attached to the bug report did not fix the problem, but I'm
> fairly certain that this one from Jarek P. did:
> 
> During TX timeout procedure dev could be awoken too early, e.g. by
> sky2_complete_tx() called from sky2_down(). Then sky2_xmit_frame()
> can run while buffers are freed causing an oops. This patch fixes it
> by adding netif_device_present() test in sky2_tx_complete().
> 
> Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=14925
> 
> With debugging by: Mike McCormack <mikem@ring3k.org>
> 
> Reported-by: Berck E. Nash <flyboy@gmail.com>
> Tested-by: Berck E. Nash <flyboy@gmail.com>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
> 
> ---
> 
>  drivers/net/sky2.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index 1c01b96..7650f73 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -1844,7 +1844,8 @@ static void sky2_tx_complete(struct sky2_port
> *sky2, u16 done)
>       sky2->tx_cons = idx;
>       smp_mb();
> 
> -     if (tx_avail(sky2) > MAX_SKB_TX_LE + 4)
> +     /* Wake unless it's detached, and called e.g. from sky2_down() */
> +     if (tx_avail(sky2) > MAX_SKB_TX_LE + 4 && netif_device_present(dev))
>               netif_wake_queue(dev);
>  }
Comment 3 Rafael J. Wysocki 2010-01-11 19:28:53 UTC
Patch : http://marc.info/?l=linux-netdev&m=126317022103883&w=4
Handled-By : Jarek Poplawski <jarkao2@gmail.com>
Comment 4 Rafael J. Wysocki 2010-01-24 21:51:34 UTC
Fixed by commit 9db2f1bec36805e57a003f7bb90e003815d96de8.