From nobody Thu Jun 23 18:00:09 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D05EF873BAC for ; Thu, 23 Jun 2022 18:00:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LTShT355Vz3LHW for ; Thu, 23 Jun 2022 18:00:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A7931FBF4 for ; Thu, 23 Jun 2022 18:00:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 25NI09e3058576 for ; Thu, 23 Jun 2022 18:00:09 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 25NI09gY058574 for bugs@FreeBSD.org; Thu, 23 Jun 2022 18:00:09 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 264855] axe: axe usb driver, AX88772, fails to perform autoselect when the axe interface is changed from forced mode to autoselect mode Date: Thu, 23 Jun 2022 18:00:09 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jiahali@blackberry.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656007209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tY1si1uQ2IZqMVmGulMLwDPmXLo6kUomCR6qtxO+Vk4=; b=RjJuOu6lD8Ts6wzBwprW5bpgdvG85sD76SXVn+/VRwoXqfpQFaRLJ0ceV3i8WtUQPuNMAQ VZiv9l7XIWNKxr/vlgEBi7CyLvOz2a2SMXP2b+yr1NRl9Woav/qsMeLYaEl8KZnRwqnOlz BN2T718kugaVIvj0ensx8bJllMw/Da+sC1grXlMQ90a80G74Zk8GWhTjYsjH4OzuPYKE44 KNq/fiSPF4xD+H45b1LP+CFfPBvR7Mv2SSbq48gDbD2NWbeG1jPpGMj+QEz5Hm/61YMg2n 8ZrS7g0RSdRqf9p7Zob4tcdGl/l33At50llR7mM16Kz/Id+oiLSQBRY1O1JCag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656007209; a=rsa-sha256; cv=none; b=Js+g2zNVh87E21CgemPMbrvArhoSL7Y2CXWZpdF88vEfP3AfF3ar5/yI2GFqQk9G2jHYwZ I6rw5eVINY5Voum86fiszw+j8VqnXJvWVDzgMHfcetN27KQadhIQQlYt524VMz5l4y7Fmk kt3bk3e+ctv3kK2brfR3jy43GxpcTAeWTF/T2K7MpttaxUFVBaYJx2jq4/AoUfGA4atbpU 2DgoQUlnilAsuYgeJ7pgPNeX9maRoqh5s4lVBCPCUW02xzguGutNTasqp4YejQxoJBh+Dz rJNrb54E15d697RetxCr+aa/jUZvGu87WSlfbwI0hwM0grkI+W/lYqzbs7Hi1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264855 Bug ID: 264855 Summary: axe: axe usb driver, AX88772, fails to perform autoselect when the axe interface is changed from forced mode to autoselect mode Product: Base System Version: CURRENT Hardware: arm64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: jiahali@blackberry.com Created attachment 234897 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D234897&action= =3Dedit Preliminary fix patch for restarting autoselect mode in AX88772 Test is based on the current release of Freebsd. root@generic:~ # uname -a FreeBSD generic 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n254961-b91a48693= a5: Thu Apr 21 09:35:51 UTC 2022=20=20=20=20 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm= 64 I use RockPro64 LPDDR4:4G to perform the following test. The axe interface = is directly connected to a Linux host interface, enp0s31f6. 1. The axe interface and enp0s31f6 are set to their highest speed and full duplex mode when autonegotiation is enable in both interface after booting = up root@generic:~ # ifconfig -m ue0 ue0: flags=3D8843 metric 0 mtu 1500 options=3D80008 capabilities=3D80008 ether 00:80:c8:3a:ba:f1 inet 192.168.3.76 netmask 0xffffff00 broadcast 192.168.3.255 media: Ethernet autoselect (100baseTX ) status: active supported media: media autoselect media 100baseTX mediaopt full-duplex media 100baseTX media 10baseT/UTP mediaopt full-duplex media 10baseT/UTP nd6 options=3D29 $ sudo ethtool enp0s31f6 [sudo] password for jiahali:=20 Settings for enp0s31f6: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full=20 100baseT/Half 100baseT/Full=20 1000baseT/Full=20 Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full=20 100baseT/Half 100baseT/Full=20 1000baseT/Full=20 Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: on (auto) Supports Wake-on: pumbg Wake-on: d Current message level: 0x00000007 (7) drv probe link Link detected: yes 2. Changing the axe interface to a forced mode. The enp0s31f6 is set as same speed but half-duplex mode root@generic:~ # ifconfig -m ue0 media 10baseT/UTP mediaopt full-duplex root@generic:~ # ifconfig -m ue0 ue0: flags=3D8843 metric 0 mtu 1500 options=3D80008 capabilities=3D80008 ether 00:80:c8:3a:ba:f1 inet 192.168.3.76 netmask 0xffffff00 broadcast 192.168.3.255 media: Ethernet 10baseT/UTP status: active supported media: media autoselect media 100baseTX mediaopt full-duplex media 100baseTX media 10baseT/UTP mediaopt full-duplex media 10baseT/UTP nd6 options=3D29 $ sudo ethtool enp0s31f6 Settings for enp0s31f6: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full=20 100baseT/Half 100baseT/Full=20 1000baseT/Full=20 Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full=20 100baseT/Half 100baseT/Full=20 1000baseT/Full=20 Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 10Mb/s Duplex: Half Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: on (auto) Supports Wake-on: pumbg Wake-on: d Current message level: 0x00000007 (7) drv probe link Link detected: yes 3. Changing the axe interface back to autoselect mode. The axe interface and enp0s31f6 fail to perform autoselect to configure both interfaces to their highest speed and best duplex mode, 100Mb/s and full-duplex in this case. root@generic:~ # ifconfig -m ue0 media autoselect root@generic:~ # ifconfig -m ue0 ue0: flags=3D8843 metric 0 mtu 1500 options=3D80008 capabilities=3D80008 ether 00:80:c8:3a:ba:f1 inet 192.168.3.76 netmask 0xffffff00 broadcast 192.168.3.255 media: Ethernet autoselect (10baseT/UTP ) status: active supported media: media autoselect media 100baseTX mediaopt full-duplex media 100baseTX media 10baseT/UTP mediaopt full-duplex media 10baseT/UTP nd6 options=3D29 $ sudo ethtool enp0s31f6 Settings for enp0s31f6: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full=20 100baseT/Half 100baseT/Full=20 1000baseT/Full=20 Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full=20 100baseT/Half 100baseT/Full=20 1000baseT/Full=20 Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 10Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: on (auto) Supports Wake-on: pumbg Wake-on: d Current message level: 0x00000007 (7) drv probe link Link detected: yes Analysis: I tried to fix this issue in my target, where my developemnt environment is based on FreeBSD 13.0-RELEASE-p11. The fix patch is attached. The AX88772 usb ethernet controller in axe interface uses rlphy as its phy interface in rockpro64. The rlphy will use the common subroutines, mii_physubr.c, in io-sock to set its media's type. The AX88772 in axe shows that it supports media autoselect mode. But, in mii_physubr.c/mii_phy_setmedia(), the mii device should be tagged with MIIF_DOPAUSE or MIIF_FORCEANEG to enable autoselct mode when the autonegotiation is enabled in rlphy's control register. In if_axe.c, AX88772 is tagged with neither the MIIF_DOPAUSE nor MIIF_FORCE= ANEG now. According to the source code commit in Freebsd, commit id cdc2a5ec78b4a8b1520351def4a6e7280502ec89, the author does not want to enable flow control in AX88772 because of the lack of test. Thus, MIIF_FORCEANEG should be used to turn on the autoselect mode when the bit of enabling auto-negotiation in rlphy's control register is turned on. --=20 You are receiving this mail because: You are the assignee for the bug.=