Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2012 08:50:05 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241536 - head/sys/cam
Message-ID:  <201210140850.q9E8o523026777@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Oct 14 08:50:05 2012
New Revision: 241536
URL: http://svn.freebsd.org/changeset/base/241536

Log:
  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:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Sun Oct 14 07:55:14 2012	(r241535)
+++ head/sys/cam/cam_periph.c	Sun Oct 14 08:50:05 2012	(r241536)
@@ -1250,6 +1250,9 @@ cam_periph_freeze_after_event(struct cam
 	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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210140850.q9E8o523026777>