From patchwork Wed Jun 28 15:13:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thor Thayer X-Patchwork-Id: 781744 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wyRDf0Y7fz9s0Z for ; Thu, 29 Jun 2017 01:15:14 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752604AbdF1PLR (ORCPT ); Wed, 28 Jun 2017 11:11:17 -0400 Received: from mga03.intel.com ([134.134.136.65]:6095 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752492AbdF1PLM (ORCPT ); Wed, 28 Jun 2017 11:11:12 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2017 08:10:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,276,1496127600"; d="scan'208";a="1188036330" Received: from tthayer-hp-z620-workstation.an.intel.com ([10.122.105.144]) by fmsmga002.fm.intel.com with ESMTP; 28 Jun 2017 08:10:39 -0700 From: thor.thayer@linux.intel.com To: linville@tuxdriver.com, peppe.cavallaro@st.com Cc: netdev@vger.kernel.org, thor.thayer@linux.intel.com Subject: [PATCHv2 1/3] ethtool: stmmac: Fix Designware ethtool register dump Date: Wed, 28 Jun 2017 10:13:40 -0500 Message-Id: <1498662822-12173-2-git-send-email-thor.thayer@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498662822-12173-1-git-send-email-thor.thayer@linux.intel.com> References: <1498662822-12173-1-git-send-email-thor.thayer@linux.intel.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Thor Thayer 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 Acked-by: Giuseppe Cavallaro --- v2 Modify the commit message to specify commit from Linux kernel. Add Acked-by. --- 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 #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++);