[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2455d227-6008-4b7d-802e-54f0d265c68d@lunn.ch>
Date: Thu, 9 Oct 2025 13:56:13 +0200
From: Andrew Lunn <andrew@...n.ch>
To: yicongsrfy@....com
Cc: oneukum@...e.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, linux-usb@...r.kernel.org,
marcan@...can.st, netdev@...r.kernel.org, pabeni@...hat.com,
yicong@...inos.cn
Subject: Re: [PATCH v4 3/3] net: usb: ax88179_178a: add USB device driver for
config selection
On Thu, Oct 09, 2025 at 03:34:50PM +0800, yicongsrfy@....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:
>
> > > +
> > > +static void __exit ax88179_driver_exit(void)
> > > +{
> > > + usb_deregister(&ax88179_178a_driver);
> >
> > The window for the race
> >
> > > + 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
Powered by blists - more mailing lists