From owner-svn-src-all@freebsd.org Sun Aug 23 16:22:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BD39C03BC; Sun, 23 Aug 2015 16:22:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41CF11FE5; Sun, 23 Aug 2015 16:22:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7NGMMad095211; Sun, 23 Aug 2015 16:22:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7NGMM1D095210; Sun, 23 Aug 2015 16:22:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201508231622.t7NGMM1D095210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 23 Aug 2015 16:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r287036 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2015 16:22:22 -0000 Author: ian Date: Sun Aug 23 16:22:21 2015 New Revision: 287036 URL: https://svnweb.freebsd.org/changeset/base/287036 Log: MFC r286423, r286429: RFC 2783 requires a status of ETIMEDOUT, not EWOULDBLOCK, on a timeout. Only process the PPS event types currently enabled in pps_params.mode. Modified: stable/10/sys/kern/kern_tc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_tc.c ============================================================================== --- stable/10/sys/kern/kern_tc.c Sun Aug 23 16:17:00 2015 (r287035) +++ stable/10/sys/kern/kern_tc.c Sun Aug 23 16:22:21 2015 (r287036) @@ -1511,8 +1511,12 @@ pps_fetch(struct pps_fetch_args *fapi, s } else { err = tsleep(pps, PCATCH, "ppsfch", timo); } - if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { - continue; + if (err == EWOULDBLOCK) { + if (fapi->timeout.tv_sec == -1) { + continue; + } else { + return (ETIMEDOUT); + } } else if (err != 0) { return (err); } @@ -1668,6 +1672,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 != pps->capth->th_generation) return;