PERFORCE change 171473 for review

Alexander Motin mav at FreeBSD.org
Sun Dec 6 22:43:07 UTC 2009


http://p4web.freebsd.org/chv.cgi?CH=171473

Change 171473 by mav at mav_mavtest on 2009/12/06 22:42:24

	Increase device reference count while we hold freeze on it.
	Elseway if device disappears, we will unfreeze something unexpected.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#22 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#22 (text+ko) ====

@@ -54,6 +54,7 @@
 #include <cam/cam_ccb.h>
 #include <cam/cam_periph.h>
 #include <cam/cam_xpt_periph.h>
+#include <cam/cam_xpt_internal.h>
 #include <cam/cam_sim.h>
 
 #include <cam/ata/ata_all.h>
@@ -178,6 +179,7 @@
 		    i, 0) == CAM_REQ_CMP) {
 printf("PMP freeze: %d\n", i);
 			softc->frozen |= (1 << i);
+			xpt_acquire_device(dpath->device);
 			cam_freeze_devq(dpath);
 			xpt_free_path(dpath);
 		}
@@ -201,6 +203,7 @@
 printf("PMP release: %d\n", i);
 			softc->frozen &= ~(1 << i);
 			cam_release_devq(dpath, 0, 0, 0, FALSE);
+			xpt_release_device(dpath->device);
 			xpt_free_path(dpath);
 		}
 	}
@@ -228,6 +231,7 @@
 			xpt_free_path(dpath);
 		}
 	}
+	pmprelease(periph, -1);
 	xpt_print(periph->path, "lost device\n");
 }
 


More information about the p4-projects mailing list