]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Apr 2021 21:06:19 +0000 (14:06 -0700)
commit9902042ff2bed6d38a879472f2d9f0c4fdb03ba7
treeb2a84d9a70dad3a992bd62f6e23cff7bfc033cf4
parentb4119594ba78753fe3545feb57ed5cf6eb910ac6
net: dsa: mv88e6xxx: Fix 6095/6097/6185 ports in non-SERDES CMODE

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: 640ee0fb7114 ("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>
drivers/net/dsa/mv88e6xxx/serdes.c