Message ID | 3162188.mmLmSZRt9A@al |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
Peter Wu <lekensteyn@gmail.com> : [...] > sure what the cause is of this strange behavior. Francois, perhaps you > have an idea why reading in blocks of larger than 7 results in a error? No but it has been seen before. Platform or device thing ?
On Tuesday 23 July 2013 22:25:44 Francois Romieu wrote: > Peter Wu <lekensteyn@gmail.com> : > [...] > > > sure what the cause is of this strange behavior. Francois, perhaps you > > have an idea why reading in blocks of larger than 7 results in a error? > > No but it has been seen before. Platform or device thing ? What kind of devices were those? This issue occurs on an on-board PCIe chip where the memory is 64-bit, prefetchable. I have no issues with a PCI card, memory 32-bit, non-prefetchable. PCI: RTL8168sb PCIe: RTL8111E Regards, Peter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -1897,12 +2050,17 @@ static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) { struct rtl8169_private *tp = netdev_priv(dev); + char *bytes = 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 - 4; i += 4) + memcpy_fromio(bytes + i, tp->mmio_addr + i, 4); + if (i < regs->len) + memcpy_fromio(bytes + i, tp->mmio_addr + i, regs->len - i); rtl_unlock_work(tp); }