]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
alpha: marvel: make use of raw_spinlock variants
authorJulia Cartwright <julia@ni.com>
Tue, 21 Mar 2017 22:43:02 +0000 (17:43 -0500)
committerMatt Turner <mattst88@gmail.com>
Mon, 4 Sep 2017 19:04:31 +0000 (12:04 -0700)
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>
arch/alpha/include/asm/core_marvel.h
arch/alpha/kernel/core_marvel.c
arch/alpha/kernel/sys_marvel.c

index dad300fa14ce3778d3e89419d34fbb8498bdbd64..8dcf9dbda618e6587b7d6870a7633642a49e7a5a 100644 (file)
@@ -312,7 +312,7 @@ struct io7 {
        io7_port7_csrs *csrs;
        struct io7_port ports[IO7_NUM_PORTS];
 
-       spinlock_t irq_lock;
+       raw_spinlock_t irq_lock;
 };
 
 #ifndef __EXTERN_INLINE
index 03ff832b1cb4483e7d717def1c4f10ebe6c63619..b10c316475dde2082abd33e8933fe5c0b566a392 100644 (file)
@@ -118,7 +118,7 @@ alloc_io7(unsigned int pe)
 
        io7 = alloc_bootmem(sizeof(*io7));
        io7->pe = pe;
-       spin_lock_init(&io7->irq_lock);
+       raw_spin_lock_init(&io7->irq_lock);
 
        for (h = 0; h < 4; h++) {
                io7->ports[h].io7 = io7;
index 24e41bd7d3c99060a7411c1c5774941249c89d72..3e533920371fe1e90ffa663295f46e1c1b825273 100644 (file)
@@ -115,11 +115,11 @@ io7_enable_irq(struct irq_data *d)
                return;
        }
 
-       spin_lock(&io7->irq_lock);
+       raw_spin_lock(&io7->irq_lock);
        *ctl |= 1UL << 24;
        mb();
        *ctl;
-       spin_unlock(&io7->irq_lock);
+       raw_spin_unlock(&io7->irq_lock);
 }
 
 static void
@@ -136,11 +136,11 @@ io7_disable_irq(struct irq_data *d)
                return;
        }
 
-       spin_lock(&io7->irq_lock);
+       raw_spin_lock(&io7->irq_lock);
        *ctl &= ~(1UL << 24);
        mb();
        *ctl;
-       spin_unlock(&io7->irq_lock);
+       raw_spin_unlock(&io7->irq_lock);
 }
 
 static void
@@ -263,7 +263,7 @@ init_io7_irqs(struct io7 *io7,
         */
        printk("  Interrupts reported to CPU at PE %u\n", boot_cpuid);
 
-       spin_lock(&io7->irq_lock);
+       raw_spin_lock(&io7->irq_lock);
 
        /* set up the error irqs */
        io7_redirect_irq(io7, &io7->csrs->HLT_CTL.csr, boot_cpuid);
@@ -295,7 +295,7 @@ init_io7_irqs(struct io7 *io7,
        for (i = 0; i < 16; ++i)
                init_one_io7_msi(io7, i, boot_cpuid);
 
-       spin_unlock(&io7->irq_lock);
+       raw_spin_unlock(&io7->irq_lock);
 }
 
 static void __init