Re: [PATCH v1] rtc: mpfs: fix counter upload completion condition
From: Conor Dooley
Date: Tue Jun 30 2026 - 16:54:54 EST
On Tue, Jun 30, 2026 at 05:18:13PM +0200, Geert Uytterhoeven wrote:
> Hi Conor,
>
> On Wed, 13 May 2026 at 20:04, Conor Dooley <conor@xxxxxxxxxx> wrote:
> > From: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
> >
> > The condition that needs to be checked for upload completion is the
> > UPLOAD bit in the completion register going low. The original iterations
> > of this driver used a do-while and this was converted to a
> > read_poll_timeout() during upstreaming without the condition being
> > inverted as it should have been.
> >
> > I suspect that this went unnoticed until now because a) the first read
> > was done when the bit was still set, immediately completing the
> > read_poll_timeout() and b) because the RTC doesn't hold time when power
> > is removed from the SoC reducing its utility (I for one keep it
> > disabled). If my first suspicion was true when the driver was
> > upstreamed, it's not true any longer though, hence the detection of the
> > problem.
> >
> > Fixes: 0b31d703598dc ("rtc: Add driver for Microchip PolarFire SoC")
> > CC: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
>
> Thanks, this landed as commit 9792ff8afa9017fe ("rtc: mpfs: fix counter
> upload completion condition") in v7.2-rc1, and finally the endless
> stream of:
>
> mpfs_rtc 20124000.rtc: timed out uploading time to rtc
>
> is gone!
>
> And no, it didn't go unnoticed, at least not for me, but you couldn't
> reproduce it reliably before:
> https://lore.kernel.org/bce2ca405ef96b1363fd1370887409d9e8468422.1660659437.git.geert+renesas@xxxxxxxxx/
Oh wow, old mystery solved and not "unnoticed" at all!
To be honest, there's a good chance it'd have been investigated more
thoroughly sooner if I had the driver enabled, but I don't given it
doesn't hold time powered off. I'm glad it's eventually been solved
though.
Attachment:
signature.asc
Description: PGP signature