]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
net: dsa: mv88e6xxx: Fix 6095/6097/6185 ports in non-SERDES CMODE
authorTobias Waldekranz <tobias@waldekranz.com>
Mon, 26 Apr 2021 16:17:34 +0000 (18:17 +0200)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:43 +0000 (17:46 -0600)
commitb22a0a85721ad7cdff7eb47988b84bc6d1673f26
treef24974fee43f13688f6e6f8fa5d00e319939d81a
parent04054a559e6a0db06c27acbfbff39f942c13e15b
net: dsa: mv88e6xxx: Fix 6095/6097/6185 ports in non-SERDES CMODE

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 6066234aa33850e9e35e7be82d92b9e9091e774b ]

The .serdes_get_lane op used the magic value 0xff to indicate a valid
SERDES lane and 0 signaled that a non-SERDES mode was set on the port.

Unfortunately, "0" is also a valid lane ID, so even when these ports
where configured to e.g. RGMII the driver would set them up as SERDES
ports.

- Replace 0xff with 0 to indicate a valid lane ID. The number is on
  the one hand just as arbitrary, but it is at least the first valid one
  and therefore less of a surprise.

- Follow the other .serdes_get_lane implementations and return -ENODEV
  in the case where no SERDES is assigned to the port.

Fixes: f5be107c3338 ("net: dsa: mv88e6xxx: Support serdes ports on MV88E6097/6095/6185")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/dsa/mv88e6xxx/serdes.c