Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usbnet: asix AX88772: leave the carrier control to phylink

ASIX AX88772B based USB 10/100 Ethernet adapter doesn't come
up ("carrier off"), despite the built-in 100BASE-FX PHY positive link
indication. The internal PHY is configured (using EEPROM) in fixed
100 Mbps full duplex mode.

The primary problem appears to be using carrier_netif_{on,off}() while,
at the same time, delegating carrier management to phylink. Use only the
latter and remove "manual control" in the asix driver.

I don't have any other AX88772 board here, but the problem doesn't seem
specific to a particular board or settings - it's probably
timing-dependent.

Remove unused asix_adjust_link() as well.

Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/m3plhmdfte.fsf_-_@t19.piap.pl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Krzysztof Hałasa and committed by
Jakub Kicinski
4145f002 8127837a

+4 -36
-1
drivers/net/usb/asix.h
··· 224 224 225 225 u16 asix_read_medium_status(struct usbnet *dev, int in_pm); 226 226 int asix_write_medium_mode(struct usbnet *dev, u16 mode, int in_pm); 227 - void asix_adjust_link(struct net_device *netdev); 228 227 229 228 int asix_write_gpio(struct usbnet *dev, u16 value, int sleep, int in_pm); 230 229
-22
drivers/net/usb/asix_common.c
··· 414 414 return ret; 415 415 } 416 416 417 - /* set MAC link settings according to information from phylib */ 418 - void asix_adjust_link(struct net_device *netdev) 419 - { 420 - struct phy_device *phydev = netdev->phydev; 421 - struct usbnet *dev = netdev_priv(netdev); 422 - u16 mode = 0; 423 - 424 - if (phydev->link) { 425 - mode = AX88772_MEDIUM_DEFAULT; 426 - 427 - if (phydev->duplex == DUPLEX_HALF) 428 - mode &= ~AX_MEDIUM_FD; 429 - 430 - if (phydev->speed != SPEED_100) 431 - mode &= ~AX_MEDIUM_PS; 432 - } 433 - 434 - asix_write_medium_mode(dev, mode, 0); 435 - phy_print_status(phydev); 436 - usbnet_link_change(dev, phydev->link, 0); 437 - } 438 - 439 417 int asix_write_gpio(struct usbnet *dev, u16 value, int sleep, int in_pm) 440 418 { 441 419 int ret;
+4 -13
drivers/net/usb/asix_devices.c
··· 752 752 struct usbnet *dev = netdev_priv(to_net_dev(config->dev)); 753 753 754 754 asix_write_medium_mode(dev, 0, 0); 755 - usbnet_link_change(dev, false, false); 756 755 } 757 756 758 757 static void ax88772_mac_link_up(struct phylink_config *config, ··· 782 783 m |= AX_MEDIUM_RFC; 783 784 784 785 asix_write_medium_mode(dev, m, 0); 785 - usbnet_link_change(dev, true, false); 786 786 } 787 787 788 788 static const struct phylink_mac_ops ax88772_phylink_mac_ops = { ··· 1348 1350 .description = "ASIX AX88772 USB 2.0 Ethernet", 1349 1351 .bind = ax88772_bind, 1350 1352 .unbind = ax88772_unbind, 1351 - .status = asix_status, 1352 1353 .reset = ax88772_reset, 1353 1354 .stop = ax88772_stop, 1354 - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET, 1355 + .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_MULTI_PACKET, 1355 1356 .rx_fixup = asix_rx_fixup_common, 1356 1357 .tx_fixup = asix_tx_fixup, 1357 1358 }; ··· 1359 1362 .description = "ASIX AX88772B USB 2.0 Ethernet", 1360 1363 .bind = ax88772_bind, 1361 1364 .unbind = ax88772_unbind, 1362 - .status = asix_status, 1363 1365 .reset = ax88772_reset, 1364 1366 .stop = ax88772_stop, 1365 - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | 1366 - FLAG_MULTI_PACKET, 1367 + .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_MULTI_PACKET, 1367 1368 .rx_fixup = asix_rx_fixup_common, 1368 1369 .tx_fixup = asix_tx_fixup, 1369 1370 .data = FLAG_EEPROM_MAC, ··· 1371 1376 .description = "Linux Automation GmbH USB 10Base-T1L", 1372 1377 .bind = ax88772_bind, 1373 1378 .unbind = ax88772_unbind, 1374 - .status = asix_status, 1375 1379 .reset = ax88772_reset, 1376 1380 .stop = ax88772_stop, 1377 - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | 1378 - FLAG_MULTI_PACKET, 1381 + .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_MULTI_PACKET, 1379 1382 .rx_fixup = asix_rx_fixup_common, 1380 1383 .tx_fixup = asix_tx_fixup, 1381 1384 .data = FLAG_EEPROM_MAC, ··· 1405 1412 .description = "HG20F9 USB 2.0 Ethernet", 1406 1413 .bind = ax88772_bind, 1407 1414 .unbind = ax88772_unbind, 1408 - .status = asix_status, 1409 1415 .reset = ax88772_reset, 1410 - .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | 1411 - FLAG_MULTI_PACKET, 1416 + .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_MULTI_PACKET, 1412 1417 .rx_fixup = asix_rx_fixup_common, 1413 1418 .tx_fixup = asix_tx_fixup, 1414 1419 .data = FLAG_EEPROM_MAC,