[RFC 04/10] powerpc/rtas-rtc: convert set-time-of-day to rtas_sched_if_busy()
Nathan Lynch
nathanl at linux.ibm.com
Tue May 4 13:03:52 AEST 2021
rtas_set_rtc_time() is called only in process context; convert this to
rtas_sched_if_busy().
Signed-off-by: Nathan Lynch <nathanl at linux.ibm.com>
---
arch/powerpc/kernel/rtas-rtc.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/kernel/rtas-rtc.c b/arch/powerpc/kernel/rtas-rtc.c
index 82cb95f29a11..421b92f95669 100644
--- a/arch/powerpc/kernel/rtas-rtc.c
+++ b/arch/powerpc/kernel/rtas-rtc.c
@@ -62,7 +62,7 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
int rtas_set_rtc_time(struct rtc_time *tm)
{
- int error, wait_time;
+ int error;
u64 max_wait_tb;
max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
@@ -72,13 +72,7 @@ int rtas_set_rtc_time(struct rtc_time *tm)
tm->tm_mday, tm->tm_hour, tm->tm_min,
tm->tm_sec, 0);
- wait_time = rtas_busy_delay_time(error);
- if (wait_time) {
- if (in_interrupt())
- return 1; /* probably decrementer */
- msleep(wait_time);
- }
- } while (wait_time && (get_tb() < max_wait_tb));
+ } while (rtas_sched_if_busy(error) && (get_tb() < max_wait_tb));
if (error != 0)
printk_ratelimited(KERN_WARNING
--
2.30.2
More information about the Linuxppc-dev
mailing list