From: Thor Thayer <thor.thayer@linux.intel.com>
To: linville@tuxdriver.com, peppe.cavallaro@st.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCHv2 1/3] ethtool: stmmac: Fix Designware ethtool register dump
Date: Thu, 6 Jul 2017 15:22:59 -0500 [thread overview]
Message-ID: <81e6d065-bd74-6af8-de4f-7722d0b1e270@linux.intel.com> (raw)
In-Reply-To: <1498662822-12173-2-git-send-email-thor.thayer@linux.intel.com>
On 06/28/2017 10:13 AM, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
>
> The commit fbf68229ffe7 ("net: stmmac: unify registers dumps methods")
>
> in the Linux kernel 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 <thor.thayer@linux.intel.com>
> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
> v2 Modify the commit message to specify commit from Linux kernel.
> Add Acked-by.
> ---
Please disregard this patch.
After further reflection, it would be better to leave this alone and
change the kernel driver. This change would require using different
ethtool for different versions.
The other 2 patches with macro changes are still valid.
Thanks,
Thor
> 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++);
>
>
next prev parent reply other threads:[~2017-07-06 20:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 15:13 [PATCHv2 0/3] ethtool: stmmac: Fix DMA register dump thor.thayer
2017-06-28 15:13 ` [PATCHv2 1/3] ethtool: stmmac: Fix Designware ethtool " thor.thayer
2017-07-06 20:22 ` Thor Thayer [this message]
2017-07-07 7:10 ` Giuseppe CAVALLARO
2017-06-28 15:13 ` [PATCHv2 2/3] ethtool: stmmac: Add macros for number of registers thor.thayer
2017-06-28 15:13 ` [PATCHv2 3/3] ethtool: stmmac: Add DMA HW Feature Register thor.thayer
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=81e6d065-bd74-6af8-de4f-7722d0b1e270@linux.intel.com \
--to=thor.thayer@linux.intel.com \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
/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).