Add comment about how the deferred callback for AC_FOUND_DEVICE we

generate for a race where a device goes away, we start to tear down
the periph state for the device, and then the device suddently
reappears. The key that makes it work is removal of periph from the
drv list before calling the deferred callback.

Hat tip to: mav@
This commit is contained in:
Warner Losh 2020-03-14 02:36:45 +00:00
parent bec8faad55
commit 81490eda60

View File

@ -729,7 +729,9 @@ camperiphfree(struct cam_periph *periph)
periph->periph_dtor(periph);
/*
* The peripheral list is protected by the topology lock.
* The peripheral list is protected by the topology lock. We have to
* remove the periph from the drv list before we call deferred_ac. The
* AC_FOUND_DEVICE callback won't create a new periph if it's still there.
*/
xpt_lock_buses();