[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+J0qHrIcDYSuKKW@hovoldconsulting.com>
Date: Tue, 7 Feb 2023 16:56:24 +0100
From: Johan Hovold <johan@...nel.org>
To: David Collins <quic_collinsd@...cinc.com>
Cc: Johan Hovold <johan+linaro@...nel.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Bjorn Andersson <andersson@...nel.org>,
Andy Gross <agross@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Alessandro Zummo <a.zummo@...ertech.it>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Maximilian Luz <luzmaximilian@...il.com>,
linux-arm-msm@...r.kernel.org, linux-rtc@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v2 01/22] rtc: pm8xxx: fix set-alarm race
On Tue, Feb 07, 2023 at 04:13:36PM +0100, Johan Hovold wrote:
> On Mon, Feb 06, 2023 at 07:12:43PM -0800, David Collins wrote:
> > On 2/2/23 07:54, Johan Hovold wrote:
> > > Make sure to disable the alarm before updating the four alarm time
> > > registers to avoid spurious alarms during the update.
> >
> > What scenario can encounter a spurious alarm triggering upon writing the
> > new alarm time inside of pm8xxx_rtc_set_alarm()?
>
> The alarm is stored in four bytes in little-endian order. Consider
> having had an alarm set and expired at:
This was just supposed to say "Consider having an alarm set at:" as the
alarm must still be enabled. Let me update the example I gave:
Consider having an alarm set at
10 01 00 00
and now you want to set an alarm at
01 02 00 00
Unless the alarm is disabled before the update the alarm could go off at
01 01 00 00
after updating the first byte.
Johan
Powered by blists - more mailing lists