netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x
@ 2024-10-16  4:08 Peter Rashleigh
  2024-10-17 14:36 ` Simon Horman
  2024-10-20 14:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Rashleigh @ 2024-10-16  4:08 UTC (permalink / raw)
  To: andrew; +Cc: netdev, kuba, Peter Rashleigh

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(+)

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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x
  2024-10-16  4:08 [PATCH RESEND net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x Peter Rashleigh
@ 2024-10-17 14:36 ` Simon Horman
  2024-10-20 14:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-10-17 14:36 UTC (permalink / raw)
  To: Peter Rashleigh; +Cc: andrew, netdev, kuba

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>

...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x
  2024-10-16  4:08 [PATCH RESEND net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x Peter Rashleigh
  2024-10-17 14:36 ` Simon Horman
@ 2024-10-20 14:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-20 14:50 UTC (permalink / raw)
  To: Peter Rashleigh; +Cc: andrew, netdev, kuba

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-20 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16  4:08 [PATCH RESEND net] net: dsa: mv88e6xxx: Fix error when setting port policy on mv88e6393x Peter Rashleigh
2024-10-17 14:36 ` Simon Horman
2024-10-20 14:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).