diff mbox series

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

Message ID 20241016040822.3917-1-peter@rashleigh.ca (mailing list archive)
State Accepted
Commit 12bc14949c4a7272b509af0f1022a0deeb215fd8
Delegated to: Netdev Maintainers
Headers show
Series [RESEND,net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 2 blamed authors not CCed: kabel@kernel.org olteanv@gmail.com; 5 maintainers not CCed: f.fainelli@gmail.com kabel@kernel.org pabeni@redhat.com edumazet@google.com olteanv@gmail.com
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-10-19--00-00 (tests: 777)

Commit Message

Peter Rashleigh Oct. 16, 2024, 4:08 a.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(+)

Comments

Simon Horman Oct. 17, 2024, 2:36 p.m. UTC | #1
On Tue, Oct 15, 2024 at 09:08:22PM -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>

Thanks, I agree with your analysis.
And that the problem was introduced by the cited commit.

Reviewed-by: Simon Horman <horms@kernel.org>

...
patchwork-bot+netdevbpf@kernel.org Oct. 20, 2024, 2:50 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Andrew Lunn <andrew@lunn.ch>:

On Tue, 15 Oct 2024 21:08:22 -0700 you 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().
> 
> [...]

Here is the summary with links:
  - [RESEND,net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x
    https://git.kernel.org/netdev/net/c/12bc14949c4a

You are awesome, thank you!
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);
 	if (err)