netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Pecio <michal.pecio@gmail.com>
To: yicongsrfy@163.com
Cc: oneukum@suse.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, marcan@marcan.st,
	pabeni@redhat.com, linux-usb@vger.kernel.org,
	netdev@vger.kernel.org, yicong@kylinos.cn
Subject: Re: [PATCH v2 2/3] net: usb: support quirks in usbnet
Date: Mon, 29 Sep 2025 09:11:53 +0200	[thread overview]
Message-ID: <20250929091153.4c769e44.michal.pecio@gmail.com> (raw)
In-Reply-To: <20250929053145.3113394-3-yicongsrfy@163.com>

On Mon, 29 Sep 2025 13:31:44 +0800, yicongsrfy@163.com wrote:
> From: Yi Cong <yicong@kylinos.cn>
> 
> Some vendors' USB network interface controllers (NICs) may be compatible
> with multiple drivers.
> 
> I consulted with relevant vendors. Taking the AX88179 chip as an example,
> NICs based on this chip may be used across various OS—for instance,
> cdc_ncm is used on macOS, while ax88179_178a.ko is the intended driver
> on Linux (despite a previous patch having disabled it).
> Therefore, the firmware must support multiple protocols.
> 
> Currently, both cdc_ncm and ax88179_178a coexist in the Linux kernel.
> Supporting both drivers simultaneously leads to the following issues:
> 
> 1. Inconsistent driver loading order during reboot stress testing:
>    The order in which drivers are loaded can vary across reboots,
>    potentially resulting in the unintended driver being loaded. For
>    example:
> [    4.239893] cdc_ncm 2-1:2.0: MAC-Address: c8:a3:62:ef:99:8e
> [    4.239897] cdc_ncm 2-1:2.0: setting rx_max = 16384
> [    4.240149] cdc_ncm 2-1:2.0: setting tx_max = 16384
> [    4.240583] cdc_ncm 2-1:2.0 usb0: register 'cdc_ncm' at usb-
> xxxxx:00-1, CDC NCM, c8:a3:62:ef:99:8e
> [    4.240627] usbcore: registered new interface driver cdc_ncm
> [    4.240908] usbcore: registered new interface driver ax88179_178a
> 
> In this case, network connectivity functions, but the cdc_ncm driver is
> loaded instead of the expected ax88179_178a.
> 
> 2. Similar issues during cable plug/unplug testing:
>    The same race condition can occur when reconnecting the USB device:
> [   79.879922] usb 4-1: new SuperSpeed USB device number 3 using xhci_hcd
> [   79.905168] usb 4-1: New USB device found, idVendor=0b95, idProduct=
> 1790, bcdDevice= 2.00
> [   79.905185] usb 4-1: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [   79.905191] usb 4-1: Product: AX88179B
> [   79.905198] usb 4-1: Manufacturer: ASIX
> [   79.905201] usb 4-1: SerialNumber: 00EF998E
> [   79.915215] ax88179_probe, bConfigurationValue:2
> [   79.952638] cdc_ncm 4-1:2.0: MAC-Address: c8:a3:62:ef:99:8e
> [   79.952654] cdc_ncm 4-1:2.0: setting rx_max = 16384
> [   79.952919] cdc_ncm 4-1:2.0: setting tx_max = 16384
> [   79.953598] cdc_ncm 4-1:2.0 eth0: register 'cdc_ncm' at usb-0000:04:
> 00.2-1, CDC NCM (NO ZLP), c8:a3:62:ef:99:8e
> [   79.954029] cdc_ncm 4-1:2.0 eth0: unregister 'cdc_ncm' usb-0000:04:
> 00.2-1, CDC NCM (NO ZLP)
> 
> At this point, the network becomes unusable.
> 
> To resolve these issues, introduce a *quirks* mechanism into the usbnet
> module. By adding chip-specific identification within the generic usbnet
> framework, we can skip the usbnet probe process for devices that require a
> dedicated driver.

And if the vendor driver is not available then the device won't work at
all, for a completely artificial reason. We have had such problems.

At the very least, this should check if CONFIG_AX88179 is enabled.

Regards,
Michal

  reply	other threads:[~2025-09-29  7:12 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-28  1:46 [PATCH 1/2] Revert "net: usb: ax88179_178a: Bind only to vendor-specific interface" yicongsrfy
2025-09-28  1:46 ` [PATCH 2/2] net: usb: support quirks in usbnet yicongsrfy
2025-09-29  4:23   ` Jakub Kicinski
2025-09-29  5:31     ` [PATCH v2 0/3] ax88179 driver optimization yicongsrfy
2025-09-29  5:31       ` [PATCH v2 1/3] Revert "net: usb: ax88179_178a: Bind only to vendor-specific interface" yicongsrfy
2025-09-29  7:02         ` Michal Pecio
2025-09-29  7:25           ` yicongsrfy
2025-09-29  5:31       ` [PATCH v2 2/3] net: usb: support quirks in usbnet yicongsrfy
2025-09-29  7:11         ` Michal Pecio [this message]
2025-09-29  7:29           ` yicongsrfy
2025-09-29  5:31       ` [PATCH v2 3/3] net: usb: ax88179_178a: add USB device driver for config selection yicongsrfy
2025-09-29  5:42         ` yicongsrfy
2025-09-29  7:53           ` [PATCH v3 1/3] Revert "net: usb: ax88179_178a: Bind only to vendor-specific interface" yicongsrfy
2025-09-29  7:54             ` [PATCH v3 2/3] net: usb: support quirks in usbnet yicongsrfy
2025-09-29  7:54             ` [PATCH v3 3/3] net: usb: ax88179_178a: add USB device driver for config selection yicongsrfy
2025-09-29 11:20               ` Oliver Neukum
2025-09-29 16:11               ` Jakub Kicinski
2025-09-29 11:15             ` [PATCH v3 1/3] Revert "net: usb: ax88179_178a: Bind only to vendor-specific interface" Oliver Neukum
2025-09-29  8:45   ` [PATCH 2/2] net: usb: support quirks in usbnet Oliver Neukum
2025-09-29  9:29     ` yicongsrfy
2025-09-29 10:21       ` Oliver Neukum
2025-09-30  8:07         ` [PATCH v4 1/3] Revert "net: usb: ax88179_178a: Bind only to vendor-specific interface" yicongsrfy
2025-09-30  8:07           ` [PATCH v4 2/3] net: usb: support quirks in cdc_ncm yicongsrfy
2025-09-30  8:37             ` Greg KH
2025-09-30  8:38             ` Greg KH
2025-09-30  8:07           ` [PATCH v4 3/3] net: usb: ax88179_178a: add USB device driver for config selection yicongsrfy
2025-09-30  8:38             ` Greg KH
2025-09-30  8:57             ` Oliver Neukum
2025-10-09  7:34               ` yicongsrfy
2025-10-09  8:46                 ` Oliver Neukum
2025-10-09 11:56                 ` Andrew Lunn
2025-10-13  5:59               ` Michal Pecio
2025-10-13  8:46                 ` Oliver Neukum
2025-10-06 16:33           ` [PATCH v4 1/3] Revert "net: usb: ax88179_178a: Bind only to vendor-specific interface" Andrew Lunn
2025-09-30  8:14         ` [PATCH 2/2] net: usb: support quirks in usbnet yicongsrfy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250929091153.4c769e44.michal.pecio@gmail.com \
    --to=michal.pecio@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=pabeni@redhat.com \
    --cc=yicong@kylinos.cn \
    --cc=yicongsrfy@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).