diff mbox series

[net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x

Message ID CAOai=UuBxxfdu8HsnZi3CmWzZR=zBc_v0A624uTwfKUDRkrwiQ@mail.gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/apply fail Patch does not apply to net-0

Commit Message

Peter Rashleigh Oct. 14, 2024, 9:25 p.m. UTC
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: 6584b26020fc ("net: dsa: mv88e6xxx: implement .port_set_policy
for Amethyst")
Signed-off-by: Peter Rashleigh <peter@rashleigh.ca>
---
 drivers/net/dsa/mv88e6xxx/port.c | 1 +
 1 file changed, 1 insertion(+)

     if (err)

Comments

Jakub Kicinski Oct. 16, 2024, 12:49 a.m. UTC | #1
On Mon, 14 Oct 2024 14:25:44 -0700 Peter Rashleigh wrote:
> 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: 6584b26020fc ("net: dsa: mv88e6xxx: implement .port_set_policy
> for Amethyst")
> Signed-off-by: Peter Rashleigh <peter@rashleigh.ca>

the patch has been line-wrapped and whitespace corrupted by either your
email client or server. Please resend.
diff mbox series

Patch

diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index 5394a8cf7bf1..04053fdc6489 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -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);