powerpc/powernv: Only delay opal_rtc_read() retry when necessary
authorMichael Neuling <mikey@neuling.org>
Fri, 18 Dec 2015 10:46:04 +0000 (21:46 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 27 Dec 2015 08:12:40 +0000 (19:12 +1100)
Only delay opal_rtc_read() when busy and are going to retry.

This has the advantage of possibly saving a massive 10ms off booting!

Kudos to Stewart for noticing.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal-rtc.c

index 1b149c92fca166429e59dc72b55bcbfe7393d930..f8868864f373ed5eecba333a5b1a2b83e38e0ec6 100644 (file)
@@ -50,7 +50,7 @@ unsigned long __init opal_get_boot_time(void)
                rc = opal_rtc_read(&__y_m_d, &__h_m_s_ms);
                if (rc == OPAL_BUSY_EVENT)
                        opal_poll_events(NULL);
-               else
+               else if (rc == OPAL_BUSY)
                        mdelay(10);
        }
        if (rc != OPAL_SUCCESS)