aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-11-10 18:41:10 -0500
committerDavid S. Miller <davem@davemloft.net>2018-11-11 13:19:10 -0500
commita9049ff9214da68df1179a7d5e36b43479abc9b8 (patch)
tree13032ddf45df812aeff628977c17d7b29b111e67
parent7ab412d33b4c7ff3e0148d3db25dd861edd1283d (diff)
net: dsa: mv88e6xxx: Fix clearing of stats counters
The mv88e6161 would sometime fail to probe with a timeout waiting for the switch to complete an operation. This operation is supposed to clear the statistics counters. However, due to a read/modify/write, without the needed mask, the operation actually carried out was more random, with invalid parameters, resulting in the switch not responding. We need to preserve the histogram mode bits, so apply a mask to keep them. Reported-by: Chris Healy <Chris.Healy@zii.aero> Fixes: 40cff8fca9e3 ("net: dsa: mv88e6xxx: Fix stats histogram mode") Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/mv88e6xxx/global1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/global1.c b/drivers/net/dsa/mv88e6xxx/global1.c
index d721ccf7d8be..38e399e0f30e 100644
--- a/drivers/net/dsa/mv88e6xxx/global1.c
+++ b/drivers/net/dsa/mv88e6xxx/global1.c
@@ -567,6 +567,8 @@ int mv88e6xxx_g1_stats_clear(struct mv88e6xxx_chip *chip)
567 if (err) 567 if (err)
568 return err; 568 return err;
569 569
570 /* Keep the histogram mode bits */
571 val &= MV88E6XXX_G1_STATS_OP_HIST_RX_TX;
570 val |= MV88E6XXX_G1_STATS_OP_BUSY | MV88E6XXX_G1_STATS_OP_FLUSH_ALL; 572 val |= MV88E6XXX_G1_STATS_OP_BUSY | MV88E6XXX_G1_STATS_OP_FLUSH_ALL;
571 573
572 err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_STATS_OP, val); 574 err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_STATS_OP, val);