diff mbox series

[2/2] parisc: Delay until next timer irq in __cpu_disable()

Message ID 20220325164040.502188-2-deller@gmx.de (mailing list archive)
State Superseded
Headers show
Series [1/2] parisc: Add constant for control registers and clean up mfctl() | expand

Commit Message

Helge Deller March 25, 2022, 4:40 p.m. UTC
Wait for next timer irq to trigger, then clear all pending external irqs
before jumping into rendevous PDC loop.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 arch/parisc/kernel/smp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

--
2.35.1

Comments

Jeroen Roovers March 26, 2022, 8:11 a.m. UTC | #1
On Fri, 25 Mar 2022 17:40:40 +0100
Helge Deller <deller@gmx.de> wrote:

> Wait for next timer irq to trigger, then clear all pending external
> irqs before jumping into rendevous PDC loop.

*rendezvous

> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>  arch/parisc/kernel/smp.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
> index 60cc33fd345c..564442ac74c9 100644
> --- a/arch/parisc/kernel/smp.c
> +++ b/arch/parisc/kernel/smp.c
> @@ -491,6 +491,15 @@ int __cpu_disable(void)
> 
>  	/* disable all irqs, including timer irq */
>  	local_irq_disable();
> +
> +	/* wait for next timer irq ... */
> +	mdelay(1000/HZ+100);
> +
> +	/* ... and then clear all pending external irqs */
> +	set_eiem(0);
> +	mtctl(~0UL, CR_EIRR);
> +	mfctl(CR_EIRR);
> +	mtctl(0, CR_EIRR);
>  #endif
>  	return 0;
>  }
> --
> 2.35.1
> 

Kind regards,
     jer
diff mbox series

Patch

diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 60cc33fd345c..564442ac74c9 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -491,6 +491,15 @@  int __cpu_disable(void)

 	/* disable all irqs, including timer irq */
 	local_irq_disable();
+
+	/* wait for next timer irq ... */
+	mdelay(1000/HZ+100);
+
+	/* ... and then clear all pending external irqs */
+	set_eiem(0);
+	mtctl(~0UL, CR_EIRR);
+	mfctl(CR_EIRR);
+	mtctl(0, CR_EIRR);
 #endif
 	return 0;
 }