s390/delay: remove udelay_simple()

udelay_simple() callers can make use of the now simplified udelay()
implementation. No need to keep it.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Heiko Carstens 2020-12-14 21:44:39 +01:00
parent 9ceed9988a
commit e0d62dcb20
5 changed files with 8 additions and 33 deletions

View File

@ -13,10 +13,8 @@
#ifndef _S390_DELAY_H #ifndef _S390_DELAY_H
#define _S390_DELAY_H #define _S390_DELAY_H
void udelay_enable(void);
void __ndelay(unsigned long nsecs); void __ndelay(unsigned long nsecs);
void __udelay(unsigned long usecs); void __udelay(unsigned long usecs);
void udelay_simple(unsigned long usecs);
void __delay(unsigned long loops); void __delay(unsigned long loops);
#define ndelay(n) __ndelay((unsigned long)(n)) #define ndelay(n) __ndelay((unsigned long)(n))

View File

@ -1512,7 +1512,7 @@ static void diag308_dump(void *dump_block)
while (1) { while (1) {
if (diag308(DIAG308_LOAD_NORMAL_DUMP, NULL) != 0x302) if (diag308(DIAG308_LOAD_NORMAL_DUMP, NULL) != 0x302)
break; break;
udelay_simple(USEC_PER_SEC); udelay(USEC_PER_SEC);
} }
} }

View File

@ -335,7 +335,6 @@ int __init arch_early_irq_init(void)
if (!stack) if (!stack)
panic("Couldn't allocate async stack"); panic("Couldn't allocate async stack");
S390_lowcore.async_stack = stack + STACK_INIT_OFFSET; S390_lowcore.async_stack = stack + STACK_INIT_OFFSET;
udelay_enable();
return 0; return 0;
} }

View File

@ -19,13 +19,6 @@
#include <asm/div64.h> #include <asm/div64.h>
#include <asm/idle.h> #include <asm/idle.h>
static DEFINE_STATIC_KEY_FALSE(udelay_ready);
void __init udelay_enable(void)
{
static_branch_enable(&udelay_ready);
}
void __delay(unsigned long loops) void __delay(unsigned long loops)
{ {
/* /*
@ -39,40 +32,25 @@ void __delay(unsigned long loops)
} }
EXPORT_SYMBOL(__delay); EXPORT_SYMBOL(__delay);
static void delay_loop(unsigned long delta, bool simple) static void delay_loop(unsigned long delta)
{ {
unsigned long end; unsigned long end;
if (static_branch_likely(&udelay_ready) && !simple) { end = get_tod_clock_monotonic() + delta;
end = get_tod_clock_monotonic() + delta; while (!tod_after(get_tod_clock_monotonic(), end))
while (!tod_after(get_tod_clock_monotonic(), end)) cpu_relax();
cpu_relax();
} else {
end = get_tod_clock() + delta;
while (!tod_after(get_tod_clock(), end))
cpu_relax();
}
} }
void __udelay(unsigned long usecs) void __udelay(unsigned long usecs)
{ {
delay_loop(usecs << 12, 0); delay_loop(usecs << 12);
} }
EXPORT_SYMBOL(__udelay); EXPORT_SYMBOL(__udelay);
/*
* Simple udelay variant. To be used on startup and reboot
* when the interrupt handler isn't working.
*/
void udelay_simple(unsigned long usecs)
{
delay_loop(usecs << 12, 1);
}
void __ndelay(unsigned long nsecs) void __ndelay(unsigned long nsecs)
{ {
nsecs <<= 9; nsecs <<= 9;
do_div(nsecs, 125); do_div(nsecs, 125);
delay_loop(nsecs, 0); delay_loop(nsecs);
} }
EXPORT_SYMBOL(__ndelay); EXPORT_SYMBOL(__ndelay);

View File

@ -1668,7 +1668,7 @@ void ccw_device_wait_idle(struct ccw_device *cdev)
cio_tsch(sch); cio_tsch(sch);
if (sch->schib.scsw.cmd.actl == 0) if (sch->schib.scsw.cmd.actl == 0)
break; break;
udelay_simple(100); udelay(100);
} }
} }
#endif #endif