[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a1b4778-4cf0-4483-9611-93b37d9a2361@suse.com>
Date: Thu, 9 Oct 2025 10:46:10 +0200
From: Oliver Neukum <oneukum@...e.com>
To: yicongsrfy@....com, oneukum@...e.com
Cc: 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
Hi,
On 09.10.25 09:34, yicongsrfy@....com wrote:
>>> +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?
To explain this I need to make a chart:
CPU A CPU B
usb_deregister(&ax88179_178a_driver);
New device registered
ax88179_cfgselector_driver:
Device switches to proprietary mode
usb_deregister_device_driver(&ax88179_cfgselector_driver);
[This comes too late. No consequences for current events]
No driver. No probe().
Very sad device. Disappointed user.
I hope you excuse my attempt at humor. Anyway this order is incorrect, as I hope
you see from the chart. Now you may say that the class mode would not work
anyway, but that is an iffy argument. It is better to have the order that is
right.
Regards
Oliver
Powered by blists - more mailing lists