Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #64559

Bug#932845: TS-219 RTC issue with Debian Buster

From Oliver Hartkopp <socketcan@hartkopp.net>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#932845: TS-219 RTC issue with Debian Buster
Date 2019-07-26 21:20 +0200
Message-ID <yodV0-1jC-9@gated-at.bofh.it> (permalink)
References (7 earlier) <yo5NM-3ED-1@gated-at.bofh.it> <yo678-3LW-13@gated-at.bofh.it> <yodV0-1jC-11@gated-at.bofh.it> <yn9JL-ZU-1@gated-at.bofh.it> <yodV0-1jC-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


On 26/07/2019 20.12, Trent Piepho wrote:
> On Fri, 2019-07-26 at 12:53 +0200, Oliver Hartkopp wrote:
>> Just a thought:
>>
>> There are some of these rtc drivers that set
>>
>> rtc->rtc->uie_unsupported = 1;
>>
>> in the case that they can't assign an irq line.
>>
>> But others set
>>
>> rtc->rtc->uie_unsupported = 1;
>>
>> when they don't support an (alarm) trigger with 1 sec accuracy.
>>
>> Wouldn't it make sense to put
>>
>> +       select RTC_INTF_DEV
>> +       select RTC_INTF_DEV_UIE_EMUL
>>
>> in the Kconfig entries of the latter devices?
> 
> The hwclock in busybox does not use UIE.  Is it the util-linux version
> that uses it?  Or systemd timedate?

Yes, it is the util-linux version that invokes ioctl(rtc_fd, RTC_UIE_ON, 
0), see:

https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/sys-utils/hwclock-rtc.c#n244

I documented the effect here:
https://marc.info/?l=linux-arm-kernel&m=156390875629259&w=2

> I know that chrony's linux RTC support requires UIE, or UIE emulation,
> to work.  chrony does not detect lack of this very well and the RTC
> support just "doesn't happen" with no errors.  I had to strace it to
> figure out it was waiting for UIE interrupts that never came.

"or UIE emulation" - sounds like a plan :-)

> Anyway, you don't really need UIE at all to use an rtc in a number of
> ways.  The kernel "rtc to system clock on boot" feature doesn't need
> it.

Right - for that reason the kernel sets the correct time when the 
rtc-s35390a driver is built-in.

When its loaded later as a module, the tool hwclock is used to retrieve 
the time which fails due to the missing UIE.

> The kernel auto sync the rtc every 11 mins from NTP synced system
> clock feature doesn't need it.  busybox hwclock doesn't need it.
> 
> So I suspect it's optional because it's not always needed.

hwclock works great in 'setting' the rtc (hwclock --systohc) but it 
fails to read it.

Regards,
Oliver

Back to linux.debian.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#932845: TS-219 RTC issue with Debian Buster Oliver Hartkopp <socketcan@hartkopp.net> - 2019-07-23 22:40 +0200
  Bug#932845: TS-219 RTC issue with Debian Buster Uwe Kleine-König <uwe@kleine-koenig.org> - 2019-07-24 09:20 +0200
    Bug#932845: TS-219 RTC issue with Debian Buster Oliver Hartkopp <socketcan@hartkopp.net> - 2019-07-25 16:50 +0200
      Bug#932845: TS-219 RTC issue with Debian Buster Uwe Kleine-König <u.kleine-koenig@pengutronix.de> - 2019-07-26 09:50 +0200
        Bug#932845: TS-219 RTC issue with Debian Buster Oliver Hartkopp <socketcan@hartkopp.net> - 2019-07-26 11:40 +0200
          Bug#932845: TS-219 RTC issue with Debian Buster Alexandre Belloni <alexandre.belloni@bootlin.com> - 2019-07-26 11:50 +0200
            Bug#932845: TS-219 RTC issue with Debian Buster Oliver Hartkopp <socketcan@hartkopp.net> - 2019-07-26 12:40 +0200
              Bug#932845: TS-219 RTC issue with Debian Buster Oliver Hartkopp <socketcan@hartkopp.net> - 2019-07-26 13:00 +0200
  Bug#932845: TS-219 RTC issue with Debian Buster Oliver Hartkopp <socketcan@hartkopp.net> - 2019-07-26 21:20 +0200
  Bug#932845: TS-219 RTC issue with Debian Buster Uwe Kleine-König <u.kleine-koenig@pengutronix.de> - 2019-07-28 21:50 +0200
    Bug#932845: TS-219 RTC issue with Debian Buster Oliver Hartkopp <socketcan@hartkopp.net> - 2019-07-29 08:30 +0200
  Processed: Re: Bug#932845: TS-219 RTC issue with Debian Buster "Debian Bug Tracking System" <owner@bugs.debian.org> - 2019-07-28 21:50 +0200

csiph-web