From owner-freebsd-bugs@freebsd.org Fri Dec 8 11:20:31 2017 Return-Path: Delivered-To: freebsd-bugs@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 EA769E80A0D for ; Fri, 8 Dec 2017 11:20:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 CF08F6E61A for ; Fri, 8 Dec 2017 11:20:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vB8BKVCt043877 for ; Fri, 8 Dec 2017 11:20:31 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 224173] serial driver from 10.4 onwards doesn't correctly work in ntpd/DCF77 "parse" clock mode Date: Fri, 08 Dec 2017 11:20:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd-d9e@fasterix.frmug.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Dec 2017 11:20:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224173 Bug ID: 224173 Summary: serial driver from 10.4 onwards doesn't correctly work in ntpd/DCF77 "parse" clock mode Product: Base System Version: 11.1-STABLE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: freebsd-d9e@fasterix.frmug.org I'm running a DCF77 (German radio time code) receiver in "raw pulse" mode in ntpd. The receiver emits 100 ms ("0") or 200 ms ("1") pulses on the RX and/or CTS= /DCD line of the serial port. There are 59 pulses per minute, one per second except on second 59. See https://en.wikipedia.org/wiki/DCF77 On FreeBSD 11.1 with ntpd, there are 2 modes in which the receiver can be u= sed: - "parse" mode, where the timecode is decoded bit by bit. In this mode the serial port is configured at 50 bauds. A 100 ms pulse yields a character, a= 200 ms pulse yields a framing error. - "PPS" mode, where the uart driver timestamps a transition on DCD. PPS mode works flawlessly. On the other hand, the parse timecode mode (50 bauds) doesn't. Bits are los= t (I haven't yet investigated whether only 1-bits or 0-bits are lost, or if the pattern is more complex). On FreeBSD 10.4 this doesn't work either (same serial driver as in 11.1). On the other hand, on FreeBSD 9.3 the receiver works (older serial driver). Where this gets very interesting is that the above mentioned FreeBSD 9.3 ru= ns as a guest in a VirtualBox on the very same FreeBSD 11.1 host, with the host serial port configured in VirtualBox to point to /dev/cuau0, and seen as a 16550 UART by FreeBSD 9.3. It doesn't work on a FreeBSD 11.1 under VirtualBox, which is less surprisin= g. Relevant bits of my ntp.conf for the non-working timecode mode: # Configuration for "timecode mode" # DCF77 module on /dev/refclock-1 (link to /dev/cuau0) server 127.127.8.1 mode 5 fudge 127.127.8.1 time1 1.843 Excerpt from failed parsing logs. Dec 7 22:10:31 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:10:41 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 4 bits Dec 7 22:10:49 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:10:59 freebsd11-1 last message repeated 2 times Dec 7 22:11:01 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 1 bits Dec 7 22:11:08 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 1 bits Dec 7 22:11:10 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:11:32 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 16 bits Dec 7 22:11:34 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:11:51 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 11 bits Dec 7 22:11:53 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:12:00 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 5 bits Dec 7 22:12:17 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 12 bits Dec 7 22:12:19 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:12:40 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 15 bits Dec 7 22:12:42 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:12:51 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 3 bits Dec 7 22:12:53 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:13:07 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 7 bits Dec 7 22:13:09 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:13:20 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 5 bits Dec 7 22:13:22 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:13:29 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 1 bits Dec 7 22:13:31 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:13:39 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 2 bits Dec 7 22:13:41 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:13:49 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 2 bits Dec 7 22:13:51 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:14:00 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 2 bits Dec 7 22:14:08 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:14:10 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 8 bits Dec 7 22:14:18 freebsd11-1 ntpd[701]: parse: convert_rawdcf: INCOMPLETE DA= TA - time code only has 2 bits --=20 You are receiving this mail because: You are the assignee for the bug.=