source: trunk/target/linux/atheros/patches-2.6.36/001-get_c0_compare_int_fix.patch @ 23454

Last change on this file since 23454 was 23454, checked in by acoul, 6 years ago

linux/atheros: add preliminary 2.6.36 kernel support (refresh patches)

File size: 1.1 KB
  • arch/mips/kernel/cevt-r4k.c

    Fix the usage of get_c0_compare_int: override cp0_compare_irq if the returned
    value is in the MIPS CPU IRQ range to ensure that c0_compare_int_usable()
    still works.
    
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
    
    a b int __cpuinit r4k_clockevent_init(void) 
    167167        struct clock_event_device *cd; 
    168168        unsigned int irq; 
    169169 
    170         if (!cpu_has_counter || !mips_hpt_frequency) 
    171                 return -ENXIO; 
    172  
    173         if (!c0_compare_int_usable()) 
    174                 return -ENXIO; 
    175  
    176170        /* 
    177171         * With vectored interrupts things are getting platform specific. 
    178172         * get_c0_compare_int is a hook to allow a platform to return the 
    179173         * interrupt number of it's liking. 
    180174         */ 
    181175        irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; 
    182         if (get_c0_compare_int) 
     176        if (get_c0_compare_int) { 
    183177                irq = get_c0_compare_int(); 
     178                if ((irq >= MIPS_CPU_IRQ_BASE) && (irq < MIPS_CPU_IRQ_BASE + 8)) 
     179                        cp0_compare_irq = irq - MIPS_CPU_IRQ_BASE; 
     180        } 
     181 
     182        if (!cpu_has_counter || !mips_hpt_frequency) 
     183                return -ENXIO; 
     184 
     185        if (!c0_compare_int_usable()) 
     186                return -ENXIO; 
    184187 
    185188        cd = &per_cpu(mips_clockevent_device, cpu); 
    186189 
Note: See TracBrowser for help on using the repository browser.