From patchwork Fri Jul 10 12:06:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Inderbitzin X-Patchwork-Id: 493767 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1405F1402B5 for ; Fri, 10 Jul 2015 22:41:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=E5noVJy7; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 945084A03A; Fri, 10 Jul 2015 14:41:38 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a8Lqvh2OYDDT; Fri, 10 Jul 2015 14:41:38 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 25AD94B615; Fri, 10 Jul 2015 14:41:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC2144B615 for ; Fri, 10 Jul 2015 14:06:23 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qnZlcW6F-Ndd for ; Fri, 10 Jul 2015 14:06:23 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by theia.denx.de (Postfix) with ESMTPS id 3BF6F4A03A for ; Fri, 10 Jul 2015 14:06:19 +0200 (CEST) Received: by wicmz13 with SMTP id mz13so12044344wic.0 for ; Fri, 10 Jul 2015 05:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=w/aVEeOo3YrxcXQFAu8imfWIdFqcnaEThJJ/i1/KPow=; b=E5noVJy7VrFat1UAQzgp2mSNVnYVj6NphaH3Ru0Zj2aHzRJK/TSrRAkkpd0o7yWMHU RzjtI3b6JPuhpPJap5rpJFX+Z39oIfKnE6W2Kre4fUiGLqX/UJy+ZPX5hRWQMnLylMQZ pQ/4MFu6/xTZIH6TVYkIKJZaGgN1sAzsQPQZsN5RTrvlgn8bU2MbYtwCvjrK3yQIcypG dLCZOxNy4vUPG/DRiIxBCkFVSvJvTWkCHxETt1Sx/Pj9SoNdktMmSb5xhHyzfil+QbOF UBtn40Sq71X8gxNQh75hdVJfbnIKUKB0OdwqADhEbK21WOBDf7V15uUybYxceu6kwOvO F3kg== X-Received: by 10.194.185.146 with SMTP id fc18mr38672900wjc.46.1436529979129; Fri, 10 Jul 2015 05:06:19 -0700 (PDT) Received: from localhost.localdomain (119.154.198.178.dynamic.wline.res.cust.swisscom.ch. [178.198.154.119]) by smtp.googlemail.com with ESMTPSA id u7sm2658504wif.3.2015.07.10.05.06.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Jul 2015 05:06:18 -0700 (PDT) From: Daniel Inderbitzin To: U-Boot Mailing List Date: Fri, 10 Jul 2015 14:06:02 +0200 Message-Id: <1436529962-3880-1-git-send-email-daniel.inderbitzin@gmail.com> X-Mailer: git-send-email 2.4.5 X-Mailman-Approved-At: Fri, 10 Jul 2015 14:41:32 +0200 Cc: Tom Rini , Shaohui Xie , Joe Hershberger , York Sun , Daniel Inderbitzin Subject: [U-Boot] [PATCH] qoriq eth.c bugfix: handle received corrupted frames correctly X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Daniel Inderbitzin The rxbd is not correctly handled in case of a frame physical error (FPE) or frame size error (FSE). The rxbd must be cleared and advanced in case of an error to avoid receive stall. Signed-off-by: Daniel Inderbitzin --- drivers/net/fm/eth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index d7a37f3..6702f5a 100644 --- a/drivers/net/fm/eth.c +++ b/drivers/net/fm/eth.c @@ -520,6 +520,7 @@ static int fm_eth_recv(struct eth_device *dev) u16 status, len; u8 *data; u16 offset_out; + int ret = 1; fm_eth = (struct fm_eth *)dev->priv; pram = fm_eth->rx_pram; @@ -533,7 +534,7 @@ static int fm_eth_recv(struct eth_device *dev) net_process_received_packet(data, len); } else { printf("%s: Rx error\n", dev->name); - return 0; + ret = 0; } /* clear the RxBDs */ @@ -559,7 +560,7 @@ static int fm_eth_recv(struct eth_device *dev) } fm_eth->cur_rxbd = (void *)rxbd; - return 1; + return ret; } static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)