From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 1/7] sky2: avoid reserved regions on ethtool reg dump
Date: Mon, 04 Jun 2007 17:23:21 -0700 [thread overview]
Message-ID: <20070605002738.626584893@linux-foundation.org> (raw)
In-Reply-To: 20070605002320.868185090@linux-foundation.org
[-- Attachment #1: sky2-reg-dump-avoid.patch --]
[-- Type: text/plain, Size: 1609 bytes --]
On Yukon EX reading some of the undocumented places in the
memory space will cause a hang. Since they don't provide useful
information, just skip the reserved areas.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
drivers/net/sky2.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--- a/drivers/net/sky2.c 2007-06-04 08:45:25.000000000 -0700
+++ b/drivers/net/sky2.c 2007-06-04 08:46:34.000000000 -0700
@@ -3330,7 +3330,7 @@ static int sky2_get_regs_len(struct net_
/*
* Returns copy of control register region
- * Note: access to the RAM address register set will cause timeouts.
+ * Note: ethtool_get_regs always provides full size (16k) buffer
*/
static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *p)
@@ -3338,15 +3338,19 @@ static void sky2_get_regs(struct net_dev
const struct sky2_port *sky2 = netdev_priv(dev);
const void __iomem *io = sky2->hw->regs;
- BUG_ON(regs->len < B3_RI_WTO_R1);
regs->version = 1;
memset(p, 0, regs->len);
memcpy_fromio(p, io, B3_RAM_ADDR);
- memcpy_fromio(p + B3_RI_WTO_R1,
- io + B3_RI_WTO_R1,
- regs->len - B3_RI_WTO_R1);
+ /* skip diagnostic ram region */
+ memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, 0x2000 - B3_RI_WTO_R1);
+
+ /* copy GMAC registers */
+ memcpy_fromio(p + BASE_GMAC_1, io + BASE_GMAC_1, 0x1000);
+ if (sky2->hw->ports > 1)
+ memcpy_fromio(p + BASE_GMAC_2, io + BASE_GMAC_2, 0x1000);
+
}
/* In order to do Jumbo packets on these chips, need to turn off the
--
Stephen Hemminger <shemminger@linux-foundation.org>
next prev parent reply other threads:[~2007-06-05 0:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-05 0:23 [PATCH 0/7] sky2 version 1.15 (88e8071) support Stephen Hemminger
2007-06-05 0:23 ` Stephen Hemminger [this message]
2007-06-13 20:44 ` [PATCH 1/7] sky2: avoid reserved regions on ethtool reg dump Jeff Garzik
2007-06-05 0:23 ` [PATCH 2/7] sky2: Add PCI device specfic register 4 & 5 Stephen Hemminger
2007-06-05 0:23 ` [PATCH 3/7] sky2: rename BMU register Stephen Hemminger
2007-06-05 0:23 ` [PATCH 4/7] sky2: enable clocks before probe Stephen Hemminger
2007-06-05 0:23 ` [PATCH 5/7] sky2: GPIO register Stephen Hemminger
2007-06-05 0:23 ` [PATCH 6/7] sky2: Yukon Extreme (88e8071) support Stephen Hemminger
2007-06-05 0:23 ` [PATCH 7/7] sky2: version 1.15 Stephen Hemminger
2007-06-13 20:05 ` [PATCH 0/7] sky2 version 1.15 (88e8071) support Jeff Garzik
2007-06-13 20:37 ` Stephen Hemminger
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=20070605002738.626584893@linux-foundation.org \
--to=shemminger@linux-foundation.org \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
/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).