diff options
author | Julia Cartwright <julia@ni.com> | 2017-03-21 18:43:02 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2017-09-04 15:04:31 -0400 |
commit | b5a3a128b44219f0802a8b7895e09233853c8b43 (patch) | |
tree | e706ab2929941997d0f5481c2e8b28568e3615d1 | |
parent | beb1057feb1d061a0598440c73c4ca4e020c0751 (diff) |
alpha: marvel: make use of raw_spinlock variants
The alpha/marvel code currently implements an irq_chip for handling
interrupts; due to how irq_chip handling is done, it's necessary for the
irq_chip methods to be invoked from hardirq context, even on a a
real-time kernel. Because the spinlock_t type becomes a "sleeping"
spinlock w/ RT kernels, it is not suitable to be used with irq_chips.
A quick audit of the operations under the lock reveal that they do only
minimal, bounded work, and are therefore safe to do under a raw spinlock.
Signed-off-by: Julia Cartwright <julia@ni.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r-- | arch/alpha/include/asm/core_marvel.h | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/core_marvel.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_marvel.c | 12 |
3 files changed, 8 insertions, 8 deletions
diff --git a/arch/alpha/include/asm/core_marvel.h b/arch/alpha/include/asm/core_marvel.h index dad300fa14ce..8dcf9dbda618 100644 --- a/arch/alpha/include/asm/core_marvel.h +++ b/arch/alpha/include/asm/core_marvel.h | |||
@@ -312,7 +312,7 @@ struct io7 { | |||
312 | io7_port7_csrs *csrs; | 312 | io7_port7_csrs *csrs; |
313 | struct io7_port ports[IO7_NUM_PORTS]; | 313 | struct io7_port ports[IO7_NUM_PORTS]; |
314 | 314 | ||
315 | spinlock_t irq_lock; | 315 | raw_spinlock_t irq_lock; |
316 | }; | 316 | }; |
317 | 317 | ||
318 | #ifndef __EXTERN_INLINE | 318 | #ifndef __EXTERN_INLINE |
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c index 03ff832b1cb4..b10c316475dd 100644 --- a/arch/alpha/kernel/core_marvel.c +++ b/arch/alpha/kernel/core_marvel.c | |||
@@ -118,7 +118,7 @@ alloc_io7(unsigned int pe) | |||
118 | 118 | ||
119 | io7 = alloc_bootmem(sizeof(*io7)); | 119 | io7 = alloc_bootmem(sizeof(*io7)); |
120 | io7->pe = pe; | 120 | io7->pe = pe; |
121 | spin_lock_init(&io7->irq_lock); | 121 | raw_spin_lock_init(&io7->irq_lock); |
122 | 122 | ||
123 | for (h = 0; h < 4; h++) { | 123 | for (h = 0; h < 4; h++) { |
124 | io7->ports[h].io7 = io7; | 124 | io7->ports[h].io7 = io7; |
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 24e41bd7d3c9..3e533920371f 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c | |||
@@ -115,11 +115,11 @@ io7_enable_irq(struct irq_data *d) | |||
115 | return; | 115 | return; |
116 | } | 116 | } |
117 | 117 | ||
118 | spin_lock(&io7->irq_lock); | 118 | raw_spin_lock(&io7->irq_lock); |
119 | *ctl |= 1UL << 24; | 119 | *ctl |= 1UL << 24; |
120 | mb(); | 120 | mb(); |
121 | *ctl; | 121 | *ctl; |
122 | spin_unlock(&io7->irq_lock); | 122 | raw_spin_unlock(&io7->irq_lock); |
123 | } | 123 | } |
124 | 124 | ||
125 | static void | 125 | static void |
@@ -136,11 +136,11 @@ io7_disable_irq(struct irq_data *d) | |||
136 | return; | 136 | return; |
137 | } | 137 | } |
138 | 138 | ||
139 | spin_lock(&io7->irq_lock); | 139 | raw_spin_lock(&io7->irq_lock); |
140 | *ctl &= ~(1UL << 24); | 140 | *ctl &= ~(1UL << 24); |
141 | mb(); | 141 | mb(); |
142 | *ctl; | 142 | *ctl; |
143 | spin_unlock(&io7->irq_lock); | 143 | raw_spin_unlock(&io7->irq_lock); |
144 | } | 144 | } |
145 | 145 | ||
146 | static void | 146 | static void |
@@ -263,7 +263,7 @@ init_io7_irqs(struct io7 *io7, | |||
263 | */ | 263 | */ |
264 | printk(" Interrupts reported to CPU at PE %u\n", boot_cpuid); | 264 | printk(" Interrupts reported to CPU at PE %u\n", boot_cpuid); |
265 | 265 | ||
266 | spin_lock(&io7->irq_lock); | 266 | raw_spin_lock(&io7->irq_lock); |
267 | 267 | ||
268 | /* set up the error irqs */ | 268 | /* set up the error irqs */ |
269 | io7_redirect_irq(io7, &io7->csrs->HLT_CTL.csr, boot_cpuid); | 269 | io7_redirect_irq(io7, &io7->csrs->HLT_CTL.csr, boot_cpuid); |
@@ -295,7 +295,7 @@ init_io7_irqs(struct io7 *io7, | |||
295 | for (i = 0; i < 16; ++i) | 295 | for (i = 0; i < 16; ++i) |
296 | init_one_io7_msi(io7, i, boot_cpuid); | 296 | init_one_io7_msi(io7, i, boot_cpuid); |
297 | 297 | ||
298 | spin_unlock(&io7->irq_lock); | 298 | raw_spin_unlock(&io7->irq_lock); |
299 | } | 299 | } |
300 | 300 | ||
301 | static void __init | 301 | static void __init |