linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Trent Piepho <tpiepho@impinj.com>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>
Cc: "linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"932845@bugs.debian.org" <932845@bugs.debian.org>
Subject: Re: Bug#932845: TS-219 RTC issue with Debian Buster
Date: Fri, 26 Jul 2019 21:09:55 +0200	[thread overview]
Message-ID: <1cfeefaf-c55f-abcc-44b5-0645face6f09@hartkopp.net> (raw)
In-Reply-To: <1564164731.2343.130.camel@impinj.com>


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

      reply	other threads:[~2019-07-26 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9992cfcd-e51b-e002-4843-b16da8e2e119@hartkopp.net>
     [not found] ` <20190724070704.GA5983@taurus.defre.kleine-koenig.org>
     [not found]   ` <806117df-54ac-88f2-06a0-20a7502202ff@hartkopp.net>
2019-07-26  7:27     ` Bug#932845: TS-219 RTC issue with Debian Buster Uwe Kleine-König
2019-07-26  9:27       ` Oliver Hartkopp
2019-07-26  9:39         ` Alexandre Belloni
2019-07-26 10:26           ` Oliver Hartkopp
2019-07-26 10:53             ` Oliver Hartkopp
2019-07-26 18:12               ` Trent Piepho
2019-07-26 19:09                 ` Oliver Hartkopp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1cfeefaf-c55f-abcc-44b5-0645face6f09@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=932845@bugs.debian.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=tpiepho@impinj.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).