From: Stewart Smith <hidden> Date: 2016-08-02 02:17:45
According to the OPAL docs:
https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txthttps://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this
indicates either a transient or permanent error.
Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
permanent error particularly well, in that you could end up in a busy
loop.
This was not too hard to trigger on an AMI BMC based OpenPOWER machine
doing a continuous "ipmitool mc reset cold" to the BMC, the result of
that being that we'd get stuck in an infinite loop in opal_get_rtc_time.
We now retry a few times before returning the error higher up the stack.
Cc: stable@vger.kernel.org
Signed-off-by: Stewart Smith <redacted>
---
drivers/rtc/rtc-opal.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-08-03 07:12:52
Stewart Smith [off-list ref] writes:
According to the OPAL docs:
https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txthttps://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this
indicates either a transient or permanent error.
Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
permanent error particularly well, in that you could end up in a busy
loop.
This was not too hard to trigger on an AMI BMC based OpenPOWER machine
doing a continuous "ipmitool mc reset cold" to the BMC, the result of
that being that we'd get stuck in an infinite loop in opal_get_rtc_time.
We now retry a few times before returning the error higher up the stack.
Looks like this has always been broken, so:
Fixes: 16b1d26e77b1 ("rtc/tpo: Driver to support rtc and wakeup on PowerNV platform")
Cc: stable@vger.kernel.org
And therefore that should be:
Cc: stable@vger.kernel.org # v3.19+
quoted hunk
Signed-off-by: Stewart Smith <redacted>
---
drivers/rtc/rtc-opal.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
This is a pretty gross API at this point.
That's basically a score of 2 on Rusty's API usability index ("Read the implementation
and you'll get it right" - http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html).
The docs don't mention OPAL_INTERNAL_ERROR being transient, nor do they mention
OPAL_BUSY.
Can we at least do a wrapper function in opal.h for drivers to use that handles
some or all of these cases?
cheers
From: Michael Ellerman <hidden> Date: 2018-01-29 04:13:46
On Tue, 2016-08-02 at 01:50:16 UTC, Stewart Smith wrote:
According to the OPAL docs:
https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txthttps://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this
indicates either a transient or permanent error.
Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
permanent error particularly well, in that you could end up in a busy
loop.
This was not too hard to trigger on an AMI BMC based OpenPOWER machine
doing a continuous "ipmitool mc reset cold" to the BMC, the result of
that being that we'd get stuck in an infinite loop in opal_get_rtc_time.
We now retry a few times before returning the error higher up the stack.
Cc: stable@vger.kernel.org
Signed-off-by: Stewart Smith <redacted>
Hi,
On 02/08/2016 at 11:50:16 +1000, Stewart Smith wrote:
According to the OPAL docs:
https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txthttps://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this
indicates either a transient or permanent error.
Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
permanent error particularly well, in that you could end up in a busy
loop.
This was not too hard to trigger on an AMI BMC based OpenPOWER machine
doing a continuous "ipmitool mc reset cold" to the BMC, the result of
that being that we'd get stuck in an infinite loop in opal_get_rtc_time.
We now retry a few times before returning the error higher up the stack.
Cc: stable@vger.kernel.org
Signed-off-by: Stewart Smith <redacted>
---
drivers/rtc/rtc-opal.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Just a note to let you know that this patch should have gone through my
tree but it was not sent to linux-rtc or me.
I guess what happened is that Michael cleaned up the Linux PPC patchwork
queue.
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-02-06 05:22:53
Alexandre Belloni [off-list ref] writes:
Hi,
On 02/08/2016 at 11:50:16 +1000, Stewart Smith wrote:
quoted
According to the OPAL docs:
https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txthttps://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this
indicates either a transient or permanent error.
Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
permanent error particularly well, in that you could end up in a busy
loop.
This was not too hard to trigger on an AMI BMC based OpenPOWER machine
doing a continuous "ipmitool mc reset cold" to the BMC, the result of
that being that we'd get stuck in an infinite loop in opal_get_rtc_time.
We now retry a few times before returning the error higher up the stack.
Cc: stable@vger.kernel.org
Signed-off-by: Stewart Smith <redacted>
---
drivers/rtc/rtc-opal.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Just a note to let you know that this patch should have gone through my
tree but it was not sent to linux-rtc or me.
Sorry, I saw it had been languishing for a long time and assumed you'd
missed it.
Happy to revert/rework it if you're not happy with it.
I guess what happened is that Michael cleaned up the Linux PPC patchwork
queue.
Yeah I did.
In future I'll ping you if there's something that seems to have fallen
through the cracks.
cheers
From: Stewart Smith <hidden> Date: 2018-02-06 07:57:35
Alexandre Belloni [off-list ref] writes:
On 02/08/2016 at 11:50:16 +1000, Stewart Smith wrote:
quoted
According to the OPAL docs:
https://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txthttps://github.com/open-power/skiboot/blob/skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt
OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and this
indicates either a transient or permanent error.
Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a
permanent error particularly well, in that you could end up in a busy
loop.
This was not too hard to trigger on an AMI BMC based OpenPOWER machine
doing a continuous "ipmitool mc reset cold" to the BMC, the result of
that being that we'd get stuck in an infinite loop in opal_get_rtc_time.
We now retry a few times before returning the error higher up the stack.
Cc: stable@vger.kernel.org
Signed-off-by: Stewart Smith <redacted>
---
drivers/rtc/rtc-opal.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Just a note to let you know that this patch should have gone through my
tree but it was not sent to linux-rtc or me.
I guess what happened is that Michael cleaned up the Linux PPC patchwork
queue.
Apologies for not sending there. My (18 month ago self) bad.
--
Stewart Smith
OPAL Architect, IBM.