From: Joel Stanley <joel@jms.id.au>
To: davem@davemloft.net
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>,
andrew@lunn.ch, andrew@aj.id.au, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, benh@kernel.crashing.org
Subject: [PATCH net-next 5/7] net/faraday: Clear stale interrupts
Date: Tue, 20 Sep 2016 16:00:05 +0930 [thread overview]
Message-ID: <20160920063007.24291-6-joel@jms.id.au> (raw)
In-Reply-To: <20160920063007.24291-1-joel@jms.id.au>
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
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>
---
drivers/net/ethernet/faraday/ftgmac100.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index f2ea6c2f1fbd..7ba0f2d58a8b 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1113,6 +1113,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);
@@ -1138,6 +1139,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)
--
2.9.3
next prev parent reply other threads:[~2016-09-20 6:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-20 6:30 [PATCH net-next 0/7] ftgmac100 support for ast2500 Joel Stanley
2016-09-20 6:30 ` [PATCH net-next 1/7] net/faraday: Separate rx page storage from rxdesc Joel Stanley
2016-09-20 6:30 ` [PATCH net-next 2/7] net/faraday: Make EDO{R,T}R bits configurable Joel Stanley
2016-09-20 6:30 ` [PATCH net-next 3/7] net/faraday: Adapt for Aspeed SoCs Joel Stanley
2016-09-20 6:30 ` [PATCH net-next 4/7] net/faraday: Avoid PHYSTS_CHG interrupt Joel Stanley
2016-09-20 6:30 ` Joel Stanley [this message]
2016-09-20 6:30 ` [PATCH net-next 6/7] net/faraday: Fix phy link irq on Aspeed G5 SoCs Joel Stanley
2016-09-20 12:13 ` Benjamin Herrenschmidt
2016-09-20 15:29 ` Andrew Lunn
2016-09-21 2:02 ` Joel Stanley
2016-09-21 9:03 ` Benjamin Herrenschmidt
2016-09-21 9:18 ` Joel Stanley
2016-09-21 10:43 ` Benjamin Herrenschmidt
2016-09-20 12:14 ` Sergei Shtylyov
2016-09-20 6:30 ` [PATCH net-next 7/7] net/faraday: Configure old MDIO interface on Aspeed SoCs Joel Stanley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160920063007.24291-6-joel@jms.id.au \
--to=joel@jms.id.au \
--cc=andrew@aj.id.au \
--cc=andrew@lunn.ch \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=gwshan@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).