From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:45
Ben,
the following patch series is from preempt-rt. It converts the locks
which need to be real spinlocks in -rt to raw_spinlocks.
There is no behaviourial change for !RT kernels because spinlocks and
raw_spinlocks are the same on !RT. So for mainline this is a pure
annotation while having it in mainline takes the burden of keeping up
with the code changes from the RT patch set.
Please consider to merge into .34.
Thanks,
tglx
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:47
tlbivax_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/mm/tlb_nohash.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: linux-2.6-tip/arch/powerpc/mm/tlb_nohash.c
===================================================================
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:49
die.lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/kernel/traps.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6-tip/arch/powerpc/kernel/traps.c
===================================================================
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:51
pmc_owner_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/kernel/pmc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux-2.6-tip/arch/powerpc/kernel/pmc.c
===================================================================
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:53
nv_lock needs to be a real spinlock in RT. Convert it to raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/platforms/powermac/nvram.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: linux-2.6-tip/arch/powerpc/platforms/powermac/nvram.c
===================================================================
@@ -80,7 +80,7 @@ static int is_core_99;staticintcore99_bank=0;staticintnvram_partitions[3];// XXX Turn that into a sem-staticDEFINE_SPINLOCK(nv_lock);+staticDEFINE_RAW_SPINLOCK(nv_lock);staticint(*core99_write_bank)(intbank,u8*datas);staticint(*core99_erase_bank)(intbank);
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:55
context_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/mm/mmu_context_nohash.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: linux-2.6-tip/arch/powerpc/mm/mmu_context_nohash.c
===================================================================
@@ -121,9 +121,9 @@ static unsigned int steal_context_smp(un/* This will happen if you have more CPUs than available contexts,*allwecandohereiswaitabitandtryagain*/-spin_unlock(&context_lock);+raw_spin_unlock(&context_lock);cpu_relax();-spin_lock(&context_lock);+raw_spin_lock(&context_lock);/* This will cause the caller to try again */returnMMU_NO_CONTEXT;
@@ -194,7 +194,7 @@ void switch_mmu_context(struct mm_structunsignedlong*map;/* No lockless fast path .. yet */-spin_lock(&context_lock);+raw_spin_lock(&context_lock);pr_hard("[%d] activating context for mm @%p, active=%d, id=%d",cpu,next,next->context.active,next->context.id);
@@ -278,7 +278,7 @@ void switch_mmu_context(struct mm_struct/* Flick the MMU and release lock */pr_hardcont(" -> %d\n",id);set_context(id,next->pgd);-spin_unlock(&context_lock);+raw_spin_unlock(&context_lock);}/*
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:57
native_tlbie_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/mm/hash_native_64.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: linux-2.6-tip/arch/powerpc/mm/hash_native_64.c
===================================================================
@@ -434,7 +434,7 @@ static void native_hpte_clear(void)/* we take the tlbie lock and hold it. Some hardware will*deadlockifwetrytotlbiefromtwoprocessorsatonce.*/-spin_lock(&native_tlbie_lock);+raw_spin_lock(&native_tlbie_lock);slots=pteg_count*HPTES_PER_GROUP;
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:31:59
beatic_irq_mask_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/platforms/cell/beat_interrupt.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
Index: linux-2.6-tip/arch/powerpc/platforms/cell/beat_interrupt.c
===================================================================
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:01
confirm_error_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/platforms/pseries/eeh.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: linux-2.6-tip/arch/powerpc/platforms/pseries/eeh.c
===================================================================
@@ -100,7 +100,7 @@ int eeh_subsystem_enabled;EXPORT_SYMBOL(eeh_subsystem_enabled);/* Lock to avoid races due to multiple reports of an error */-staticDEFINE_SPINLOCK(confirm_error_lock);+staticDEFINE_RAW_SPINLOCK(confirm_error_lock);/* Buffer for reporting slot-error-detail rtas calls. Its here*inBSS,andnotdynamicallyalloced,sothatitendsupin
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:03
ipic_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/sysdev/ipic.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
Index: linux-2.6-tip/arch/powerpc/sysdev/ipic.c
===================================================================
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:05
i8259_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/sysdev/i8259.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Index: linux-2.6-tip/arch/powerpc/sysdev/i8259.c
===================================================================
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:07
beat_htab_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/platforms/cell/beat_htab.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
Index: linux-2.6-tip/arch/powerpc/platforms/cell/beat_htab.c
===================================================================
@@ -40,7 +40,7 @@#define DBG_LOW(fmt...) do { } while (0)#endif-staticDEFINE_SPINLOCK(beat_htab_lock);+staticDEFINE_RAW_SPINLOCK(beat_htab_lock);staticinlineunsignedintbeat_read_mask(unsignedhpte_group){
@@ -114,18 +114,18 @@ static long beat_lpar_hpte_insert(unsignif(rflags&_PAGE_NO_CACHE)hpte_r&=~_PAGE_COHERENT;-spin_lock(&beat_htab_lock);+raw_spin_lock(&beat_htab_lock);lpar_rc=beat_read_mask(hpte_group);if(lpar_rc==0){if(!(vflags&HPTE_V_BOLTED))DBG_LOW(" full\n");-spin_unlock(&beat_htab_lock);+raw_spin_unlock(&beat_htab_lock);return-1;}lpar_rc=beat_insert_htab_entry(0,hpte_group,lpar_rc<<48,hpte_v,hpte_r,&slot);-spin_unlock(&beat_htab_lock);+raw_spin_unlock(&beat_htab_lock);/**SincewetryandioremapPHBswedon'town,thepteinsert
@@ -198,17 +198,17 @@ static long beat_lpar_hpte_updatepp(unsi"avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",want_v&HPTE_V_AVPN,slot,psize,newpp);-spin_lock(&beat_htab_lock);+raw_spin_lock(&beat_htab_lock);dummy0=beat_lpar_hpte_getword0(slot);if((dummy0&~0x7FUL)!=(want_v&~0x7FUL)){DBG_LOW("not found !\n");-spin_unlock(&beat_htab_lock);+raw_spin_unlock(&beat_htab_lock);return-1;}lpar_rc=beat_write_htab_entry(0,slot,0,newpp,0,7,&dummy0,&dummy1);-spin_unlock(&beat_htab_lock);+raw_spin_unlock(&beat_htab_lock);if(lpar_rc!=0||dummy0==0){DBG_LOW("not found !\n");return-1;
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:09
big_irq_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/kernel/irq.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
Index: linux-2.6-tip/arch/powerpc/kernel/irq.c
===================================================================
@@ -520,14 +520,14 @@ struct irq_host *irq_alloc_host(struct dif(host->ops->match==NULL)host->ops->match=default_irq_host_match;-spin_lock_irqsave(&irq_big_lock,flags);+raw_spin_lock_irqsave(&irq_big_lock,flags);/* If it's a legacy controller, check for duplicates and*markitasallocated(weuseirq0hostpointerforthat*/if(revmap_type==IRQ_HOST_MAP_LEGACY){if(irq_map[0].host!=NULL){-spin_unlock_irqrestore(&irq_big_lock,flags);+raw_spin_unlock_irqrestore(&irq_big_lock,flags);/* If we are early boot, we can't free the structure,*toobad...*thiswillbefixedonceslabismadeavailableearly
@@ -541,7 +541,7 @@ struct irq_host *irq_alloc_host(struct d}list_add(&host->link,&irq_hosts);-spin_unlock_irqrestore(&irq_big_lock,flags);+raw_spin_unlock_irqrestore(&irq_big_lock,flags);/* Additional setups per revmap type */switch(revmap_type){
@@ -967,7 +967,7 @@ unsigned int irq_alloc_virt(struct irq_hif(count==0||count>(irq_virq_count-NUM_ISA_INTERRUPTS))returnNO_IRQ;-spin_lock_irqsave(&irq_big_lock,flags);+raw_spin_lock_irqsave(&irq_big_lock,flags);/* Use hint for 1 interrupt if any */if(count==1&&hint>=NUM_ISA_INTERRUPTS&&
@@ -991,7 +991,7 @@ unsigned int irq_alloc_virt(struct irq_h}}if(found==NO_IRQ){-spin_unlock_irqrestore(&irq_big_lock,flags);+raw_spin_unlock_irqrestore(&irq_big_lock,flags);returnNO_IRQ;}hint_found:
@@ -1000,7 +1000,7 @@ unsigned int irq_alloc_virt(struct irq_hsmp_wmb();irq_map[i].host=host;}-spin_unlock_irqrestore(&irq_big_lock,flags);+raw_spin_unlock_irqrestore(&irq_big_lock,flags);returnfound;}
@@ -1012,7 +1012,7 @@ void irq_free_virt(unsigned int virq, unWARN_ON(virq<NUM_ISA_INTERRUPTS);WARN_ON(count==0||(virq+count)>irq_virq_count);-spin_lock_irqsave(&irq_big_lock,flags);+raw_spin_lock_irqsave(&irq_big_lock,flags);for(i=virq;i<(virq+count);i++){structirq_host*host;
@@ -1025,7 +1025,7 @@ void irq_free_virt(unsigned int virq, unsmp_wmb();irq_map[i].host=NULL;}-spin_unlock_irqrestore(&irq_big_lock,flags);+raw_spin_unlock_irqrestore(&irq_big_lock,flags);}intarch_early_irq_init(void)
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:11
feature_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/include/asm/pmac_feature.h | 2 +-
arch/powerpc/platforms/powermac/feature.c | 6 +++---
arch/powerpc/platforms/powermac/pfunc_base.c | 24 ++++++++++++------------
3 files changed, 16 insertions(+), 16 deletions(-)
Index: linux-2.6-tip/arch/powerpc/include/asm/pmac_feature.h
===================================================================
@@ -50,13 +50,13 @@ static int macio_do_gpio_write(PMF_STD_Avalue=~value;/* Toggle the GPIO */-spin_lock_irqsave(&feature_lock,flags);+raw_spin_lock_irqsave(&feature_lock,flags);tmp=readb(addr);tmp=(tmp&~mask)|(value&mask);DBG("Do write 0x%02x to GPIO %s (%p)\n",tmp,func->node->full_name,addr);writeb(tmp,addr);-spin_unlock_irqrestore(&feature_lock,flags);+raw_spin_unlock_irqrestore(&feature_lock,flags);return0;}
@@ -145,9 +145,9 @@ static int macio_do_write_reg32(PMF_STD_structmacio_chip*macio=func->driver_data;unsignedlongflags;-spin_lock_irqsave(&feature_lock,flags);+raw_spin_lock_irqsave(&feature_lock,flags);MACIO_OUT32(offset,(MACIO_IN32(offset)&~mask)|(value&mask));-spin_unlock_irqrestore(&feature_lock,flags);+raw_spin_unlock_irqrestore(&feature_lock,flags);return0;}
@@ -168,9 +168,9 @@ static int macio_do_write_reg8(PMF_STD_Astructmacio_chip*macio=func->driver_data;unsignedlongflags;-spin_lock_irqsave(&feature_lock,flags);+raw_spin_lock_irqsave(&feature_lock,flags);MACIO_OUT8(offset,(MACIO_IN8(offset)&~mask)|(value&mask));-spin_unlock_irqrestore(&feature_lock,flags);+raw_spin_unlock_irqrestore(&feature_lock,flags);return0;}
@@ -223,12 +223,12 @@ static int macio_do_write_reg32_slm(PMF_if(args==NULL||args->count==0)return-EINVAL;-spin_lock_irqsave(&feature_lock,flags);+raw_spin_lock_irqsave(&feature_lock,flags);tmp=MACIO_IN32(offset);val=args->u[0].v<<shift;tmp=(tmp&~mask)|(val&mask);MACIO_OUT32(offset,tmp);-spin_unlock_irqrestore(&feature_lock,flags);+raw_spin_unlock_irqrestore(&feature_lock,flags);return0;}
@@ -243,12 +243,12 @@ static int macio_do_write_reg8_slm(PMF_Sif(args==NULL||args->count==0)return-EINVAL;-spin_lock_irqsave(&feature_lock,flags);+raw_spin_lock_irqsave(&feature_lock,flags);tmp=MACIO_IN8(offset);val=args->u[0].v<<shift;tmp=(tmp&~mask)|(val&mask);MACIO_OUT8(offset,tmp);-spin_unlock_irqrestore(&feature_lock,flags);+raw_spin_unlock_irqrestore(&feature_lock,flags);return0;}
@@ -278,12 +278,12 @@ static int unin_do_write_reg32(PMF_STD_A{unsignedlongflags;-spin_lock_irqsave(&feature_lock,flags);+raw_spin_lock_irqsave(&feature_lock,flags);/* This is fairly bogus in darwin, but it should work for our needs*implemetedthatway:*/UN_OUT(offset,(UN_IN(offset)&~mask)|(value&mask));-spin_unlock_irqrestore(&feature_lock,flags);+raw_spin_unlock_irqrestore(&feature_lock,flags);return0;}
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:13
pmac_pic_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/platforms/powermac/pic.c | 38 +++++++++++++++++-----------------
1 file changed, 19 insertions(+), 19 deletions(-)
Index: linux-2.6-tip/arch/powerpc/platforms/powermac/pic.c
===================================================================
From: Thomas Gleixner <hidden> Date: 2010-02-18 12:32:15
mpic_lock, irq_rover_lock and fixup_lock need to be real spinlocks in
RT. Convert them to raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/include/asm/mpic.h | 2 +-
arch/powerpc/sysdev/mpic.c | 38 +++++++++++++++++++-------------------
2 files changed, 20 insertions(+), 20 deletions(-)
Index: linux-2.6-tip/arch/powerpc/include/asm/mpic.h
===================================================================
@@ -374,7 +374,7 @@ static void mpic_startup_ht_interrupt(stif(irqflags&IRQ_LEVEL)tmp|=0x22;writel(tmp,fixup->base+4);-spin_unlock_irqrestore(&mpic->fixup_lock,flags);+raw_spin_unlock_irqrestore(&mpic->fixup_lock,flags);#ifdef CONFIG_PM/* use the lowest bit inverted to the actual HW,
@@ -396,12 +396,12 @@ static void mpic_shutdown_ht_interrupt(sDBG("shutdown_ht_interrupt(0x%x, 0x%x)\n",source,irqflags);/* Disable */-spin_lock_irqsave(&mpic->fixup_lock,flags);+raw_spin_lock_irqsave(&mpic->fixup_lock,flags);writeb(0x10+2*fixup->index,fixup->base+2);tmp=readl(fixup->base+4);tmp|=1;writel(tmp,fixup->base+4);-spin_unlock_irqrestore(&mpic->fixup_lock,flags);+raw_spin_unlock_irqrestore(&mpic->fixup_lock,flags);#ifdef CONFIG_PM/* use the lowest bit inverted to the actual HW,
@@ -515,7 +515,7 @@ static void __init mpic_scan_ht_pics(strBUG_ON(mpic->fixups==NULL);/* Init spinlock */-spin_lock_init(&mpic->fixup_lock);+raw_spin_lock_init(&mpic->fixup_lock);/* Map U3 config space. We assume all IO-APICs are on the primary bus*soweonlyneedtomap64kB.
@@ -1388,7 +1388,7 @@ void mpic_irq_set_priority(unsigned int if(!mpic)return;-spin_lock_irqsave(&mpic_lock,flags);+raw_spin_lock_irqsave(&mpic_lock,flags);if(mpic_is_ipi(mpic,irq)){reg=mpic_ipi_read(src-mpic->ipi_vecs[0])&~MPIC_VECPRI_PRIORITY_MASK;
@@ -1400,7 +1400,7 @@ void mpic_irq_set_priority(unsigned int mpic_irq_write(src,MPIC_INFO(IRQ_VECTOR_PRI),reg|(pri<<MPIC_VECPRI_PRIORITY_SHIFT));}-spin_unlock_irqrestore(&mpic_lock,flags);+raw_spin_unlock_irqrestore(&mpic_lock,flags);}voidmpic_setup_this_cpu(void)
@@ -1415,7 +1415,7 @@ void mpic_setup_this_cpu(void)DBG("%s: setup_this_cpu(%d)\n",mpic->name,hard_smp_processor_id());-spin_lock_irqsave(&mpic_lock,flags);+raw_spin_lock_irqsave(&mpic_lock,flags);/* let the mpic know we want intrs. default affinity is 0xffffffff*untilchangedvia/proc.That'showit'sdoneonx86.Ifwewant
@@ -1431,7 +1431,7 @@ void mpic_setup_this_cpu(void)/* Set current processor priority to 0 */mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI),0);-spin_unlock_irqrestore(&mpic_lock,flags);+raw_spin_unlock_irqrestore(&mpic_lock,flags);#endif /* CONFIG_SMP */}
@@ -1460,7 +1460,7 @@ void mpic_teardown_this_cpu(int secondarBUG_ON(mpic==NULL);DBG("%s: teardown_this_cpu(%d)\n",mpic->name,hard_smp_processor_id());-spin_lock_irqsave(&mpic_lock,flags);+raw_spin_lock_irqsave(&mpic_lock,flags);/* let the mpic know we don't want intrs. */for(i=0;i<mpic->num_sources;i++)
the following patch series is from preempt-rt. It converts the locks
which need to be real spinlocks in -rt to raw_spinlocks.
None of the patch descriptions mention why the locks need to be real
spinlocks in -rt. So can you please elaborate?
With kind regards,
Geert Uytterhoeven
Software Architect
Techsoft Centre
Technology and Software Centre Europe
The Corporate Village =B7 Da Vincilaan 7-D1 =B7 B-1935 Zaventem =B7 Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 =B7 RPR Brussels
Fortis =B7 BIC GEBABEBB =B7 IBAN BE41293037680010
From: Anton Vorontsov <hidden> Date: 2010-02-18 13:43:14
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, qe_ic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
---
On Thu, Feb 18, 2010 at 12:22:18PM -0000, Thomas Gleixner wrote:
Ben,
the following patch series is from preempt-rt. It converts the locks
which need to be real spinlocks in -rt to raw_spinlocks.
There is no behaviourial change for !RT kernels because spinlocks and
raw_spinlocks are the same on !RT. So for mainline this is a pure
annotation while having it in mainline takes the burden of keeping up
with the code changes from the RT patch set.
Please consider to merge into .34.
If nothing has changed in -rt, then qe_ic should be in the same boat.
arch/powerpc/sysdev/qe_lib/qe_ic.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
From: Anton Vorontsov <hidden> Date: 2010-02-18 13:45:13
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, socrates_fpga_pic_lock has to be a real (non-sleepable)
spinlock.
Signed-off-by: Anton Vorontsov <redacted>
---
On Thu, Feb 18, 2010 at 12:22:18PM -0000, Thomas Gleixner wrote:
Ben,
the following patch series is from preempt-rt. It converts the locks
which need to be real spinlocks in -rt to raw_spinlocks.
There is no behaviourial change for !RT kernels because spinlocks and
raw_spinlocks are the same on !RT. So for mainline this is a pure
annotation while having it in mainline takes the burden of keeping up
with the code changes from the RT patch set.
Please consider to merge into .34.
Oh, and I guess the same for the socrates fpga pic...
arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 34 +++++++++++-----------
1 files changed, 17 insertions(+), 17 deletions(-)
@@ -80,9 +80,9 @@ static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq)if(i==3)returnNO_IRQ;-spin_lock_irqsave(&socrates_fpga_pic_lock,flags);+raw_spin_lock_irqsave(&socrates_fpga_pic_lock,flags);cause=socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i));-spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);+raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);for(i=SOCRATES_FPGA_NUM_IRQS-1;i>=0;i--){if(cause>>(i+16))break;
@@ -116,12 +116,12 @@ static void socrates_fpga_pic_ack(unsigned int virq)hwirq=socrates_fpga_irq_to_hw(virq);irq_line=fpga_irqs[hwirq].irq_line;-spin_lock_irqsave(&socrates_fpga_pic_lock,flags);+raw_spin_lock_irqsave(&socrates_fpga_pic_lock,flags);mask=socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))&SOCRATES_FPGA_IRQ_MASK;mask|=(1<<(hwirq+16));socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line),mask);-spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);+raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);}staticvoidsocrates_fpga_pic_mask(unsignedintvirq)
@@ -134,12 +134,12 @@ static void socrates_fpga_pic_mask(unsigned int virq)hwirq=socrates_fpga_irq_to_hw(virq);irq_line=fpga_irqs[hwirq].irq_line;-spin_lock_irqsave(&socrates_fpga_pic_lock,flags);+raw_spin_lock_irqsave(&socrates_fpga_pic_lock,flags);mask=socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))&SOCRATES_FPGA_IRQ_MASK;mask&=~(1<<hwirq);socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line),mask);-spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);+raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);}staticvoidsocrates_fpga_pic_mask_ack(unsignedintvirq)
@@ -152,13 +152,13 @@ static void socrates_fpga_pic_mask_ack(unsigned int virq)hwirq=socrates_fpga_irq_to_hw(virq);irq_line=fpga_irqs[hwirq].irq_line;-spin_lock_irqsave(&socrates_fpga_pic_lock,flags);+raw_spin_lock_irqsave(&socrates_fpga_pic_lock,flags);mask=socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))&SOCRATES_FPGA_IRQ_MASK;mask&=~(1<<hwirq);mask|=(1<<(hwirq+16));socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line),mask);-spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);+raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);}staticvoidsocrates_fpga_pic_unmask(unsignedintvirq)
@@ -171,12 +171,12 @@ static void socrates_fpga_pic_unmask(unsigned int virq)hwirq=socrates_fpga_irq_to_hw(virq);irq_line=fpga_irqs[hwirq].irq_line;-spin_lock_irqsave(&socrates_fpga_pic_lock,flags);+raw_spin_lock_irqsave(&socrates_fpga_pic_lock,flags);mask=socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))&SOCRATES_FPGA_IRQ_MASK;mask|=(1<<hwirq);socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line),mask);-spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);+raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);}staticvoidsocrates_fpga_pic_eoi(unsignedintvirq)
@@ -189,12 +189,12 @@ static void socrates_fpga_pic_eoi(unsigned int virq)hwirq=socrates_fpga_irq_to_hw(virq);irq_line=fpga_irqs[hwirq].irq_line;-spin_lock_irqsave(&socrates_fpga_pic_lock,flags);+raw_spin_lock_irqsave(&socrates_fpga_pic_lock,flags);mask=socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))&SOCRATES_FPGA_IRQ_MASK;mask|=(1<<(hwirq+16));socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line),mask);-spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);+raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);}staticintsocrates_fpga_pic_set_type(unsignedintvirq,
@@ -220,14 +220,14 @@ static int socrates_fpga_pic_set_type(unsigned int virq,default:return-EINVAL;}-spin_lock_irqsave(&socrates_fpga_pic_lock,flags);+raw_spin_lock_irqsave(&socrates_fpga_pic_lock,flags);mask=socrates_fpga_pic_read(FPGA_PIC_IRQCFG);if(polarity)mask|=(1<<hwirq);elsemask&=~(1<<hwirq);socrates_fpga_pic_write(FPGA_PIC_IRQCFG,mask);-spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);+raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock,flags);return0;}
From: Anton Vorontsov <hidden> Date: 2010-02-18 13:57:28
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, gef_pic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/platforms/86xx/gef_pic.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
From: Anton Vorontsov <hidden> Date: 2010-02-18 13:57:40
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, pci_pic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
From: Thomas Gleixner <hidden> Date: 2010-02-18 15:31:56
On Thu, 18 Feb 2010, Geert Uytterhoeven wrote:
On Thu, 18 Feb 2010, Thomas Gleixner wrote:
quoted
the following patch series is from preempt-rt. It converts the locks
which need to be real spinlocks in -rt to raw_spinlocks.
None of the patch descriptions mention why the locks need to be real
spinlocks in -rt. So can you please elaborate?
Sorry, forgot that there are people who do not share that particular
flavour of crazy.
The locks are protecting low level hardware access (mostly interrupt
hardware, tlb control, et.c) and need to be taken in hard interrupt
context, exception handlers or irq disabled regions. Therefor they can
not be converted to "sleeping spinlocks" like we do for the the bulk
of the spinlocks in the kernel. We annotate those locks by converting
them to raw_spinlocks. In mainline there is no difference between
spinlock and raw_spinlock; spinlock is simply using the raw_spinlock
implementation. In RT we keep raw_spinlocks as real spinlocks and
convert spinlocks to the sleeping variant.
Hope that helps.
tglx
From: Thomas Gleixner <hidden> Date: 2010-02-18 16:32:54
On Thu, 18 Feb 2010, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, qe_ic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
From: Thomas Gleixner <hidden> Date: 2010-02-18 16:33:23
On Thu, 18 Feb 2010, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, socrates_fpga_pic_lock has to be a real (non-sleepable)
spinlock.
Signed-off-by: Anton Vorontsov <redacted>
From: Thomas Gleixner <hidden> Date: 2010-02-18 16:35:23
On Thu, 18 Feb 2010, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, gef_pic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
From: Thomas Gleixner <hidden> Date: 2010-02-18 16:35:45
On Thu, 18 Feb 2010, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, pci_pic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
From: Kumar Gala <hidden> Date: 2010-02-18 21:52:47
On Feb 18, 2010, at 6:22 AM, Thomas Gleixner wrote:
tlbivax_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: Thomas Gleixner <redacted>
---
arch/powerpc/mm/tlb_nohash.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Kumar Gala <hidden> Date: 2010-02-18 22:01:20
On Feb 18, 2010, at 7:45 AM, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, socrates_fpga_pic_lock has to be a real =
(non-sleepable)
spinlock.
=20
Signed-off-by: Anton Vorontsov <redacted>
---
=20
On Thu, Feb 18, 2010 at 12:22:18PM -0000, Thomas Gleixner wrote:
quoted
Ben,
=20
the following patch series is from preempt-rt. It converts the locks
which need to be real spinlocks in -rt to raw_spinlocks.
=20
There is no behaviourial change for !RT kernels because spinlocks and
raw_spinlocks are the same on !RT. So for mainline this is a pure
annotation while having it in mainline takes the burden of keeping up
with the code changes from the RT patch set.
=20
Please consider to merge into .34.
=20
Oh, and I guess the same for the socrates fpga pic...
=20
arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 34 =
From: Kumar Gala <hidden> Date: 2010-02-18 22:01:26
On Feb 18, 2010, at 7:57 AM, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, pci_pic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
From: Kumar Gala <hidden> Date: 2010-02-18 22:01:29
On Feb 18, 2010, at 7:43 AM, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, qe_ic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
---
From: Kumar Gala <hidden> Date: 2010-02-18 22:01:34
On Feb 18, 2010, at 7:57 AM, Anton Vorontsov wrote:
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, gef_pic_lock has to be a real (non-sleepable) spinlock.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/platforms/86xx/gef_pic.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)