LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: thunderx: Fix OOPs with ethtool --register-dump
@ 2016-08-16 20:30 David Daney
  0 siblings, 0 replies; 2+ messages in thread
From: David Daney @ 2016-08-16 20:30 UTC (permalink / raw
  To: netdev, David S. Miller, linux-kernel
  Cc: Sunil Goutham, Robert Richter, linux-arm-kernel, David Daney

From: David Daney <david.daney@cavium.com>

The ethtool_ops .get_regs function attempts to read the nonexistent
register NIC_QSET_SQ_0_7_CNM_CHG, which produces a "bus error" type
OOPs.

Fix by not attempting to read, and removing the definition of,
NIC_QSET_SQ_0_7_CNM_CHG.  A zero is written into the register dump to
keep the layout unchanged.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: <stable@vger.kernel.org> # 4.4.x-
---
 drivers/net/ethernet/cavium/thunder/nic_reg.h       | 1 -
 drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c | 5 ++++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/nic_reg.h b/drivers/net/ethernet/cavium/thunder/nic_reg.h
index afb10e3..fab35a5 100644
--- a/drivers/net/ethernet/cavium/thunder/nic_reg.h
+++ b/drivers/net/ethernet/cavium/thunder/nic_reg.h
@@ -170,7 +170,6 @@
 #define   NIC_QSET_SQ_0_7_DOOR			(0x010838)
 #define   NIC_QSET_SQ_0_7_STATUS		(0x010840)
 #define   NIC_QSET_SQ_0_7_DEBUG			(0x010848)
-#define   NIC_QSET_SQ_0_7_CNM_CHG		(0x010860)
 #define   NIC_QSET_SQ_0_7_STAT_0_1		(0x010900)
 
 #define   NIC_QSET_RBDR_0_1_CFG			(0x010C00)
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
index d2d8ef2..ad4fddb 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
@@ -382,7 +382,10 @@ static void nicvf_get_regs(struct net_device *dev,
 		p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DOOR, q);
 		p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STATUS, q);
 		p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_DEBUG, q);
-		p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_CNM_CHG, q);
+		/* Padding, was NIC_QSET_SQ_0_7_CNM_CHG, which
+		 * produces bus errors when read
+		 */
+		p[i++] = 0;
 		p[i++] = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_STAT_0_1, q);
 		reg_offset = NIC_QSET_SQ_0_7_STAT_0_1 | (1 << 3);
 		p[i++] = nicvf_queue_reg_read(nic, reg_offset, q);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: thunderx: Fix OOPs with ethtool --register-dump
       [not found] <1471375697-1878-1-git-send-email-ddaney.cavm@gmail.com>
@ 2016-08-19  4:16 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-08-19  4:16 UTC (permalink / raw
  To: ddaney.cavm
  Cc: netdev, linux-kernel, sgoutham, rric, linux-arm-kernel,
	david.daney, stable

From: David Daney <ddaney.cavm@gmail.com>
Date: Tue, 16 Aug 2016 12:28:17 -0700

> From: David Daney <david.daney@cavium.com>
> 
> The ethtool_ops .get_regs function attempts to read the nonexistent
> register NIC_QSET_SQ_0_7_CNM_CHG, which produces a "bus error" type
> OOPs.
> 
> Fix by not attempting to read, and removing the definition of,
> NIC_QSET_SQ_0_7_CNM_CHG.  A zero is written into the register dump to
> keep the layout unchanged.
> 
> Signed-off-by: David Daney <david.daney@cavium.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-19  4:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1471375697-1878-1-git-send-email-ddaney.cavm@gmail.com>
2016-08-19  4:16 ` [PATCH] net: thunderx: Fix OOPs with ethtool --register-dump David Miller
2016-08-16 20:30 David Daney

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 read-only IMAP folder(s) and NNTP newsgroup(s).