diff mbox series

[net] net: dsa: mv88e6xxx: Fix errors in max_vid and port policy for 88E6361

Message ID 20241014045053.9152-1-peter@rashleigh.ca (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net] net: dsa: mv88e6xxx: Fix errors in max_vid and port policy for 88E6361 | 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 fail Series targets non-next tree, but doesn't contain any Fixes tags
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 warning 5 maintainers not CCed: edumazet@google.com f.fainelli@gmail.com olteanv@gmail.com pabeni@redhat.com kuba@kernel.org
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 No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 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-14--09-00 (tests: 777)

Commit Message

Peter Rashleigh Oct. 14, 2024, 4:50 a.m. UTC
The 88E6361 has two VTU pages (8192 VIDs), so fix the max_vid definition.

Also fix an error in mv88e6393x_port_set_policy where the register
gets an unexpected value because the ptr is written over the data bits.

Signed-off-by: Peter Rashleigh <peter@rashleigh.ca>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
 drivers/net/dsa/mv88e6xxx/port.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)


base-commit: d3d1556696c1a993eec54ac585fe5bf677e07474

Comments

Andrew Lunn Oct. 14, 2024, 1:29 p.m. UTC | #1
On Sun, Oct 13, 2024 at 09:50:53PM -0700, Peter Rashleigh wrote:
> The 88E6361 has two VTU pages (8192 VIDs), so fix the max_vid definition.

Hi Peter

Is 88E6361 correct?

> 
> Also fix an error in mv88e6393x_port_set_policy where the register
> gets an unexpected value because the ptr is written over the data bits.

Please make this two patches, since you fixing two things. Each patch
needs a Fixes: tag.

    Andrew

---
pw-bot: cr
diff mbox series

Patch

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 5b4e2ce5470d..284270a4ade1 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -6347,7 +6347,7 @@  static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.invalid_port_mask = BIT(1) | BIT(2) | BIT(8),
 		.num_internal_phys = 5,
 		.internal_phys_offset = 3,
-		.max_vid = 4095,
+		.max_vid = 8191,
 		.max_sid = 63,
 		.port_base_addr = 0x0,
 		.phy_base_addr = 0x0,
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)