rtc: opal: Fix OPAL RTC driver OPAL_BUSY loops
authorNicholas Piggin <npiggin@gmail.com>
Tue, 10 Apr 2018 11:49:32 +0000 (21:49 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 May 2018 19:58:24 +0000 (12:58 -0700)
commit79340bda01ab2704b11bae18e592304e41948492
tree819b15dfbbaf6ca2ac5a378939325c7d174c3e16
parent20b0f757da3be5a7c5f14f95250b9c8efcaee02d
rtc: opal: Fix OPAL RTC driver OPAL_BUSY loops

commit 682e6b4da5cbe8e9a53f979a58c2a9d7dc997175 upstream.

The OPAL RTC driver does not sleep in case it gets OPAL_BUSY or
OPAL_BUSY_EVENT from firmware, which causes large scheduling
latencies, up to 50 seconds have been observed here when RTC stops
responding (BMC reboot can do it).

Fix this by converting it to the standard form OPAL_BUSY loop that
sleeps.

Fixes: 628daa8d5abf ("powerpc/powernv: Add RTC and NVRAM support plus RTAS fallbacks")
Cc: stable@vger.kernel.org # v3.2+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/powernv/opal-rtc.c
drivers/rtc/rtc-opal.c