Skip to content

Commit

Permalink
[POWERPC] mpc5200: Fix FEC error handling on FIFO errors
Browse files Browse the repository at this point in the history
The error handling for the mpc5200 fec interrupt is broken. The intended
behaviour is like this:

* If one of FEC_IEVENT_RFIFO_ERROR and FEC_IEVENT_XFIFO_ERROR happens,
  the datasheet says (MPC5200B User's Guide R1.2, p. 14-13): "When this
  occurs, software must ensure both the FIFO Controller and BestComm are
  soft-reset".

* On any other error (non-TFINT) interrupt, just issue a debug message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Sascha Hauer authored and Grant Likely committed Apr 29, 2008
1 parent 106757b commit 8f3ba2d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions drivers/net/fec_mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,20 +491,23 @@ static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id)

out_be32(&fec->ievent, ievent); /* clear pending events */

if (ievent & ~(FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) {
if (ievent & ~FEC_IEVENT_TFINT)
dev_dbg(&dev->dev, "ievent: %08x\n", ievent);
/* on fifo error, soft-reset fec */
if (ievent & (FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) {

if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR))
dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n");
if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR))
dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n");

mpc52xx_fec_reset(dev);

netif_wake_queue(dev);
return IRQ_HANDLED;
}

if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR))
dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n");
if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR))
dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n");
if (ievent & ~FEC_IEVENT_TFINT)
dev_dbg(&dev->dev, "ievent: %08x\n", ievent);

mpc52xx_fec_reset(dev);

netif_wake_queue(dev);
return IRQ_HANDLED;
}

Expand Down

0 comments on commit 8f3ba2d

Please sign in to comment.