Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull more MIPS fixes from Ralf Baechle:
"Another round of 4.1 MIPS fixes, one fix to a MIPS-specific #if
condition in lib/mpi, one fix to the MIPS GIC irqchip driver and one
SSB fix.

Details:
- fix handling of clock in chipco SSB driver.
- fix two MIPS-specific #if conditions to correctly work for GCC 5.1.
- fix damage to R6 pgtable bits done by XPA support.
- fix possible crash due to unloading modules that contain statically
defined platform devices.
- fix disabling of the MSA ASE on context switch to also work
correctly when a new thread/process has the CPU for the very first
time.

This is part of linux-next and has been beaten to death on
Imagination's test farm.

While things are not looking too grim this pull request also means the
rate of fixes for 4.1 remains nearly constant so I'd not be unhappy if
you'd delay the release"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
MPI: MIPS: Fix compilation error with GCC 5.1
IRQCHIP: mips-gic: Don't nest calls to do_IRQ()
MIPS: MSA: bugfix - disable MSA correctly for new threads/processes.
MIPS: Loongson: Do not register 8250 platform device from module.
MIPS: Cobalt: Do not build MTD platform device registration code as module.
SSB: Fix handling of ssb_pmu_get_alp_clock()
MIPS: pgtable-bits: Fix XPA damage to R6 definitions.

Changed files
+29 -25
arch
mips
cobalt
include
loongson
common
drivers
lib
+1 -2
arch/mips/cobalt/Makefile
··· 2 2 # Makefile for the Cobalt micro systems family specific parts of the kernel 3 3 # 4 4 5 - obj-y := buttons.o irq.o lcd.o led.o reset.o rtc.o serial.o setup.o time.o 5 + obj-y := buttons.o irq.o lcd.o led.o mtd.o reset.o rtc.o serial.o setup.o time.o 6 6 7 7 obj-$(CONFIG_PCI) += pci.o 8 - obj-$(CONFIG_MTD_PHYSMAP) += mtd.o
+7 -7
arch/mips/include/asm/pgtable-bits.h
··· 113 113 #define _PAGE_PRESENT_SHIFT 0 114 114 #define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) 115 115 /* R2 or later cores check for RI/XI support to determine _PAGE_READ */ 116 - #ifdef CONFIG_CPU_MIPSR2 116 + #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) 117 117 #define _PAGE_WRITE_SHIFT (_PAGE_PRESENT_SHIFT + 1) 118 118 #define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT) 119 119 #else ··· 135 135 #define _PAGE_SPLITTING (1 << _PAGE_SPLITTING_SHIFT) 136 136 137 137 /* Only R2 or newer cores have the XI bit */ 138 - #ifdef CONFIG_CPU_MIPSR2 138 + #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) 139 139 #define _PAGE_NO_EXEC_SHIFT (_PAGE_SPLITTING_SHIFT + 1) 140 140 #else 141 141 #define _PAGE_GLOBAL_SHIFT (_PAGE_SPLITTING_SHIFT + 1) 142 142 #define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) 143 - #endif /* CONFIG_CPU_MIPSR2 */ 143 + #endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */ 144 144 145 145 #endif /* CONFIG_64BIT && CONFIG_MIPS_HUGE_TLB_SUPPORT */ 146 146 147 - #ifdef CONFIG_CPU_MIPSR2 147 + #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) 148 148 /* XI - page cannot be executed */ 149 149 #ifndef _PAGE_NO_EXEC_SHIFT 150 150 #define _PAGE_NO_EXEC_SHIFT (_PAGE_MODIFIED_SHIFT + 1) ··· 160 160 #define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1) 161 161 #define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) 162 162 163 - #else /* !CONFIG_CPU_MIPSR2 */ 163 + #else /* !CONFIG_CPU_MIPSR2 && !CONFIG_CPU_MIPSR6 */ 164 164 #define _PAGE_GLOBAL_SHIFT (_PAGE_MODIFIED_SHIFT + 1) 165 165 #define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) 166 - #endif /* CONFIG_CPU_MIPSR2 */ 166 + #endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */ 167 167 168 168 #define _PAGE_VALID_SHIFT (_PAGE_GLOBAL_SHIFT + 1) 169 169 #define _PAGE_VALID (1 << _PAGE_VALID_SHIFT) ··· 205 205 */ 206 206 static inline uint64_t pte_to_entrylo(unsigned long pte_val) 207 207 { 208 - #ifdef CONFIG_CPU_MIPSR2 208 + #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) 209 209 if (cpu_has_rixi) { 210 210 int sa; 211 211 #ifdef CONFIG_32BIT
+1 -1
arch/mips/include/asm/switch_to.h
··· 104 104 if (test_and_clear_tsk_thread_flag(prev, TIF_USEDMSA)) \ 105 105 __fpsave = FP_SAVE_VECTOR; \ 106 106 (last) = resume(prev, next, task_thread_info(next), __fpsave); \ 107 - disable_msa(); \ 108 107 } while (0) 109 108 110 109 #define finish_arch_switch(prev) \ ··· 121 122 if (cpu_has_userlocal) \ 122 123 write_c0_userlocal(current_thread_info()->tp_value); \ 123 124 __restore_watch(); \ 125 + disable_msa(); \ 124 126 } while (0) 125 127 126 128 #endif /* _ASM_SWITCH_TO_H */
+1 -3
arch/mips/loongson/common/Makefile
··· 3 3 # 4 4 5 5 obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \ 6 - bonito-irq.o mem.o machtype.o platform.o 6 + bonito-irq.o mem.o machtype.o platform.o serial.o 7 7 obj-$(CONFIG_PCI) += pci.o 8 8 9 9 # 10 10 # Serial port support 11 11 # 12 12 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 13 - loongson-serial-$(CONFIG_SERIAL_8250) := serial.o 14 - obj-y += $(loongson-serial-m) $(loongson-serial-y) 15 13 obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o 16 14 obj-$(CONFIG_LOONGSON_MC146818) += rtc.o 17 15
+14 -7
drivers/irqchip/irq-mips-gic.c
··· 271 271 GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_FDC)); 272 272 } 273 273 274 - static void gic_handle_shared_int(void) 274 + static void gic_handle_shared_int(bool chained) 275 275 { 276 276 unsigned int i, intr, virq; 277 277 unsigned long *pcpu_mask; ··· 299 299 while (intr != gic_shared_intrs) { 300 300 virq = irq_linear_revmap(gic_irq_domain, 301 301 GIC_SHARED_TO_HWIRQ(intr)); 302 - do_IRQ(virq); 302 + if (chained) 303 + generic_handle_irq(virq); 304 + else 305 + do_IRQ(virq); 303 306 304 307 /* go to next pending bit */ 305 308 bitmap_clear(pending, intr, 1); ··· 434 431 #endif 435 432 }; 436 433 437 - static void gic_handle_local_int(void) 434 + static void gic_handle_local_int(bool chained) 438 435 { 439 436 unsigned long pending, masked; 440 437 unsigned int intr, virq; ··· 448 445 while (intr != GIC_NUM_LOCAL_INTRS) { 449 446 virq = irq_linear_revmap(gic_irq_domain, 450 447 GIC_LOCAL_TO_HWIRQ(intr)); 451 - do_IRQ(virq); 448 + if (chained) 449 + generic_handle_irq(virq); 450 + else 451 + do_IRQ(virq); 452 452 453 453 /* go to next pending bit */ 454 454 bitmap_clear(&pending, intr, 1); ··· 515 509 516 510 static void __gic_irq_dispatch(void) 517 511 { 518 - gic_handle_local_int(); 519 - gic_handle_shared_int(); 512 + gic_handle_local_int(false); 513 + gic_handle_shared_int(false); 520 514 } 521 515 522 516 static void gic_irq_dispatch(unsigned int irq, struct irq_desc *desc) 523 517 { 524 - __gic_irq_dispatch(); 518 + gic_handle_local_int(true); 519 + gic_handle_shared_int(true); 525 520 } 526 521 527 522 #ifdef CONFIG_MIPS_GIC_IPI
+3 -3
drivers/ssb/driver_chipcommon_pmu.c
··· 621 621 u32 crystalfreq; 622 622 const struct pmu0_plltab_entry *e = NULL; 623 623 624 - crystalfreq = chipco_read32(cc, SSB_CHIPCO_PMU_CTL) & 625 - SSB_CHIPCO_PMU_CTL_XTALFREQ >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT; 624 + crystalfreq = (chipco_read32(cc, SSB_CHIPCO_PMU_CTL) & 625 + SSB_CHIPCO_PMU_CTL_XTALFREQ) >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT; 626 626 e = pmu0_plltab_find_entry(crystalfreq); 627 627 BUG_ON(!e); 628 628 return e->freq * 1000; ··· 634 634 635 635 switch (bus->chip_id) { 636 636 case 0x5354: 637 - ssb_pmu_get_alp_clock_clk0(cc); 637 + return ssb_pmu_get_alp_clock_clk0(cc); 638 638 default: 639 639 ssb_err("ERROR: PMU alp clock unknown for device %04X\n", 640 640 bus->chip_id);
+2 -2
lib/mpi/longlong.h
··· 639 639 ************** MIPS ***************** 640 640 ***************************************/ 641 641 #if defined(__mips__) && W_TYPE_SIZE == 32 642 - #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 642 + #if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) 643 643 #define umul_ppmm(w1, w0, u, v) \ 644 644 do { \ 645 645 UDItype __ll = (UDItype)(u) * (v); \ ··· 671 671 ************** MIPS/64 ************** 672 672 ***************************************/ 673 673 #if (defined(__mips) && __mips >= 3) && W_TYPE_SIZE == 64 674 - #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 674 + #if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) 675 675 #define umul_ppmm(w1, w0, u, v) \ 676 676 do { \ 677 677 typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \