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".
This commit is contained in:
Alexander Motin 2012-10-14 08:50:05 +00:00
parent d0fd6bb00e
commit f8ff57d287
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241536

View File

@ -1250,6 +1250,9 @@ cam_periph_freeze_after_event(struct cam_periph *periph,
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;