[Midnightbsd-cvs] src [8251] trunk/sys/cam/cam_periph.c: Add explicit check for not set time inside cam_periph_freeze_after_event().

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Sep 17 17:35:14 EDT 2016


Revision: 8251
          http://svnweb.midnightbsd.org/src/?rev=8251
Author:   laffer1
Date:     2016-09-17 17:35:14 -0400 (Sat, 17 Sep 2016)
Log Message:
-----------
Add explicit check for not set time inside cam_periph_freeze_after_event().

System time is set later on boot process then initial bus scan by CAM.
Until that moment microtime() is equal to microuptime(), and if system
boots quickly, the value can be close to zero. That causes settle time
waiting even for buses that don't use reset during probe.

On my test system this reduces boot time by 1 second if USB enabled, or
by 4 seconds if USB disabled.  CAM waited for ctl2cam0 bus "settle".

Modified Paths:
--------------
    trunk/sys/cam/cam_periph.c

Modified: trunk/sys/cam/cam_periph.c
===================================================================
--- trunk/sys/cam/cam_periph.c	2016-09-17 21:34:46 UTC (rev 8250)
+++ trunk/sys/cam/cam_periph.c	2016-09-17 21:35:14 UTC (rev 8251)
@@ -1257,6 +1257,9 @@
 	struct timeval delta;
 	struct timeval duration_tv;
 
+	if (!timevalisset(event_time))
+		return;
+
 	microtime(&delta);
 	timevalsub(&delta, event_time);
 	duration_tv.tv_sec = duration_ms / 1000;



More information about the Midnightbsd-cvs mailing list