diff mbox series

[v6,02/17] s390: define get_cycles macro for arch-override

Message ID 20220423212623.1957011-3-Jason@zx2c4.com (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show
Series archs/random: fallback to best raw ktime when no cycle counter | expand

Commit Message

Jason A. Donenfeld April 23, 2022, 9:26 p.m. UTC
S390x defines a get_cycles() function, but it forgot to do the usual
`#define get_cycles get_cycles` dance, making it impossible for generic
code to see if an arch-specific function was defined.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 arch/s390/include/asm/timex.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Heiko Carstens April 25, 2022, 9:43 a.m. UTC | #1
On Sat, Apr 23, 2022 at 11:26:08PM +0200, Jason A. Donenfeld wrote:
> S390x defines a get_cycles() function, but it forgot to do the usual
> `#define get_cycles get_cycles` dance, making it impossible for generic
> code to see if an arch-specific function was defined.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: Alexander Gordeev <agordeev@linux.ibm.com>
> Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
> Cc: Sven Schnelle <svens@linux.ibm.com>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  arch/s390/include/asm/timex.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
> index 2cfce42aa7fc..ce878e85b6e4 100644
> --- a/arch/s390/include/asm/timex.h
> +++ b/arch/s390/include/asm/timex.h
> @@ -197,6 +197,7 @@ static inline cycles_t get_cycles(void)
>  {
>  	return (cycles_t) get_tod_clock() >> 2;
>  }
> +#define get_cycles get_cycles

As far as I can tell this doesn't change anything, since the
asm-generic timex.h header file is not included/used at all on s390
(and if it would, this would have resulted in a compile error).

FWIW, the compiled code also tells me that the s390 specific
get_cycles() version is already used.

Is any of your subsequent patches making sure that the asm generic
header file gets included everywhere? Otherwise I don't see the point
of this patch.
Jason A. Donenfeld April 25, 2022, 9:48 a.m. UTC | #2
On 4/25/22, Heiko Carstens <hca@linux.ibm.com> wrote:
> Is any of your subsequent patches making sure that the asm generic
> header file gets included everywhere? Otherwise I don't see the point
> of this patch.
>

Yes; patch 6 requires this as a prereq. I'm not doing this arbitrarily.

Jason
Heiko Carstens April 25, 2022, 10:21 a.m. UTC | #3
On Mon, Apr 25, 2022 at 11:48:34AM +0200, Jason A. Donenfeld wrote:
> On 4/25/22, Heiko Carstens <hca@linux.ibm.com> wrote:
> > Is any of your subsequent patches making sure that the asm generic
> > header file gets included everywhere? Otherwise I don't see the point
> > of this patch.
> 
> Yes; patch 6 requires this as a prereq. I'm not doing this arbitrarily.

Ok, that was not obvious to me, especially since I was only cc'ed for
this patch and assumed this was actually a bug fix.
Thanks for clarifying.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
diff mbox series

Patch

diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h
index 2cfce42aa7fc..ce878e85b6e4 100644
--- a/arch/s390/include/asm/timex.h
+++ b/arch/s390/include/asm/timex.h
@@ -197,6 +197,7 @@  static inline cycles_t get_cycles(void)
 {
 	return (cycles_t) get_tod_clock() >> 2;
 }
+#define get_cycles get_cycles
 
 int get_phys_clock(unsigned long *clock);
 void init_cpu_timer(void);