From: Florian Fainelli Date: Tue, 21 Jun 2016 01:26:53 +0000 (-0700) Subject: net: dsa: b53: Fix statistics readings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=51dca8a1cfd917e1b53b118ddd3fbe5eb1b6a9a8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: dsa: b53: Fix statistics readings Due to a typo we would always be using the MIB counter width of the first element of the counter array instead of the current element, and we would always be accessing the register statistics with a 64-bits read, while some could be 32-bits. This got unnoticed in testing with MDIO and SRAB which tolerate doing this, but testing with the SPI bus revealed bogus values being returned. Fix this by using the proper iterator here. Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch") Reported-by: Jonas Gorski Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 5321083379c7..444de66667b9 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -679,7 +679,7 @@ static void b53_get_ethtool_stats(struct dsa_switch *ds, int port, for (i = 0; i < mib_size; i++) { s = &mibs[i]; - if (mibs->size == 8) { + if (s->size == 8) { b53_read64(dev, B53_MIB_PAGE(port), s->offset, &val); } else { u32 val32;