Skip to content

Commit

Permalink
net/faraday: Clear stale interrupts
Browse files Browse the repository at this point in the history
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: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gavin Shan authored and David S. Miller committed Sep 22, 2016
1 parent 2a0ab8e commit 08c9c12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget)
static int ftgmac100_open(struct net_device *netdev)
{
struct ftgmac100 *priv = netdev_priv(netdev);
unsigned int status;
int err;

err = ftgmac100_alloc_buffers(priv);
Expand All @@ -1137,6 +1138,11 @@ static int ftgmac100_open(struct net_device *netdev)

ftgmac100_init_hw(priv);
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)
phy_start(netdev->phydev);
else if (priv->use_ncsi)
Expand Down

0 comments on commit 08c9c12

Please sign in to comment.