2021-06-11 19:12:15

by Christophe Leroy

[permalink] [raw]
Subject: [PATCH 1/2] powerpc/64: drop redundant defination of spin_until_cond

From: Sudeep Holla <[email protected]>

linux/processor.h has exactly same defination for spin_until_cond.
Drop the redundant defination in asm/processor.h

Cc: Nicholas Piggin <[email protected]>
Cc: Michael Ellerman <[email protected]>
Signed-off-by: Sudeep Holla <[email protected]>
Signed-off-by: Christophe Leroy <[email protected]>
---
That's just a rebase

arch/powerpc/include/asm/processor.h | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 7bf8a15af224..0819854eeab9 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -339,17 +339,6 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)

#define spin_end() HMT_medium()

-#define spin_until_cond(cond) \
-do { \
- if (unlikely(!(cond))) { \
- spin_begin(); \
- do { \
- spin_cpu_relax(); \
- } while (!(cond)); \
- spin_end(); \
- } \
-} while (0)
-
#endif

/* Check that a certain kernel stack pointer is valid in task_struct p */
--
2.25.0


2021-06-11 19:16:05

by Christophe Leroy

[permalink] [raw]
Subject: [PATCH 2/2] powerpc/watchdog: include linux/processor.h for spin_until_cond

From: Sudeep Holla <[email protected]>

This implementation uses spin_until_cond in wd_smp_lock including
neither linux/processor.h nor asm/processor.h

This patch includes linux/processor.h here for spin_until_cond usage.

Cc: Nicholas Piggin <[email protected]>
Cc: Michael Ellerman <[email protected]>
Signed-off-by: Sudeep Holla <[email protected]>
Signed-off-by: Christophe Leroy <[email protected]>
---
arch/powerpc/kernel/watchdog.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index c9a8f4781a10..a165635fd214 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -24,6 +24,7 @@
#include <linux/kdebug.h>
#include <linux/sched/debug.h>
#include <linux/delay.h>
+#include <linux/processor.h>
#include <linux/smp.h>

#include <asm/interrupt.h>
--
2.25.0

2021-06-11 19:56:55

by Sudeep Holla

[permalink] [raw]
Subject: Re: [PATCH 1/2] powerpc/64: drop redundant defination of spin_until_cond

On Fri, Jun 11, 2021 at 07:10:57PM +0000, Christophe Leroy wrote:
> From: Sudeep Holla <[email protected]>
>
> linux/processor.h has exactly same defination for spin_until_cond.
> Drop the redundant defination in asm/processor.h
>

Wow you must be real good at ML archaeology, this must have been at-least
3+ years old. I found this when I wanted to you spin_until_cond. Thanks
anyways for digging the original patch, nobody would have remembered even
if you posted fresh ????.

--
Regards,
Sudeep

2021-06-18 07:37:23

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH 1/2] powerpc/64: drop redundant defination of spin_until_cond

On Fri, 11 Jun 2021 19:10:57 +0000 (UTC), Christophe Leroy wrote:
> linux/processor.h has exactly same defination for spin_until_cond.
> Drop the redundant defination in asm/processor.h

Applied to powerpc/next.

[1/2] powerpc/64: drop redundant defination of spin_until_cond
https://git.kernel.org/powerpc/c/db8f7066dc498acf9074ed3c11a7a24f318d8d4f
[2/2] powerpc/watchdog: include linux/processor.h for spin_until_cond
https://git.kernel.org/powerpc/c/2400c13c437debc99d3399a7100d4e8c3fe20a08

cheers