]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: dsa: mv88e6xxx: Add missing mask of ATU occupancy register
authorAndrew Lunn <andrew@lunn.ch>
Wed, 11 Mar 2020 20:02:31 +0000 (21:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 07:01:29 +0000 (00:01 -0700)
Only the bottom 12 bits contain the ATU bin occupancy statistics. The
upper bits need masking off.

Fixes: e0c69ca7dfbb ("net: dsa: mv88e6xxx: Add ATU occupancy via devlink resources")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c

index 8c92895496881cb9d11adf4ee459bd549b247fe3..2f993e673ec7476261a900f76588970ff4532f49 100644 (file)
@@ -2769,6 +2769,8 @@ static u64 mv88e6xxx_devlink_atu_bin_get(struct mv88e6xxx_chip *chip,
                goto unlock;
        }
 
+       occupancy &= MV88E6XXX_G2_ATU_STATS_MASK;
+
 unlock:
        mv88e6xxx_reg_unlock(chip);