From owner-freebsd-arm@freebsd.org Mon Aug 19 14:26:47 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F318CC8140 for ; Mon, 19 Aug 2019 14:26:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Bx7q3mPsz3PKd for ; Mon, 19 Aug 2019 14:26:47 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1566224805; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=oM6oTFCEHZNdkQmxl6u0M9BN6ua+zI6nLpKWlM5Sm0Cw/uIJ0PHoyzfA2qsnyPKtmyzmTsDvj2yC2 73991igd2Go49hOLFAgFEfqguFWel83LRJ8KVs+eOFfyvmRcGnpxEMJt6XHvf2fQYSAIjQJrAVy7gk APSmuRoED4q0mEroxQVjy6EubcGtYQ/O4ahJPjKpoTvfF22TnRLKXU9Q9ujqnfSUKPo1LlBMevWPXX alMfplYjX6oXtGnAnax0cChsUsSicBWQTVAOWxlXdbHh9DAoenB9Jlg6+j8kzQBkNFrkFWqOPT+ap+ YSlVSteXyMeqvJ9bi2jmO5pouMXIuyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=dUhtPb/Y5GQIcYY8TWECX942zsMVTCQS4jJa0WpUPJA=; b=JQ6KnCU0xQioOrLnMPGi/1FrXnutrj+AF2xBSJSDx4fUHs/8V4Cu0zwWG/o/MMSIz3klFYJmw5QAS h2kC3/B9Y9j9sfe1KUxFWYcNb8YUfLyBn2R5YA57yDnjXgD8f2gcFBQMleFgXmIZt+QvshKDloZ6tX r4JnT0d4oIKYlQHx0i/sqzwrLPN1mONyvYhtccfRb2AhlIsECsIsXZ060UuakTASKUNfMUbcvVFZi/ Kkghbft1yxf1BvL6IRLOIbE6CCeD3W4PXvFKwx9lazgpILNQI4o/IlgkG5I6VZy3mxXpVxx6HGUi9I GHNzEbOAs3ZVqfCqxPh6Zo3qyYm4g/g== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=dUhtPb/Y5GQIcYY8TWECX942zsMVTCQS4jJa0WpUPJA=; b=fVXOnUf+gkoN5DNXHjC9SVKSHooihC5+tweDM8Lps1+/EB9i/JlNlNdnxdszBXbHHRj25yQDNMbEn gSBes40ep+5W6TSm57p2/dJ7tVe3tsAeBysJQmOUOKFBAE3iIiLp05oiP5w2sd6PcH5GgL2tI97/pV 0rZ1aaU8sj255aVK4R3bUdsJurAzYP7V4kiOL7KwZNFFjFxlnoEtOo4782xkzGWhG1zbp+u31ffwME HQiXjVhOupbGEYUdi9iRYVheBF0qeFZplT4muAYmoCYOxJm+BI8Mo/2xUI0NJjNr+SNV5hcb5qzQsA 8kxFnWxh3RNPwAD+dE1XjzZr2dthm4A== X-MHO-RoutePath: aGlwcGll X-MHO-User: 5d5bc8dc-c28d-11e9-85ec-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 5d5bc8dc-c28d-11e9-85ec-13b9aae3a1d2; Mon, 19 Aug 2019 14:26:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x7JEQggv075993; Mon, 19 Aug 2019 08:26:42 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: Is it a good idea to use a usb-serial adapter for PPS input? Yes, it is. From: Ian Lepore To: "O'Connor, Daniel" Cc: "usb@freebsd.org" , "freebsd-arm@FreeBSD.org" Date: Mon, 19 Aug 2019 08:26:42 -0600 In-Reply-To: <9E142F1A-5E8C-4410-91F5-7C80B3D0A15B@dons.net.au> References: <61B1AAF3-40F6-47BC-8F05-7491C13BF288@dons.net.au> <9E142F1A-5E8C-4410-91F5-7C80B3D0A15B@dons.net.au> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46Bx7q3mPsz3PKd X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 14:26:48 -0000 On Mon, 2019-08-19 at 17:09 +0930, O'Connor, Daniel wrote: > > On 12 Aug 2019, at 09:09, O'Connor, Daniel > > wrote: > > > always get lost on single-core processors which are in cpu_idle() > > > at > > > the time the hardclock interrupt happens. (But that's fixable by > > > just > > > increasing the number of timehands, I think at least 4 are > > > required.) > > > > OK, how do I increase the number of clock hands? > > I am going to try this diff but buildkernel is going to take a > while... > > diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c > index 2656fb4d2..00440b6a2 100644 > --- a/sys/kern/kern_tc.c > +++ b/sys/kern/kern_tc.c > @@ -83,8 +83,48 @@ struct timehands { > struct timehands *th_next; > }; > > -static struct timehands th0; > +static struct timehands th2; > static struct timehands th1 = { > + .th_next = &th2 > +}; > + > +static struct timehands th3; > +static struct timehands th2 = { > + .th_next = &th3 > +}; > + > +static struct timehands th4; > +static struct timehands th3 = { > + .th_next = &th4 > +}; > + > +static struct timehands th5; > +static struct timehands th4 = { > + .th_next = &th5 > +}; > + > +static struct timehands th6; > +static struct timehands th5 = { > + .th_next = &th6 > +}; > + > +static struct timehands th7; > +static struct timehands th6 = { > + .th_next = &th7 > +}; > + > +static struct timehands th8; > +static struct timehands th7 = { > + .th_next = &th8 > +}; > + > +static struct timehands th9; > +static struct timehands th8 = { > + .th_next = &th9 > +}; > + > +static struct timehands th0; > +static struct timehands th9 = { > .th_next = &th0 > }; > static struct timehands th0 = { > Oh, I'm sorry, I forgot to respond about this. Yeah, that patch would do it. I think a minimum of 4 sets of timehands are needed for pps capture on a single-core system with a latching timecounter like dmtpps. -- Ian