PPS API broken

Bug #1938626 reported by Jim Pennino
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned
Focal
Confirmed
Undecided
Unassigned

Bug Description

The kernel PPS API appears to be broken. I have a serial GPS with PPS attached to /dev/ttyS4. If I use gpsd to create /dev/pps0, gpsd fails to see PPS data. If I disable gpsd and create /dev/pps0 with ldattach, any app or tool run against ttyS4 works fine and does see the CTS transitions every second, i.e. gpsmon and ppscheck. Anything run against pps0 fails, i.e. ppstest, ppswatch. ntpd gets data from ttyS4 but not pps0.

There are some issues with stock apparmor with gpsd and ntpd, but I have solved those.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: linux-image-5.4.0-80-generic 5.4.0-80.90
ProcVersionSignature: Ubuntu 5.4.0-80.90-generic 5.4.124
Uname: Linux 5.4.0-80-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.18
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: jimp 6811 F.... pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: GNOME-Flashback:GNOME
Date: Sat Jul 31 16:41:32 2021
HibernationDevice: RESUME=UUID=90289c8f-5a00-46c4-8f1f-79dd26128f39
InstallationDate: Installed on 2016-08-05 (1820 days ago)
InstallationMedia: Ubuntu-Server 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-80-generic root=UUID=389dcb0d-84f2-4340-ad6c-e4f1dbe55b67 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-5.4.0-80-generic N/A
 linux-backports-modules-5.4.0-80-generic N/A
 linux-firmware 1.187.15
SourcePackage: linux
UpgradeStatus: Upgraded to focal on 2020-11-09 (264 days ago)
dmi.bios.date: 11/26/2009
dmi.bios.vendor: Intel Corp.
dmi.bios.version: TYG4110H.86A.0036.2009.1126.2047
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: DG41TY
dmi.board.vendor: Intel Corporation
dmi.board.version: AAE47335-302
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorp.:bvrTYG4110H.86A.0036.2009.1126.2047:bd11/26/2009:svn:pn:pvr:rvnIntelCorporation:rnDG41TY:rvrAAE47335-302:cvn:ct3:cvr:

Revision history for this message
Jim Pennino (penninojim) wrote :
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

Hello Jim,

Did it work before with your system and got broken after a kernel update? If yes, would you be able to identify the kernel version which was working before? If you didn't run this use case before, would you be able to boot with an older kernel version and check whether it works?

Thanks.

Revision history for this message
Jim Pennino (penninojim) wrote : Re: [Bug 1938626] Re: PPS API broken
Download full text (3.7 KiB)

 I had been running with a USB GPS for years and recently purchased a GOOD GNSS device, so I have not had anything on this machine that accesses the pps_api until a few days ago.
FYI I have a Raspberry Pi with Ubuntu where the pps_api works with raspberrypi-kernel 1:1.2010727-1 if that is of any help.

I see two other kernels installed: 5.4.0-54 and 5.4.0-77.
Any suggestion on which to try as it is somewhat of a PITA to do this, would rather do it just once, and will have to schedule a time, hopefully in a day or so.

Also I have had no reason to do this for years and have forgotten how. As I recall, it is just hold down a key while rebooting to get to the menu to select a kernel, but don't remember which key.
    On Wednesday, August 4, 2021, 6:30:46 AM PDT, Kleber Sacilotto de Souza <email address hidden> wrote:

 Hello Jim,

Did it work before with your system and got broken after a kernel
update? If yes, would you be able to identify the kernel version which
was working before? If you didn't run this use case before, would you be
able to boot with an older kernel version and check whether it works?

Thanks.

** Also affects: linux (Ubuntu Focal)
  Importance: Undecided
      Status: New

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1938626

Title:
  PPS API broken

Status in linux package in Ubuntu:
  New
Status in linux source package in Focal:
  New

Bug description:
  The kernel PPS API appears to be broken. I have a serial GPS with PPS
  attached to /dev/ttyS4. If I use gpsd to create /dev/pps0, gpsd fails
  to see PPS data. If I disable gpsd and create /dev/pps0 with ldattach,
  any app or tool run against ttyS4 works fine and does see the CTS
  transitions every second, i.e. gpsmon and ppscheck. Anything run
  against pps0 fails, i.e. ppstest, ppswatch. ntpd gets data from ttyS4
  but not pps0.

  There are some issues with stock apparmor with gpsd and ntpd, but I
  have solved those.

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: linux-image-5.4.0-80-generic 5.4.0-80.90
  ProcVersionSignature: Ubuntu 5.4.0-80.90-generic 5.4.124
  Uname: Linux 5.4.0-80-generic x86_64
  ApportVersion: 2.20.11-0ubuntu27.18
  Architecture: amd64
  AudioDevicesInUse:
  USER        PID ACCESS COMMAND
  /dev/snd/controlC1:  jimp      6811 F.... pulseaudio
  CasperMD5CheckResult: skip
  CurrentDesktop: GNOME-Flashback:GNOME
  Date: Sat Jul 31 16:41:32 2021
  HibernationDevice: RESUME=UUID=90289c8f-5a00-46c4-8f1f-79dd26128f39
  InstallationDate: Installed on 2016-08-05 (1820 days ago)
  InstallationMedia: Ubuntu-Server 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
  ProcEnviron:
  TERM=xterm-256color
  PATH=(custom, no user)
  XDG_RUNTIME_DIR=<set>
  LANG=en_US.UTF-8
  SHELL=/bin/bash
  ProcFB: 0 i915drmfb
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-80-generic root=UUID=389dcb0d-84f2-4340-ad6c-e4f1dbe55b67 ro quiet splash vt.handoff=7
  RelatedPackageVersions:
  linux-restricted-modules-5.4.0-80-generic N/A
  linux-backports-modules-5.4.0-80-generic  N/A
  linux-firmware                            1.187.15
  SourcePackage: linux
  UpgradeStatus: Up...

Read more...

Revision history for this message
Jim Pennino (penninojim) wrote :

I have rebooted with the oldest installed kernel, 5.4.0-54, and it too has the bug.

Revision history for this message
Jim Pennino (penninojim) wrote :

The system was updated to kernel Linux 5.4.0-81-generic today and it too has the bug

Revision history for this message
Jim Pennino (penninojim) wrote :

A possible cause for this bug has occurred to me, but I wouldn't know where in the kernel code to check for this.

Note: When I talk about a control line, I am using the DTE, i.e computer, end connector reference.

In years past there was no standardization for which line on a serial port carried the PPS signal for a GPS and it was a mix of DCD, RTS, and occasionally CTS. Current commercial devices, such as the one I have, seem to mostly use CTS.

Is is possible the current kernel code is not looking at ALL those lines for PPS?

This would also explain why you have not gotten lots of bug reports as very few people would be running such a device.

Revision history for this message
Jim Pennino (penninojim) wrote :

According to linux/drivers/pps/clients/Kconfig

config PPS_CLIENT_LDISC
 tristate "PPS line discipline"
 depends on TTY
 help
   If you say yes here you get support for a PPS source connected
   with the CD (Carrier Detect) pin of your serial port.

If this is true, CTS needs to be added for modern devices.

Revision history for this message
Jim Pennino (penninojim) wrote :

I have verified the kernel pps_api only looks at CD by building a patch cable to map the PPS signal into the CD pin and now all the pps_api calls work as expected.

It is still my position that the kernel pps_api should look at all commonly used control lines for PPS just like the pps-tools package does.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Changed in linux (Ubuntu Focal):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.