For new version of Fedora and Ubuntu, we see all 0xff when dumping
the hw regs through ethtool. Using a loop to read registers could
fix it.

Signed-off-by: Hayes Wang <hayesw...@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c 
b/drivers/net/ethernet/realtek/r8169.c
index c25a329..4ae3c55 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1880,12 +1880,16 @@ static void rtl8169_get_regs(struct net_device *dev, 
struct ethtool_regs *regs,
                             void *p)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
+       void __iomem *ioaddr = tp->mmio_addr;
+       u32 *d = (u32 *)p;
+       int i;
 
        if (regs->len > R8169_REGS_SIZE)
                regs->len = R8169_REGS_SIZE;
 
        rtl_lock_work(tp);
-       memcpy_fromio(p, tp->mmio_addr, regs->len);
+       for (i = 0; i < regs->len; i += 4)
+               *d++ = RTL_R32(i);
        rtl_unlock_work(tp);
 }
 
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to