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: Thu, 12 Dec 2019 10:43:26 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576143811; 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=Gt60Mw1gIP6XVqm/Byv5LWagiMDhOI8KVkd8uviI4IE=; b=VgqxbKlyLQHY1NFeX6I/Kp37AxyRgr4Xyl7WD7TmjfVgzvXUDXSx6OeCWYd+5yo9LjXEeu zNjWLJRoZ9Y2Z1V50hNxyaP6KKIatXtR+j79Q5flaY53uKRaD087rGZeL9lMo9XAG6luMv B2+kbu17BLE8Sj5tv4KKT/BDnUO+9VE=
On Wed, Dec 11, 2019 at 05:42:12PM +0100, Miroslav Lichvar wrote:
> 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.
Looking at the kernel code more carefully, it seems it checks whether
the state is changing before checking if UIE is actually supported, so
switch_interrupts(0) would fail only if interrupts were already
"enabled" (which they cannot be).
Testing both, as you did in your patch, is the correct fix.
--
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.