Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f3ba2dc authored by Sascha Hauer's avatar Sascha Hauer Committed by Grant Likely
Browse files

[POWERPC] mpc5200: Fix FEC error handling on FIFO errors



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: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 106757b3
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -491,11 +491,8 @@ 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);
		return IRQ_HANDLED;
	}
	/* 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");
@@ -508,6 +505,12 @@ static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id)
		return IRQ_HANDLED;
	}

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

	return IRQ_HANDLED;
}

/*
 * Get the current statistics.
 * This may be called with the card open or closed.