summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLendacky, Thomas <Thomas.Lendacky@amd.com>2016-11-11 02:09:29 +0300
committerDavid S. Miller <davem@davemloft.net>2016-11-13 08:56:26 +0300
commit5ffc0335d5118bad9f98ea952e74eaf38334dd7f (patch)
tree9f94e615ddea815e411d363fd59b85c0851bd6fc
parentf0a404001204a23f94e1ca0cda8597ce80714f5e (diff)
downloadlinux-5ffc0335d5118bad9f98ea952e74eaf38334dd7f.tar.xz
amd-xgbe: Guard against incorrectly generated interrupts
Due to a hardware issue, it is possible for interrupt events to be incorrectly generated when performing a soft reset. To guard against this, perform the soft reset twice. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-dev.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
index 903731902153..e3862bbf2f76 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
@@ -1897,7 +1897,7 @@ static int xgbe_disable_int(struct xgbe_channel *channel,
return 0;
}
-static int xgbe_exit(struct xgbe_prv_data *pdata)
+static int __xgbe_exit(struct xgbe_prv_data *pdata)
{
unsigned int count = 2000;
@@ -1919,6 +1919,20 @@ static int xgbe_exit(struct xgbe_prv_data *pdata)
return 0;
}
+static int xgbe_exit(struct xgbe_prv_data *pdata)
+{
+ int ret;
+
+ /* To guard against possible incorrectly generated interrupts,
+ * issue the software reset twice.
+ */
+ ret = __xgbe_exit(pdata);
+ if (ret)
+ return ret;
+
+ return __xgbe_exit(pdata);
+}
+
static int xgbe_flush_tx_queues(struct xgbe_prv_data *pdata)
{
unsigned int i, count;