HomeFreeBSD

powerpc64/powernv: re-read RTC after polling

Description

powerpc64/powernv: re-read RTC after polling

If OPAL_RTC_READ is busy and does not return the information on the first run,
as returning OPAL_BUSY_EVENT, the system will crash since ymd and hmsm variable
will contain junk values.

This is happening because we were not calling OPAL_RTC_READ again after
OPAL_POLL_EVENTS' return, which would finally replace the old/junk hmsm and ymd
values.

The code was also mixing OPAL_RTC_READ and OPAL_POLL_EVENTS return values.

This patch fix this logic and guarantee that we call OPAL_RTC_READ after
OPAL_POLL_EVENTS return, and guarantee the code will only proceed if
OPAL_RTC_READ returns OPAL_SUCCESS.

Reviewed by: jhibbits
Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D16617

Details

Provenance
leitaoAuthored on
Reviewer
jhibbits
Differential Revision
D16617: powerpc64/powernv: re-read RTC after polling
Parents
rS337502: Fix the err() arguments for a nfssvc(8) failure.
Branches
Unknown
Tags
Unknown