]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: b53: Fix statistics readings
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 21 Jun 2016 01:26:53 +0000 (18:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jun 2016 19:13:48 +0000 (15:13 -0400)
commit84c1b08f4d9176bbad177e8c95964f38d27fdfe1
tree2de933dd95feadfca20a285db293816e49587fb2
parente9b8af3762e6a84db0c5649c4b174ee9beaaec02
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: 89fb23a74505 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Reported-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c