Re: [PATCH v4 3/3] net: usb: ax88179_178a: add USB device driver for config selection
From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-10-09 11:56:31
Also in:
linux-usb
From: Andrew Lunn <andrew@lunn.ch>
Date: 2025-10-09 11:56:31
Also in:
linux-usb
On Thu, Oct 09, 2025 at 03:34:50PM +0800, yicongsrfy@163.com wrote:
Hi, Oliver: Thank you for your reply! The issues you mentioned above, I will fix them one by one in new patch versions. However, I'm a bit confused about the following comment:quoted
quoted
+ +static void __exit ax88179_driver_exit(void) +{ + usb_deregister(&ax88179_178a_driver);The window for the racequoted
+ usb_deregister_device_driver(&ax88179_cfgselector_driver);Wrong order. I you remove ax88179_178a_driver before you remove ax88179_cfgselector_driver, you'll leave a window during which devices would be switched to a mode no driver exists for.In my init function, I first call usb_register_device_driver and then call usb_register; in exit, I reverse the order by calling usb_deregister first, then usb_deregister_device_driver. Why is this sequence considered incorrect?
This is not about the order you do things in this patch. It is about the order of the patches. It is assumed that this hardware somewhat works with the old driver. But without this patch the hardware does not work? Anybody doing a git bisect could land on the first patch, and have broken networking. So you need the patches in the opposite order. Make sure the driver will work before swapping to it. Andrew