Re: [chrony-dev] Re: [PATCH] test: check if RTC is RTC_UIE_ON capable |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] Re: [PATCH] test: check if RTC is RTC_UIE_ON capable
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Wed, 11 Dec 2019 17:42:12 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576082539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gmvO5cDpYdexJ5f80ww9lauUYADHS5naWsxcTBU7nhQ=; b=Lb38Srx70PLoY6iS3Nmy+OcHUWGvBL8z0fJakr+Z88mFCVZ1tCa4Gdlqck+A3D9PI+Sixd axCsq4YbWcpeUKth0G34UFmjmhIUpTd7u1bg70Erak1p0uzNaJY/LV0g/DAQOdl5l1TZ1w gKqKwtlgC++7L34OT+kwSJJzIN8xStI=
On Wed, Dec 11, 2019 at 04:13:23PM +0100, Christian Ehrhardt wrote:
> That means the first switch_interrupts call from RTC_Initialise ->
> RTC_Linux_Initialise -> switch_interrupts has on_off=0 and that doesn't
> trigger the issue at initialization phase.
> Later on on RTC_TimeInit -> switch_interrupts argument on_off=1 and the
> issue occurs.
> Turns out our "problematic" RTCs only trigger the issue on on_off=1.
Interesting. When I added that code I checked the kernel source code
and it looked like enabling and disabling the interrupt should both
return the same error.
What RTC driver is used on the machine?
> /* Make sure the RTC supports interrupts */
> - if (!switch_interrupts(0)) {
> + if (!switch_interrupts(1) || switch_interrupts(0)) {
> close(fd);
> return 0;
> }
I'd prefer this approach, but I think there is a missing "!" before
the second call of switch_interrupts().
> I've understood that you wanted it to hard-fail and bail out of -s was set
> but RTC init failed right?
No, it should continue to run (using other time sources as configured).
--
Miroslav Lichvar
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.