diff options
| author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-04-15 11:44:39 -0400 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2008-04-29 09:18:51 -0400 |
| commit | 8f3ba2dc811228213bcbdc2c8b389a8d6fa66c09 (patch) | |
| tree | d4ff70539df7adfee8e0468962366791ccf7da88 /drivers | |
| parent | 106757b38fffbe1f015b10a6d4a4f92e8a3881b9 (diff) | |
[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: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/fec_mpc52xx.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index e5e6352556fa..d21b7ab64bd1 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
| @@ -491,20 +491,23 @@ static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id) | |||
| 491 | 491 | ||
| 492 | out_be32(&fec->ievent, ievent); /* clear pending events */ | 492 | out_be32(&fec->ievent, ievent); /* clear pending events */ |
| 493 | 493 | ||
| 494 | if (ievent & ~(FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) { | 494 | /* on fifo error, soft-reset fec */ |
| 495 | if (ievent & ~FEC_IEVENT_TFINT) | 495 | if (ievent & (FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) { |
| 496 | dev_dbg(&dev->dev, "ievent: %08x\n", ievent); | 496 | |
| 497 | if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR)) | ||
| 498 | dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n"); | ||
| 499 | if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR)) | ||
| 500 | dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n"); | ||
| 501 | |||
| 502 | mpc52xx_fec_reset(dev); | ||
| 503 | |||
| 504 | netif_wake_queue(dev); | ||
| 497 | return IRQ_HANDLED; | 505 | return IRQ_HANDLED; |
| 498 | } | 506 | } |
| 499 | 507 | ||
| 500 | if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR)) | 508 | if (ievent & ~FEC_IEVENT_TFINT) |
| 501 | dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n"); | 509 | dev_dbg(&dev->dev, "ievent: %08x\n", ievent); |
| 502 | if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR)) | ||
| 503 | dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n"); | ||
| 504 | 510 | ||
| 505 | mpc52xx_fec_reset(dev); | ||
| 506 | |||
| 507 | netif_wake_queue(dev); | ||
| 508 | return IRQ_HANDLED; | 511 | return IRQ_HANDLED; |
| 509 | } | 512 | } |
| 510 | 513 | ||
