source: trunk/target/linux/atheros/patches-3.3/001-get_c0_compare_int_fix.patch @ 31625

Last change on this file since 31625 was 31625, checked in by nbd, 4 years ago

atheros: update to 3.3.4 (based on work by acoul), fix mvswitch driver for newer kernels

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) 
    168168        struct clock_event_device *cd; 
    169169        unsigned int irq; 
    170170 
    171         if (!cpu_has_counter || !mips_hpt_frequency) 
    172                 return -ENXIO; 
    173  
    174         if (!c0_compare_int_usable()) 
    175                 return -ENXIO; 
    176  
    177171        /* 
    178172         * With vectored interrupts things are getting platform specific. 
    179173         * get_c0_compare_int is a hook to allow a platform to return the 
    180174         * interrupt number of it's liking. 
    181175         */ 
    182176        irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; 
    183         if (get_c0_compare_int) 
     177        if (get_c0_compare_int) { 
    184178                irq = get_c0_compare_int(); 
     179                if ((irq >= MIPS_CPU_IRQ_BASE) && (irq < MIPS_CPU_IRQ_BASE + 8)) 
     180                        cp0_compare_irq = irq - MIPS_CPU_IRQ_BASE; 
     181        } 
     182 
     183        if (!cpu_has_counter || !mips_hpt_frequency) 
     184                return -ENXIO; 
     185 
     186        if (!c0_compare_int_usable()) 
     187                return -ENXIO; 
    185188 
    186189        cd = &per_cpu(mips_clockevent_device, cpu); 
    187190 
Note: See TracBrowser for help on using the repository browser.