Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Aug 2015 23:31:32 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286429 - head/sys/kern
Message-ID:  <201508072331.t77NVWaK003872@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Fri Aug  7 23:31:31 2015
New Revision: 286429
URL: https://svnweb.freebsd.org/changeset/base/286429

Log:
  Only process the PPS event types currently enabled in pps_params.mode.
  
  This makes the PPS API behave correctly, but isn't ideal -- we still end
  up capturing PPS data for non-enabled edges, we just don't process the
  data into an event that becomes visible outside of kern_tc.  That's because
  the event type isn't passed to pps_capture(), so it can't do the filtering.
  Any solution for capture filtering is going to require touching every driver.

Modified:
  head/sys/kern/kern_tc.c

Modified: head/sys/kern/kern_tc.c
==============================================================================
--- head/sys/kern/kern_tc.c	Fri Aug  7 23:03:17 2015	(r286428)
+++ head/sys/kern/kern_tc.c	Fri Aug  7 23:31:31 2015	(r286429)
@@ -1703,6 +1703,9 @@ pps_event(struct pps_state *pps, int eve
 #endif
 
 	KASSERT(pps != NULL, ("NULL pps pointer in pps_event"));
+	/* Nothing to do if not currently set to capture this event type. */
+	if ((event & pps->ppsparam.mode) == 0)
+		return;
 	/* If the timecounter was wound up underneath us, bail out. */
 	if (pps->capgen == 0 || pps->capgen !=
 	    atomic_load_acq_int(&pps->capth->th_generation))



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