Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x
Browse files Browse the repository at this point in the history
mv88e6393x_port_set_policy doesn't correctly shift the ptr value when
converting the policy format between the old and new styles, so the
target register ends up with the ptr being written over the data bits.

Shift the pointer to align with the format expected by
mv88e6393x_port_policy_write().

Fixes: 6584b26 ("net: dsa: mv88e6xxx: implement .port_set_policy for Amethyst")
Signed-off-by: Peter Rashleigh <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Andrew Lunn <[email protected]>
  • Loading branch information
prashle authored and lunn committed Oct 20, 2024
1 parent eb59200 commit 12bc149
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/dsa/mv88e6xxx/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,7 @@ int mv88e6393x_port_set_policy(struct mv88e6xxx_chip *chip, int port,
ptr = shift / 8;
shift %= 8;
mask >>= ptr * 8;
ptr <<= 8;

err = mv88e6393x_port_policy_read(chip, port, ptr, &reg);
if (err)
Expand Down

0 comments on commit 12bc149

Please sign in to comment.