ppc RT: ppc_rt.patch
PATCH 1/5 ppc RT: ppc_rt.patch
Source: MontaVista Software, Inc.
Signed-off-by Frank Rowand <[email protected]>
arch/ppc/Kconfig +8 -9
@@ -17,9 +17,16 @@ config GENERIC_HARDIRQS config RWSEM_GENERIC_SPINLOCK bool + depends on !PREEMPT_RT + +config ASM_SEMAPHORES + bool + depends on !PREEMPT_RT + default y config RWSEM_XCHGADD_ALGORITHM bool + depends on !RWSEM_GENERIC_SPINLOCK && !PREEMPT_RT default y config GENERIC_CALIBRATE_DELAY
@@ -862,15 +869,7 @@ config NR_CPUS depends on SMP default "4" -config PREEMPT - bool "Preemptible Kernel" - help - This option reduces the latency of the kernel when reacting to - real-time or interactive events by allowing a low priority process to - be preempted even if it is in kernel mode executing a system call. - - Say Y here if you are building a kernel for a desktop, embedded - or real-time system. Say N if you are unsure. +source "lib/Kconfig.RT" config HIGHMEM bool "High memory support"
arch/ppc/kernel/smp.c +6 -1
@@ -139,6 +139,11 @@ void smp_send_reschedule(int cpu)smp_message_pass (cpu,PPC_MSG_RESCHEDULE ,0 ,0 ); } +void smp_send_reschedule_allbutself (void ) +{ +smp_message_pass (MSG_ALL_BUT_SELF ,PPC_MSG_RESCHEDULE ,0 ,0 ); +} +#ifdef CONFIG_XMON void smp_send_xmon_break (int cpu) {
@@ -163,7 +168,7 @@ void smp_send_stop(void)* static memory requirements. It also looks cleaner. * Stolen from the i386 version. */ -static DEFINE_SPINLOCK (call_lock); +static DEFINE_RAW_SPINLOCK (call_lock); static struct call_data_struct { void (*func) (void *info);
include/linux/rt_lock.h +9 -0
@@ -13,8 +13,13 @@ typedef struct { volatile unsigned long lock; # ifdef CONFIG_DEBUG_SPINLOCK +# ifdef CONFIG_PPC32 + volatile unsigned long owner_pc; + volatile unsigned long owner_cpu; +# else unsigned int magic; # endif +# endif # ifdef CONFIG_PREEMPT unsigned int break_lock; # endif
@@ -33,7 +38,11 @@ typedef struct {*/ #ifdef CONFIG_SMP typedef struct { +#ifdef CONFIG_PPC32 + volatile signed int lock; +#else volatile unsigned long lock; +#endif # ifdef CONFIG_DEBUG_SPINLOCK unsigned magic; # endif
arch/ppc/syslib/cpm2_common.c +1 -1
@@ -115,7 +115,7 @@ cpm2_fastbrg(uint brg, uint rate, int di/* * dpalloc / dpfree bits. */ -static spinlock_t cpm_dpmem_lock; +static raw_spinlock_t cpm_dpmem_lock;/* 16 blocks should be enough to satisfy all requests * until the memory subsystem goes up... */ static rh_block_t cpm_boot_dpmem_rh_block[16 ];
arch/ppc/kernel/Makefile +2 -1
@@ -13,8 +13,9 @@ extra-y += vmlinux.lds obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ process.o signal.o ptrace.o align.o \ - semaphore.o syscalls.o setup.o \ + syscalls.o setup.o \ cputable.o ppc_htab.o perfmon.o +obj-$(CONFIG_ASM_SEMAPHORES) += semaphore.o obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o obj-$(CONFIG_POWER4) += cpu_setup_power4.o obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
include/asm-ppc/rwsem.h +2 -2
@@ -25,7 +25,7 @@ struct rw_semaphore {#define RWSEM_WAITING_BIAS (-0x00010000)#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) -spinlock_t wait_lock; +raw_spinlock_t wait_lock;struct list_head wait_list;#if RWSEM_DEBUG int debug;
@@ -42,7 +42,7 @@ struct rw_semaphore {#endif #define __RWSEM_INITIALIZER (name) \ - { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ + { RWSEM_UNLOCKED_VALUE, RAW_SPIN_LOCK_UNLOCKED, \ LIST_HEAD_INIT((name).wait_list) \ __RWSEM_DEBUG_INIT }
arch/ppc/lib/dec_and_lock.c +4 -4
@@ -19,7 +19,7 @@*/ #ifndef ATOMIC_DEC_AND_LOCK -int _atomic_dec_and_lock (atomic_t *atomic,spinlock_t *lock) +int _atomic_dec_and_raw_spin_lock (atomic_t *atomic,raw_spinlock_t *lock) {int counter;int newcount;
@@ -35,12 +35,12 @@ int _atomic_dec_and_lock(atomic_t *atomi return 0; } -spin_lock (lock); +_raw_spin_lock (lock);if (atomic_dec_and_test (atomic))return 1 ; -spin_unlock (lock); +_raw_spin_unlock (lock);return 0 ; } -EXPORT_SYMBOL (_atomic_dec_and_lock); +EXPORT_SYMBOL (_atomic_dec_and_raw_spin_lock);#endif /* ATOMIC_DEC_AND_LOCK */
arch/ppc/8260_io/enet.c +1 -1
@@ -116,7 +116,7 @@ struct scc_enet_private {scc_t *sccp;struct net_device_stats stats;uint tx_full; -spinlock_t lock; +raw_spinlock_t lock; };static int scc_enet_open (struct net_device *dev);
arch/ppc/syslib/prom.c +1 -1
@@ -1397,7 +1397,7 @@ print_properties(struct device_node *np) }#endif -static DEFINE_SPINLOCK (rtas_lock); +static DEFINE_RAW_SPINLOCK (rtas_lock);/* this can be called after setup -- Cort */ int __openfirmware
include/asm-ppc/semaphore.h +5 -0
@@ -16,6 +16,10 @@#ifdef __KERNEL__ +#ifdef CONFIG_PREEMPT_RT +# include <linux/rt_lock.h> +#else +#include <asm/atomic.h> #include <asm/system.h> #include <linux/wait.h>
@@ -106,6 +110,7 @@ extern inline void up(struct semaphore *__up (sem); } +#endif /* CONFIG_PREEMPT_RT */ #endif /* __KERNEL__ */ #endif /* !(_PPC_SEMAPHORE_H) */
arch/ppc/8260_io/fcc_enet.c +1 -1
@@ -322,7 +322,7 @@ struct fcc_enet_private {volatile fcc_enet_t *ep;struct net_device_stats stats;uint tx_full; -spinlock_t lock; +raw_spinlock_t lock;#ifdef CONFIG_USE_MDIO uint phy_id;
include/asm-ppc/ocp.h +1 -1
@@ -29,10 +29,10 @@#include <linux/config.h> #include <linux/devfs_fs_kernel.h> #include <linux/device.h> +#include <linux/rwsem.h> #include <asm/mmu.h> #include <asm/ocp_ids.h> -#include <asm/rwsem.h> #include <asm/semaphore.h> #ifdef CONFIG_PPC_OCP
arch/ppc/8xx_io/enet.c +1 -1
@@ -144,7 +144,7 @@ struct scc_enet_private {unsigned char *rx_vaddr[RX_RING_SIZE ];struct net_device_stats stats;uint tx_full; -spinlock_t lock; +raw_spinlock_t lock; };static int scc_enet_open (struct net_device *dev);
arch/ppc/syslib/open_pic.c +1 -1
@@ -531,7 +531,7 @@ void openpic_reset_processor_phys(u_int }#if defined(CONFIG_SMP ) || defined(CONFIG_PM ) -static DEFINE_SPINLOCK (openpic_setup_lock); +static DEFINE_RAW_SPINLOCK (openpic_setup_lock);#endif #ifdef CONFIG_SMP
arch/ppc/platforms/pmac_feature.c +1 -1
@@ -63,7 +63,7 @@ extern struct device_node *k2_skiplist[2* We use a single global lock to protect accesses. Each driver has * to take care of its own locking */ -static DEFINE_SPINLOCK(feature_lock __pmacdata); +static DEFINE_RAW_SPINLOCK(feature_lock __pmacdata);#define LOCK (flags) spin_lock_irqsave(&feature_lock, flags);#define UNLOCK (flags) spin_unlock_irqrestore(&feature_lock, flags);
arch/ppc/8xx_io/commproc.c +1 -1
@@ -372,7 +372,7 @@ cpm_setbrg(uint brg, uint rate)/* * dpalloc / dpfree bits. */ -static spinlock_t cpm_dpmem_lock; +static raw_spinlock_t cpm_dpmem_lock;/* * 16 blocks should be enough to satisfy all requests * until the memory subsystem goes up...
arch/ppc/syslib/open_pic2.c +1 -1
@@ -386,7 +386,7 @@ static void openpic2_set_spurious(u_int vec); } -static DEFINE_SPINLOCK (openpic2_setup_lock); +static DEFINE_RAW_SPINLOCK (openpic2_setup_lock);/* * Initialize a timer interrupt (and disable it)
arch/ppc/platforms/pmac_nvram.c +1 -1
@@ -80,7 +80,7 @@ static volatile unsigned char *nvram_datstatic int nvram_mult, is_core_99;static int core99_bank =0 ;static int nvram_partitions[3 ]; -static DEFINE_SPINLOCK (nv_lock); +static DEFINE_RAW_SPINLOCK (nv_lock);extern int pmac_newworld;extern int system_running;
include/asm-ppc/tlb.h +9 -1
@@ -25,7 +25,11 @@ struct mmu_gather;extern void tlb_flush (struct mmu_gather *tlb);/* Get the generic bits... */ +#ifdef CONFIG_PREEMPT_RT +#include <asm-generic/tlb-simple.h> +#else #include <asm-generic/tlb.h> +#endif /* Nothing needed here in fact... */ #define tlb_start_vma (tlb, vma) do { } while (0)
@@ -38,7 +42,7 @@ static inline void __tlb_remove_tlb_entr unsigned long address) {if (pte_val (*ptep) & _PAGE_HASHPTE) -flush_hash_entry (tlb->mm, ptep, address); +flush_hash_entry (tlb_mm (tlb), ptep, address); }#else
@@ -50,7 +54,11 @@ static inline void __tlb_remove_tlb_entr#define tlb_flush (tlb) flush_tlb_mm((tlb)->mm)/* Get the generic bits... */ +#ifdef CONFIG_PREEMPT_RT +#include <asm-generic/tlb-simple.h> +#else #include <asm-generic/tlb.h> +#endif #endif /* CONFIG_PPC_STD_MMU */
arch/ppc/kernel/traps.c +1 -1
@@ -72,7 +72,7 @@ void (*debugger_fault_handler)(struct pt* Trap & Exception support */ -DEFINE_SPINLOCK (die_lock); +DEFINE_RAW_SPINLOCK (die_lock);void die (const char * str,struct pt_regs * fp,long err) {
arch/ppc/platforms/sbc82xx.c +1 -1
@@ -68,7 +68,7 @@ static void sbc82xx_time_init(void)static volatile char *sbc82xx_i8259_map;static char sbc82xx_i8259_mask =0xff ; -static DEFINE_SPINLOCK (sbc82xx_i8259_lock); +static DEFINE_RAW_SPINLOCK (sbc82xx_i8259_lock);static void sbc82xx_i8259_mask_and_ack_irq (unsigned int irq_nr) {
arch/ppc/platforms/chrp_smp.c +1 -1
@@ -57,7 +57,7 @@ smp_chrp_setup_cpu(int cpu_nr)do_openpic_setup_cpu (); } -static DEFINE_SPINLOCK (timebase_lock); +static DEFINE_RAW_SPINLOCK (timebase_lock);static unsigned int timebase_upper =0 , timebase_lower =0 ;void __devinit
include/asm-ppc/hw_irq.h +1 -0
@@ -13,6 +13,7 @@ extern void timer_interrupt(struct pt_re#define INLINE_IRQS #define irqs_disabled () ((mfmsr() & MSR_EE) == 0) +#define irqs_disabled_flags (flags) ((flags & MSR_EE) == 0)#ifdef INLINE_IRQS
include/asm-ppc/spinlock.h +30 -55
158 lines not on this page · raw message
arch/ppc/8xx_io/fec.c +1 -1
@@ -165,7 +165,7 @@ struct fec_enet_private {struct net_device_stats stats;uint tx_full; -spinlock_t lock; +raw_spinlock_t lock;#ifdef CONFIG_USE_MDIO uint phy_id;
arch/ppc/lib/locks.c +19 -19
@@ -43,7 +43,7 @@ static inline unsigned long __spin_tryloreturn ret; } -void _raw_spin_lock (spinlock_t *lock) +void __raw_spin_lock (raw_spinlock_t *lock) {int cpu =smp_processor_id ();unsigned int stuck =INIT_STUCK ;
@@ -63,9 +63,9 @@ void _raw_spin_lock(spinlock_t *lock) lock->owner_pc = (unsigned long )__builtin_return_address (0 ); lock->owner_cpu = cpu; } -EXPORT_SYMBOL (_raw_spin_lock); +EXPORT_SYMBOL (__raw_spin_lock); -int _raw_spin_trylock (spinlock_t *lock) +int __raw_spin_trylock (raw_spinlock_t *lock) {if (__spin_trylock (&lock->lock))return 0 ;
@@ -73,9 +73,9 @@ int _raw_spin_trylock(spinlock_t *lock) lock->owner_pc = (unsigned long )__builtin_return_address (0 );return 1 ; } -EXPORT_SYMBOL (_raw_spin_trylock); +EXPORT_SYMBOL (__raw_spin_trylock); -void _raw_spin_unlock (spinlock_t *lp) +void __raw_spin_unlock (raw_spinlock_t *lp) {if ( !lp->lock ) printk("_spin_unlock(%p): no lock cpu %d curr PC %p %s/%d\n",
@@ -89,13 +89,13 @@ void _raw_spin_unlock(spinlock_t *lp)wmb (); lp->lock =0 ; } -EXPORT_SYMBOL (_raw_spin_unlock); +EXPORT_SYMBOL (__raw_spin_unlock);/* * For rwlocks, zero is unlocked, -1 is write-locked, * positive is read-locked. */ -static __inline__int __read_trylock (rwlock_t *rw) +static __inline__int __read_trylock (raw_rwlock_t *rw) {signed int tmp;
@@ -115,13 +115,13 @@ static __inline__ int __read_trylock(rwlreturn tmp; } -int _raw_read_trylock (rwlock_t *rw) +int __raw_read_trylock (raw_rwlock_t *rw) {return __read_trylock (rw) >0 ; } -EXPORT_SYMBOL (_raw_read_trylock); +EXPORT_SYMBOL (__raw_read_trylock); -void _raw_read_lock (rwlock_t *rw) +void __raw_read_lock (rwlock_t *rw) {unsigned int stuck;
@@ -136,9 +136,9 @@ void _raw_read_lock(rwlock_t *rw) } } } -EXPORT_SYMBOL (_raw_read_lock); +EXPORT_SYMBOL (__raw_read_lock); -void _raw_read_unlock (rwlock_t *rw) +void __raw_read_unlock (raw_rwlock_t *rw) {if ( rw->lock ==0 ) printk("_read_unlock(): %s/%d (nip %08lX) lock %d\n",
@@ -147,9 +147,9 @@ void _raw_read_unlock(rwlock_t *rw)wmb ();atomic_dec ((atomic_t *) &(rw)->lock); } -EXPORT_SYMBOL (_raw_read_unlock); +EXPORT_SYMBOL (__raw_read_unlock); -void _raw_write_lock (rwlock_t *rw) +void __raw_write_lock (raw_rwlock_t *rw) {unsigned int stuck;
@@ -165,18 +165,18 @@ void _raw_write_lock(rwlock_t *rw) }wmb (); } -EXPORT_SYMBOL (_raw_write_lock); +EXPORT_SYMBOL (__raw_write_lock); -int _raw_write_trylock (rwlock_t *rw) +int __raw_write_trylock (raw_rwlock_t *rw) {if (cmpxchg (&rw->lock,0 ,-1 ) !=0 )return 0 ;wmb ();return 1 ; } -EXPORT_SYMBOL (_raw_write_trylock); +EXPORT_SYMBOL (__raw_write_trylock); -void _raw_write_unlock (rwlock_t *rw) +void __raw_write_unlock (raw_rwlock_t *rw) {if (rw->lock >=0 ) printk("_write_lock(): %s/%d (nip %08lX) lock %d\n",
@@ -185,6 +185,6 @@ void _raw_write_unlock(rwlock_t *rw)wmb (); rw->lock = 0; } -EXPORT_SYMBOL (_raw_write_unlock); +EXPORT_SYMBOL (__raw_write_unlock);#endif
arch/ppc/kernel/ppc_ksyms.c +2 -0
@@ -295,9 +295,11 @@ EXPORT_SYMBOL(console_drivers);EXPORT_SYMBOL (xmon);EXPORT_SYMBOL (xmon_printf);#endif +#ifdef CONFIG_ASM_SEMAPHORES EXPORT_SYMBOL (__up);EXPORT_SYMBOL (__down);EXPORT_SYMBOL (__down_interruptible); +#endif #if defined(CONFIG_KGDB ) || defined(CONFIG_XMON )extern void (*debugger)(struct pt_regs *regs);
arch/ppc/platforms/pmac_pic.c +1 -1
@@ -68,7 +68,7 @@ static int max_irqs __pmacdata; static int max_real_irqs __pmacdata; static u32 level_mask[4] __pmacdata; -static DEFINE_SPINLOCK(pmac_pic_lock __pmacdata); +static DEFINE_RAW_SPINLOCK(pmac_pic_lock __pmacdata);#define GATWICK_IRQ_POOL_SIZE 10
arch/ppc/kernel/dma-mapping.c +1 -1
@@ -71,7 +71,7 @@ int map_page(unsigned long va, phys_addr* This is the page table (2MB) covering uncached, DMA consistent allocations */ static pte_t *consistent_pte; -static DEFINE_SPINLOCK (consistent_lock); +static DEFINE_RAW_SPINLOCK (consistent_lock);/* * VM region handling support.
arch/ppc/syslib/ocp.c +1 -1
@@ -45,11 +45,11 @@#include <linux/pm.h> #include <linux/bootmem.h> #include <linux/device.h> +#include <linux/rwsem.h> #include <asm/io.h> #include <asm/ocp.h> #include <asm/errno.h> -#include <asm/rwsem.h> #include <asm/semaphore.h> //#define DBG(x) printk x
arch/ppc/kernel/time.c +1 -1
@@ -91,7 +91,7 @@ extern unsigned long wall_jiffies;static long time_offset; -DEFINE_SPINLOCK (rtc_lock); +DEFINE_RAW_SPINLOCK (rtc_lock);EXPORT_SYMBOL (rtc_lock);