Author: imp
Date: Sat Mar 14 02:36:45 2020
New Revision: 358987
URL: https://svnweb.freebsd.org/changeset/base/358987

Log:
  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@

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c   Sat Mar 14 02:24:11 2020        (r358986)
+++ head/sys/cam/cam_periph.c   Sat Mar 14 02:36:45 2020        (r358987)
@@ -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();
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to