parisc: Add constant for control registers and clean up mfctl()
Helge Deller
maintainerPATCH 1/2 parisc: Add constant for control registers and clean up mfctl()
Clean up the code and add often used constants.
Signed-off-by Helge Deller <[email protected]>
--- arch/parisc/include/asm/special_insns.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
arch/parisc/include/asm/special_insns.h +8 -9
@@ -30,11 +30,15 @@ pa; \ }) +#define CR_EIEM 15/* External Interrupt Enable Mask */ +#define CR_CR16 16/* CR16 Interval Timer */ +#define CR_EIRR 23/* External Interrupt Request Register */ +#define mfctl (reg) ({ \ unsigned long cr; \ __asm__ __volatile__( \ - "mfctl " #reg ",%0" : \ - "=r" (cr) \ + "mfctl %1,%0" : \ + "=r" (cr) : "i" (reg) \ ); \ cr; \ })
@@ -44,13 +48,8 @@ : /* no outputs */ \ : "r" (gr), "i" (cr) : "memory") -/* these are here to de-mystefy the calling code, and to provide hooks */ -/* which I needed for debugging EIEM problems -PB */ -#define get_eiem () mfctl(15) -static inline void set_eiem (unsigned long val) -{ -mtctl (val,15 ); -} +#define get_eiem () mfctl(CR_EIEM) +#define set_eiem (val) mtctl(val, CR_EIEM)#define mfsp (reg) ({ \ unsigned long cr; \
--
2.35.1
Helge Deller
maintainerPATCH 2/2 parisc: Delay until next timer irq in __cpu_disable()
Wait for next timer irq to trigger, then clear all pending external irqs before jumping into rendevous PDC loop.
Signed-off-by Helge Deller <[email protected]>
--- arch/parisc/kernel/smp.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/parisc/kernel/smp.c +9 -0
@@ -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
Re: [PATCH 2/2] parisc: Delay until next timer irq in __cpu_disable()
Quoted 2 lines · On Fri, 25 Mar 2022 17:40:40 +0100 Helge Deller <[email protected]> wrote:
Wait for next timer irq to trigger, then clear all pending external irqs before jumping into rendevous PDC loop.
*rendezvous
Quoted 27 lines
Signed-off-by Helge Deller <[email protected]>--- arch/parisc/kernel/smp.c | 9 +++++++++ 1 file changed, 9 insertions(+)arch/parisc/kernel/smp.c +9
-1@@ -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 ; } --
Quoted 2 lines
2.35.1
Kind regards,
jer