Commit 08c9c126 authored by Gavin Shan's avatar Gavin Shan Committed by David S. Miller

net/faraday: Clear stale interrupts

There is stale interrupt (PHYSTS_CHG in ISR, bit#6 in 0x0) from
the bootloader (uboot) when enabling the MAC. The stale interrupts
aren't part of kernel and should be cleared.

This clears the stale interrupts in ISR (0x0) when enabling the MAC.
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2a0ab8eb
...@@ -1112,6 +1112,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget) ...@@ -1112,6 +1112,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget)
static int ftgmac100_open(struct net_device *netdev) static int ftgmac100_open(struct net_device *netdev)
{ {
struct ftgmac100 *priv = netdev_priv(netdev); struct ftgmac100 *priv = netdev_priv(netdev);
unsigned int status;
int err; int err;
err = ftgmac100_alloc_buffers(priv); err = ftgmac100_alloc_buffers(priv);
...@@ -1137,6 +1138,11 @@ static int ftgmac100_open(struct net_device *netdev) ...@@ -1137,6 +1138,11 @@ static int ftgmac100_open(struct net_device *netdev)
ftgmac100_init_hw(priv); ftgmac100_init_hw(priv);
ftgmac100_start_hw(priv, priv->use_ncsi ? 100 : 10); ftgmac100_start_hw(priv, priv->use_ncsi ? 100 : 10);
/* Clear stale interrupts */
status = ioread32(priv->base + FTGMAC100_OFFSET_ISR);
iowrite32(status, priv->base + FTGMAC100_OFFSET_ISR);
if (netdev->phydev) if (netdev->phydev)
phy_start(netdev->phydev); phy_start(netdev->phydev);
else if (priv->use_ncsi) else if (priv->use_ncsi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment