From patchwork Wed Jan 30 08:37:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nimrod Andy X-Patchwork-Id: 216781 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 E8F412C007A for ; Wed, 30 Jan 2013 19:37:23 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343Ab3A3IhV (ORCPT ); Wed, 30 Jan 2013 03:37:21 -0500 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:29950 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082Ab3A3IhS convert rfc822-to-8bit (ORCPT ); Wed, 30 Jan 2013 03:37:18 -0500 Received: from mail234-va3-R.bigfish.com (10.7.14.238) by VA3EHSOBE013.bigfish.com (10.7.40.63) with Microsoft SMTP Server id 14.1.225.23; Wed, 30 Jan 2013 08:37:17 +0000 Received: from mail234-va3 (localhost [127.0.0.1]) by mail234-va3-R.bigfish.com (Postfix) with ESMTP id 3DAC87C02AB; Wed, 30 Jan 2013 08:37:17 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 1 X-BigFish: VS1(zzbb2dI98dI9371Ic89bhd6eah1454I542I1432I4015I853kzz1ee6h1de0h1202h1e76h1d1ah1d2ahzz17326ah8275bh8275dha509lz2dh2a8h668h839h8e2h8e3h947hd25hf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946hbe9i1155h) Received: from mail234-va3 (localhost.localdomain [127.0.0.1]) by mail234-va3 (MessageSwitch) id 1359535035670751_16060; Wed, 30 Jan 2013 08:37:15 +0000 (UTC) Received: from VA3EHSMHS028.bigfish.com (unknown [10.7.14.240]) by mail234-va3.bigfish.com (Postfix) with ESMTP id A058738008F; Wed, 30 Jan 2013 08:37:15 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS028.bigfish.com (10.7.99.38) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 30 Jan 2013 08:37:15 +0000 Received: from 039-SN2MPN1-022.039d.mgd.msft.net ([169.254.2.139]) by 039-SN1MMR1-002.039d.mgd.msft.net ([10.84.1.15]) with mapi id 14.02.0318.003; Wed, 30 Jan 2013 08:37:15 +0000 From: Duan Fugang-B38611 To: Troy Kisky , Vikram Narayanan CC: "netdev@vger.kernel.org" , Greg Ungerer , "shawn.guo@linaro.org" , LAK , =?iso-8859-1?Q?Uwe_Kleine-K=F6nig?= , Fabio Estevam Subject: RE: i.Mx6Quad - eth0: tx queue full! Thread-Topic: i.Mx6Quad - eth0: tx queue full! Thread-Index: AQHN/X6LPu19yIgQA0y0UD7krs/OY5hfJaIAgAFcTACAACUHAIAA4PfQ Date: Wed, 30 Jan 2013 08:37:14 +0000 Message-ID: <9848F2DB572E5649BA045B288BE08FBE011B0826@039-SN2MPN1-022.039d.mgd.msft.net> References: <5106B7EE.3040603@gmail.com> <5106D5D4.2090200@boundarydevices.com> <5107FA00.2010809@gmail.com> <51081910.4030707@boundarydevices.com> In-Reply-To: <51081910.4030707@boundarydevices.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.192.242.174] MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, all The issue cannot be found kernel 3.0.35 branch: (even run stress test with IPU and VPU) ssh://sw-git01-tx30/git/sw_git/repos/linux-2.6-imx.git branch name: imx_3.0.35 The patch as below: From 91a0c892263e57ecde9e9ff38be3acdb7f66a17f Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Thu, 9 Aug 2012 17:59:44 +0800 Subject: [PATCH] ENGR00180288 - FEC : Fix kernel dump about eth0 Kernel dump when do wifi stress test with suspend and resume as below: eth0: tx queue full!. remove wake up source irq 103 PM: resume of devices complete after 348.934 msecs Restarting tasks ... done. ------------[ cut here ]------------ WARNING: at net/sched/sch_generic.c:255 dev_watchdog+0x284/0x2a8() NETDEV WATCHDOG: eth0 (fec): transmit queue 0 timed out Modules linked in: ar6000 [<8004482c>] (unwind_backtrace+0x0/0xf8) from [<80068cd0>] (warn_slowpath_common+0x4c/0x64) [<80068cd0>] (warn_slowpath_common+0x4c/0x64)from [<80068d7c>] (warn_slowpath_fmt+0x30/0x40) [<80068d7c>] (warn_slowpath_fmt+0x30/0x40) from [<803f0c50>] (dev_watchdog+0x284/0x2a8) [<803f0c50>] (dev_watchdog+0x284/0x2a8) from [<80074430>] (run_timer_softirq+0xec/0x214) [<80074430>] (run_timer_softirq+0xec/0x214) from [<8006e524>] (__do_softirq+0xac/0x140) [<8006e524>] (__do_softirq+0xac/0x140) from [<8006ea60>] (irq_exit+0x94/0x9c) [<8006ea60>] (irq_exit+0x94/0x9c) from [<80039240>] (do_local_timer+0x54/0x70) [<80039240>] (do_local_timer+0x54/0x70) from [<8003ea0c>] (__irq_svc+0x4c/0xe8) Exception stack(0x80a2bf68 to 0x80a2bfb0) bf60: 0000001f 80a3babc 80a2bfb0 00000000 80a2a000 80a7b8e4 bf80: 804befcc 80a3ee7c 1000406a 412fc09a 00000000 00000000 80a81440 80a2bfb0 bfa0: 8003fa64 8003fa68 60000013 ffffffff [<8003ea0c>] (__irq_svc+0x4c/0xe8) from [<8003fa68>] (default_idle+0x24/0x28) [<8003fa68>] (default_idle+0x24/0x28) from [<8003fc60>] (cpu_idle+0xbc/0xfc) [<8003fc60>] (cpu_idle+0xbc/0xfc) from [<80008878>] (start_kernel+0x258/0x29c) [<80008878>] (start_kernel+0x258/0x29c) from [<10008040>] (0x10008040) ---[ end trace 30671ac42e272c2d ]--- But ethernet and system still be alive. In sometime,the issue will cause system hang like "nfs: server 10.192.242.179 not responding, still trying". The root cause is tx buffer descriptors are not cleaned when ethernet resume back. Signed-off-by: Fugang Duan drivers/net/fec.c | 39 ++++++++++++++++++++++++++------------- 1 files changed, 26 insertions(+), 13 deletions(-) diff --git a/drivers/net/fec.c b/drivers/net/fec.c index f007bf0..b1fa464 100755 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -1456,6 +1456,28 @@ static const struct net_device_ops fec_netdev_ops = { #endif }; +/* Init TX buffer descriptors + */ +static void fec_enet_txbd_init(struct net_device *dev) +{ + struct fec_enet_private *fep = netdev_priv(dev); + struct bufdesc *bdp; + int i; + + /* ...and the same for transmit */ + bdp = fep->tx_bd_base; + for (i = 0; i < TX_RING_SIZE; i++) { + + /* Initialize the BD for every fragment in the page. */ + bdp->cbd_sc = 0; + bdp++; + } + + /* Set the last buffer to wrap */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; +} + /* * XXX: We need to clean up on failure exits here. * @@ -1512,19 +1534,8 @@ static int fec_enet_init(struct net_device *ndev) bdp--; bdp->cbd_sc |= BD_SC_WRAP; - /* ...and the same for transmit */ - bdp = fep->tx_bd_base; - for (i = 0; i < TX_RING_SIZE; i++) { - - /* Initialize the BD for every fragment in the page. */ - bdp->cbd_sc = 0; - bdp->cbd_bufaddr = 0; - bdp++; - } - - /* Set the last buffer to wrap */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; + /* Init transmit descriptors */ + fec_enet_txbd_init(ndev); fec_restart(ndev, 0); @@ -1575,6 +1586,8 @@ fec_restart(struct net_device *dev, int duplex) writel(fep->bd_dma, fep->hwp + FEC_R_DES_START); writel((unsigned long)fep->bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE, fep->hwp + FEC_X_DES_START); + /* Reinit transmit descriptors */ + fec_enet_txbd_init(dev); fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; fep->cur_rx = fep->rx_bd_base;