Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1291841 > unrolled thread

[PATCH] 82xx: FCC: Fixing a bug causing to FCC port lock-up

Started byMartin Roth <martin.roth@motorolasolutions.com>
First post2015-12-15 05:50 +0100
Last post2015-12-17 00:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] 82xx: FCC: Fixing a bug causing to FCC port lock-up Martin Roth <martin.roth@motorolasolutions.com> - 2015-12-15 05:50 +0100
    Re: [PATCH] 82xx: FCC: Fixing a bug causing to FCC port lock-up David Miller <davem@davemloft.net> - 2015-12-17 00:40 +0100

#1291841 — [PATCH] 82xx: FCC: Fixing a bug causing to FCC port lock-up

FromMartin Roth <martin.roth@motorolasolutions.com>
Date2015-12-15 05:50 +0100
Subject[PATCH] 82xx: FCC: Fixing a bug causing to FCC port lock-up
Message-ID<qFPIK-7DU-17@gated-at.bofh.it>
The patch fixes FCC port lock-up, which occurs as a result of a bug
during underrun/collision handling. Within the tx_startup() function
in mac-fcc.c, the address of last BD is not calculated correctly.
As a result of wrong calculation of the last BD address, the next
transmitted BD may be set to an area out of the transmit BD ring.
This actually causes to port lock-up and it is not recoverable.

Signed-off-by: Martin Roth <martin.roth@motorolasolutions.com>
---
 drivers/net/ethernet/freescale/fs_enet/mac-fcc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
index 08f5b91..52e0091 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
@@ -552,7 +552,7 @@ static void tx_restart(struct net_device *dev)
 	cbd_t __iomem *prev_bd;
 	cbd_t __iomem *last_tx_bd;
 
-	last_tx_bd = fep->tx_bd_base + (fpi->tx_ring * sizeof(cbd_t));
+	last_tx_bd = fep->tx_bd_base + ((fpi->tx_ring - 1) * sizeof(cbd_t));
 
 	/* get the current bd held in TBPTR  and scan back from this point */
 	recheck_bd = curr_tbptr = (cbd_t __iomem *)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1293396

FromDavid Miller <davem@davemloft.net>
Date2015-12-17 00:40 +0100
Message-ID<qGtPQ-8mr-11@gated-at.bofh.it>
In reply to#1291841
From: Martin Roth <martin.roth@motorolasolutions.com>
Date: Tue, 15 Dec 2015 04:17:53 +0200

> The patch fixes FCC port lock-up, which occurs as a result of a bug
> during underrun/collision handling. Within the tx_startup() function
> in mac-fcc.c, the address of last BD is not calculated correctly.
> As a result of wrong calculation of the last BD address, the next
> transmitted BD may be set to an area out of the transmit BD ring.
> This actually causes to port lock-up and it is not recoverable.
> 
> Signed-off-by: Martin Roth <martin.roth@motorolasolutions.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web