aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2015-01-15 17:45:09 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-16 01:00:03 -0500
commitcd2d6d33e2c5be653d10cdc8fcd7dcf0be28de50 (patch)
tree523c8a5e167c81a8c80f78e3eb67c0f0427273b8
parentf812116b174e59a350acc8e4856213a166a91222 (diff)
net: davinci_emac: Fix hangs with interrupts
On davinci_emac, we have pulse interrupts. This means that we need to clear the EOI bits when disabling interrupts as otherwise the interrupts keep happening. And we also need to not clear the EOI bits again when enabling the interrupts as otherwise we will get tons of: unexpected IRQ trap at vector 00 These errors almost certainly mean that the omap-intc.c is signaling a spurious interrupt with the reserved irq 127 as we've seen earlier on omap3. Let's fix the issue by clearing the EOI bits when disabling the interrupts. Let's also keep the comment for "Rx Threshold and Misc interrupts are not enabled" for both enable and disable so people are aware of this when potentially adding more support. Note that eventually we should handle the RX and TX interrupts separately like cpsw is now doing. However, so far I have not seen any issues with this based on my testing, so it seems to behave a little different compared to the cpsw that had a similar issue. Cc: Brian Hutchinson <b.hutchman@gmail.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index ea712512c7d1..383ed527dad9 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -922,6 +922,16 @@ static void emac_int_disable(struct emac_priv *priv)
922 if (priv->int_disable) 922 if (priv->int_disable)
923 priv->int_disable(); 923 priv->int_disable();
924 924
925 /* NOTE: Rx Threshold and Misc interrupts are not enabled */
926
927 /* ack rxen only then a new pulse will be generated */
928 emac_write(EMAC_DM646X_MACEOIVECTOR,
929 EMAC_DM646X_MAC_EOI_C0_RXEN);
930
931 /* ack txen- only then a new pulse will be generated */
932 emac_write(EMAC_DM646X_MACEOIVECTOR,
933 EMAC_DM646X_MAC_EOI_C0_TXEN);
934
925 local_irq_restore(flags); 935 local_irq_restore(flags);
926 936
927 } else { 937 } else {
@@ -951,15 +961,6 @@ static void emac_int_enable(struct emac_priv *priv)
951 * register */ 961 * register */
952 962
953 /* NOTE: Rx Threshold and Misc interrupts are not enabled */ 963 /* NOTE: Rx Threshold and Misc interrupts are not enabled */
954
955 /* ack rxen only then a new pulse will be generated */
956 emac_write(EMAC_DM646X_MACEOIVECTOR,
957 EMAC_DM646X_MAC_EOI_C0_RXEN);
958
959 /* ack txen- only then a new pulse will be generated */
960 emac_write(EMAC_DM646X_MACEOIVECTOR,
961 EMAC_DM646X_MAC_EOI_C0_TXEN);
962
963 } else { 964 } else {
964 /* Set DM644x control registers for interrupt control */ 965 /* Set DM644x control registers for interrupt control */
965 emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1); 966 emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1);