[PATCH 0/2] ethtool: stmmac: Fix DMA register dump

STALE3397d

5 messages, 2 authors, 2017-06-28 · open the first message on its own page

[PATCH 0/2] ethtool: stmmac: Fix DMA register dump

From: <hidden>
Date: 2017-06-27 21:48:18

From: Thor Thayer <redacted>

The DMA register dump structure changed which requires this
change to the indexing of the DMA registers.
Also dump the DMA HW Feature Register.

Thor Thayer (2):
  ethtool: stmmac: Fix Designware ethtool register dump
  ethtool: stmmac: Add DMA HW Feature Register

 stmmac.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.7.4

[PATCH 1/2] ethtool: stmmac: Fix Designware ethtool register dump

From: <hidden>
Date: 2017-06-27 21:48:19

From: Thor Thayer <redacted>

The commit fbf68229ffe7 ("net: stmmac: unify registers dumps methods")

modified the register dump to store the DMA registers at the DMA register
offset (0x1000) but ethtool (stmmac.c) looks for the DMA registers after
the MAC registers which is offset 12.
This patch adds the DMA register offset so that indexing is correct.

Signed-off-by: Thor Thayer <redacted>
---
 stmmac.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/stmmac.c b/stmmac.c
index fb69bfe..e1bb291 100644
--- a/stmmac.c
+++ b/stmmac.c
@@ -14,6 +14,9 @@
 #include <string.h>
 #include "internal.h"
 
+/* The DMA Registers start at offset 0x1000 in the DW IP */
+#define DMA_REG_OFFSET	(0x1000 / 4)
+
 int st_mac100_dump_regs(struct ethtool_drvinfo *info,
 			struct ethtool_regs *regs)
 {
@@ -36,6 +39,7 @@ int st_mac100_dump_regs(struct ethtool_drvinfo *info,
 
 	fprintf(stdout, "\n");
 	fprintf(stdout, "DMA Registers\n");
+	stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
 	for (i = 0; i < 9; i++)
 		fprintf(stdout, "CSR%d  0x%08X\n", i, *stmmac_reg++);
 
@@ -59,6 +63,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
 
 	fprintf(stdout, "\n");
 	fprintf(stdout, "DMA Registers\n");
+	stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
 	for (i = 0; i < 22; i++)
 		fprintf(stdout, "Reg%d  0x%08X\n", i, *stmmac_reg++);
 
-- 
2.7.4

[PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register

From: <hidden>
Date: 2017-06-27 21:48:20

From: Thor Thayer <redacted>

This patch adds the DMA HW Feature Register which is at the end
of the DMA registers and is documented in Version 3.70a.

Signed-off-by: Thor Thayer <redacted>
---
 stmmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stmmac.c b/stmmac.c
index e1bb291..7d7bebd 100644
--- a/stmmac.c
+++ b/stmmac.c
@@ -64,7 +64,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
 	fprintf(stdout, "\n");
 	fprintf(stdout, "DMA Registers\n");
 	stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
-	for (i = 0; i < 22; i++)
+	for (i = 0; i < 23; i++)
 		fprintf(stdout, "Reg%d  0x%08X\n", i, *stmmac_reg++);
 
 	return 0;
-- 
2.7.4

Re: [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register

From: Giuseppe CAVALLARO <hidden>
Date: 2017-06-28 09:22:04

On 6/27/2017 11:51 PM, thor.thayer@linux.intel.com wrote:
quoted hunk
From: Thor Thayer <redacted>

This patch adds the DMA HW Feature Register which is at the end
of the DMA registers and is documented in Version 3.70a.

Signed-off-by: Thor Thayer <redacted>
---
  stmmac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stmmac.c b/stmmac.c
index e1bb291..7d7bebd 100644
--- a/stmmac.c
+++ b/stmmac.c
@@ -64,7 +64,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
  	fprintf(stdout, "\n");
  	fprintf(stdout, "DMA Registers\n");
  	stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
-	for (i = 0; i < 22; i++)
+	for (i = 0; i < 23; i++)
thx Thor for these changes, I wonder if you could add a macro instead 23 while doing this kind of changes

Sorry if I didn't it in the past.

the, you can send the series with my Acked-by: Giuseppe Cavallaro [off-list ref]

Regards

peppe

  		fprintf(stdout, "Reg%d  0x%08X\n", i, *stmmac_reg++);
  
  	return 0;

Re: [PATCH 2/2] ethtool: stmmac: Add DMA HW Feature Register

From: Thor Thayer <hidden>
Date: 2017-06-28 13:22:03

On 06/28/2017 04:03 AM, Giuseppe CAVALLARO wrote:
On 6/27/2017 11:51 PM, thor.thayer@linux.intel.com wrote:
quoted
From: Thor Thayer <redacted>

This patch adds the DMA HW Feature Register which is at the end
of the DMA registers and is documented in Version 3.70a.

Signed-off-by: Thor Thayer <redacted>
---
  stmmac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stmmac.c b/stmmac.c
index e1bb291..7d7bebd 100644
--- a/stmmac.c
+++ b/stmmac.c
@@ -64,7 +64,7 @@ int st_gmac_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
      fprintf(stdout, "\n");
      fprintf(stdout, "DMA Registers\n");
      stmmac_reg = (unsigned int *)regs->data + DMA_REG_OFFSET;
-    for (i = 0; i < 22; i++)
+    for (i = 0; i < 23; i++)
thx Thor for these changes, I wonder if you could add a macro instead 23 while doing this kind of changes

Sorry if I didn't it in the past.

the, you can send the series with my Acked-by: Giuseppe Cavallaro [off-list ref]

Regards

peppe
Sure. I'll also add a macro for the # of main registers too (55). Some maintainers prefer the macros while others prefer the number to reduce the space.

Thanks for the quick review!

Thor
quoted
          fprintf(stdout, "Reg%d  0x%08X\n", i, *stmmac_reg++);
      return 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help