Re: [PATCH 1/3] usb: misc: Add Intel USBIO bridge driver

Hans de Goede
2025-08-11T09:29:17Z

Hi,

On 11-Aug-25 11:23 AM, Sakari Ailus wrote:

...

>>> The documantation says you can't access USB interfaces once disconnect has
>>> returned. I'm not sure if there are checks to safeguard against ongoing or
>>> additional accesses in the USB stack but on many other buses this may
>>> simply lead to a system crash.
>>
>> How can you access the USB interface after disconnect has returned on
>> these codepaths? The child devices should all be cleaned up properly
>> after disconnect happens so there should not be a pointer to even use
>> anymore.
>
> See functions exported by the main USBIO driver.

As Greg says the rules for USB devices are clear no usb_device access
in any form is allowed after the disconnect() callback completes.

It is up to the USBIO driver to ensure that this does not happen,
also see my proposed disconnect() changes in reply to your review.

Note those changes are to fix races between the auxdev child/client
drivers and disconnect() the auxdev client drivers also should no
longer make any calls to the USBIO functions after their remove()
callback has completed.

Regards,

Hans