History

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

Pull MIPS updates from Ralf Baechle: "A number of fixes all across the MIPS tree. No area is particularly standing out and things have cooled down quite nicely for a release." * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: Function tracer: Fix broken function tracing mips: Move __virt_addr_valid() to a place for MIPS 64 MIPS: Netlogic: Fix UP compilation on XLR MIPS: AR71xx: Fix AR71XX_PCI_MEM_SIZE MIPS: AR724x: Fix AR724X_PCI_MEM_SIZE MIPS: Lantiq: Fix cp0_perfcount_irq mapping MIPS: DSP: Fix DSP mask for registers. MIPS: Fix build failure by adding definition of pfn_pmd(). MIPS: Octeon: Fix warning. MIPS: delay.c: Check BITS_PER_LONG instead of __SIZEOF_LONG__ MIPS: PNX833x: Fix comment. MIPS: Add struct p_format to union mips_instruction. MIPS: Export <asm/break.h>. MIPS: BCM47xx: Enable SSB prerequisite SSB_DRIVER_PCICORE. MIPS: BCM47xx: Select GPIOLIB for BCMA on bcm47xx platform MIPS: vpe.c: Fix null pointer dereference in print arguments.

Linus Torvalds committed 13 years ago

Commit aeb8eed2 parents 04c2eee 58b694018 files · +67 −22Browse files

Unified · Split

18 files
  1. arch/mips/bcm47xx/Kconfig +3 −0
  2. arch/mips/cavium-octeon/executive/cvmx-l2c.c +5 −4
  3. arch/mips/include/asm/dsp.h +1 −1
  4. arch/mips/include/asm/inst.h +1 −0
  5. arch/mips/include/asm/mach-pnx833x/war.h +1 −1
  6. arch/mips/include/asm/pgtable-64.h +1 −0
  7. arch/mips/include/uapi/asm/Kbuild +1 −0
  8. arch/mips/include/uapi/asm/break.h +0 −0
  9. arch/mips/kernel/ftrace.c +35 −1
  10. arch/mips/kernel/mcount.S +4 −3
  11. arch/mips/kernel/vpe.c +1 −1
  12. arch/mips/lantiq/irq.c +1 −1
  13. arch/mips/lib/delay.c +1 −1
  14. arch/mips/mm/ioremap.c +0 −6
  15. arch/mips/mm/mmap.c +6 −0
  16. arch/mips/netlogic/xlr/setup.c +4 −1
  17. arch/mips/pci/pci-ar71xx.c +1 −1
  18. arch/mips/pci/pci-ar724x.c +1 −1
arch/mips/bcm47xx/Kconfig+3−0
@@ -8,8 +8,10 @@ config BCM47XX_SSB · 7 unmodified lines
88 select SSB_DRIVER_EXTIF
99 select SSB_EMBEDDED
1010 select SSB_B43_PCI_BRIDGE if PCI
11+ select SSB_DRIVER_PCICORE if PCI
1112 select SSB_PCICORE_HOSTMODE if PCI
1213 select SSB_DRIVER_GPIO
14+ select GPIOLIB
1315 default y
1416 help
1517 Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support.
@@ -25,6 +27,7 @@ config BCM47XX_BCMA · 9 unmodified lines
2527 select BCMA_HOST_PCI if PCI
2628 select BCMA_DRIVER_PCI_HOSTMODE if PCI
2729 select BCMA_DRIVER_GPIO
30+ select GPIOLIB
2831 default y
2932 help
3033 Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus.
arch/mips/cavium-octeon/executive/cvmx-l2c.c+5−4
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 * measurement, and debugging facilities.
3131 */
3232
33+#include <linux/compiler.h>
3334 #include <linux/irqflags.h>
3435 #include <asm/octeon/cvmx.h>
3536 #include <asm/octeon/cvmx-l2c.h>
@@ -285,22 +286,22 @@ uint64_t cvmx_l2c_read_perf(uint32_t counter) · 249 unmodified lines
285286 */
286287 static void fault_in(uint64_t addr, int len)
287288 {
288− volatile char *ptr;
289− volatile char dummy;
289+ char *ptr;
290+
290291 /*
291292 * Adjust addr and length so we get all cache lines even for
292293 * small ranges spanning two cache lines.
293294 */
294295 len += addr & CVMX_CACHE_LINE_MASK;
295296 addr &= ~CVMX_CACHE_LINE_MASK;
296− ptr = (volatile char *)cvmx_phys_to_ptr(addr);
297+ ptr = cvmx_phys_to_ptr(addr);
297298 /*
298299 * Invalidate L1 cache to make sure all loads result in data
299300 * being in L2.
300301 */
301302 CVMX_DCACHE_INVALIDATE;
302303 while (len > 0) {
303− dummy += *ptr;
304+ ACCESS_ONCE(*ptr);
304305 len -= CVMX_CACHE_LINE_SIZE;
305306 ptr += CVMX_CACHE_LINE_SIZE;
306307 }
arch/mips/include/asm/dsp.h+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616 #include <asm/mipsregs.h>
1717
1818 #define DSP_DEFAULT 0x00000000
19−#define DSP_MASK 0x3ff
19+#define DSP_MASK 0x3f
2020
2121 #define __enable_dsp_hazard() \
2222 do { \
arch/mips/include/asm/inst.h+1−0
@@ -353,6 +353,7 @@ union mips_instruction { · 352 unmodified lines
353353 struct u_format u_format;
354354 struct c_format c_format;
355355 struct r_format r_format;
356+ struct p_format p_format;
356357 struct f_format f_format;
357358 struct ma_format ma_format;
358359 struct b_format b_format;
arch/mips/include/asm/mach-pnx833x/war.h+1−1
@@ -21,4 +21,4 @@ · 20 unmodified lines
2121 #define R10000_LLSC_WAR 0
2222 #define MIPS34K_MISSED_ITLB_WAR 0
2323
24−#endif /* __ASM_MIPS_MACH_PNX8550_WAR_H */
24+#endif /* __ASM_MIPS_MACH_PNX833X_WAR_H */
arch/mips/include/asm/pgtable-64.h+1−0
@@ -230,6 +230,7 @@ static inline void pud_clear(pud_t *pudp) · 229 unmodified lines
230230 #else
231231 #define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT))
232232 #define pfn_pte(pfn, prot) __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot))
233+#define pfn_pmd(pfn, prot) __pmd(((pfn) << _PFN_SHIFT) | pgprot_val(prot))
233234 #endif
234235
235236 #define __pgd_offset(address) pgd_index(address)
arch/mips/include/uapi/asm/Kbuild+1−0
@@ -3,6 +3,7 @@ include include/uapi/asm-generic/Kbuild.asm · 2 unmodified lines
33
44 header-y += auxvec.h
55 header-y += bitsperlong.h
6+header-y += break.h
67 header-y += byteorder.h
78 header-y += cachectl.h
89 header-y += errno.h
arch/mips/include/uapi/asm/break.hrenamed from arch/mips/include/asm/break.h+0−0

File renamed without changes.

arch/mips/kernel/ftrace.c+35−1
@@ -25,6 +25,12 @@ · 24 unmodified lines
2525 #define MCOUNT_OFFSET_INSNS 4
2626 #endif
2727
28+/* Arch override because MIPS doesn't need to run this from stop_machine() */
29+void arch_ftrace_update_code(int command)
30+{
31+ ftrace_modify_all_code(command);
32+}
33+
2834 /*
2935 * Check if the address is in kernel space
3036 *
@@ -89,6 +95,24 @@ static int ftrace_modify_code(unsigned long ip, unsigned int new_code) · 58 unmodified lines
8995 return 0;
9096 }
9197
98+#ifndef CONFIG_64BIT
99+static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
100+ unsigned int new_code2)
101+{
102+ int faulted;
103+
104+ safe_store_code(new_code1, ip, faulted);
105+ if (unlikely(faulted))
106+ return -EFAULT;
107+ ip += 4;
108+ safe_store_code(new_code2, ip, faulted);
109+ if (unlikely(faulted))
110+ return -EFAULT;
111+ flush_icache_range(ip, ip + 8); /* original ip + 12 */
112+ return 0;
113+}
114+#endif
115+
92116 /*
93117 * The details about the calling site of mcount on MIPS
94118 *
@@ -131,8 +155,18 @@ int ftrace_make_nop(struct module *mod, · 36 unmodified lines
131155 * needed.
132156 */
133157 new = in_kernel_space(ip) ? INSN_NOP : INSN_B_1F;
134−
158+#ifdef CONFIG_64BIT
135159 return ftrace_modify_code(ip, new);
160+#else
161+ /*
162+ * On 32 bit MIPS platforms, gcc adds a stack adjust
163+ * instruction in the delay slot after the branch to
164+ * mcount and expects mcount to restore the sp on return.
165+ * This is based on a legacy API and does nothing but
166+ * waste instructions so it's being removed at runtime.
167+ */
168+ return ftrace_modify_code_2(ip, new, INSN_NOP);
169+#endif
136170 }
137171
138172 int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
arch/mips/kernel/mcount.S+4−3
@@ -46,9 +46,8 @@ · 45 unmodified lines
4646 PTR_L a5, PT_R9(sp)
4747 PTR_L a6, PT_R10(sp)
4848 PTR_L a7, PT_R11(sp)
49− PTR_ADDIU sp, PT_SIZE
5049 #else
51− PTR_ADDIU sp, (PT_SIZE + 8)
50+ PTR_ADDIU sp, PT_SIZE
5251 #endif
5352 .endm
5453
@@ -69,7 +68,9 @@ NESTED(ftrace_caller, PT_SIZE, ra) · 14 unmodified lines
6968 .globl _mcount
7069 _mcount:
7170 b ftrace_stub
72− nop
71+ addiu sp,sp,8
72+
73+ /* When tracing is activated, it calls ftrace_caller+8 (aka here) */
7374 lw t1, function_trace_stop
7475 bnez t1, ftrace_stub
7576 nop
arch/mips/kernel/vpe.c+1−1
@@ -705,7 +705,7 @@ static int vpe_run(struct vpe * v) · 704 unmodified lines
705705
706706 printk(KERN_WARNING
707707 "VPE loader: TC %d is already in use.\n",
708− t->index);
708+ v->tc->index);
709709 return -ENOEXEC;
710710 }
711711 } else {
arch/mips/lantiq/irq.c+1−1
@@ -408,7 +408,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) · 407 unmodified lines
408408 #endif
409409
410410 /* tell oprofile which irq to use */
411− cp0_perfcount_irq = LTQ_PERF_IRQ;
411+ cp0_perfcount_irq = irq_create_mapping(ltq_domain, LTQ_PERF_IRQ);
412412
413413 /*
414414 * if the timer irq is not one of the mips irqs we need to
arch/mips/lib/delay.c+1−1
@@ -21,7 +21,7 @@ void __delay(unsigned long loops) · 20 unmodified lines
2121 " .set noreorder \n"
2222 " .align 3 \n"
2323 "1: bnez %0, 1b \n"
24−#if __SIZEOF_LONG__ == 4
24+#if BITS_PER_LONG == 32
2525 " subu %0, 1 \n"
2626 #else
2727 " dsubu %0, 1 \n"
arch/mips/mm/ioremap.c+0−6
@@ -190,9 +190,3 @@ void __iounmap(const volatile void __iomem *addr) · 189 unmodified lines
190190
191191 EXPORT_SYMBOL(__ioremap);
192192 EXPORT_SYMBOL(__iounmap);
193−
194−int __virt_addr_valid(const volatile void *kaddr)
195−{
196− return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
197−}
198−EXPORT_SYMBOL_GPL(__virt_addr_valid);
arch/mips/mm/mmap.c+6−0
@@ -192,3 +192,9 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) · 191 unmodified lines
192192
193193 return ret;
194194 }
195+
196+int __virt_addr_valid(const volatile void *kaddr)
197+{
198+ return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
199+}
200+EXPORT_SYMBOL_GPL(__virt_addr_valid);
arch/mips/netlogic/xlr/setup.c+4−1
@@ -193,8 +193,11 @@ static void nlm_init_node(void) · 192 unmodified lines
193193
194194 void __init prom_init(void)
195195 {
196− int i, *argv, *envp; /* passed as 32 bit ptrs */
196+ int *argv, *envp; /* passed as 32 bit ptrs */
197197 struct psb_info *prom_infop;
198+#ifdef CONFIG_SMP
199+ int i;
200+#endif
198201
199202 /* truncate to 32 bit and sign extend all args */
200203 argv = (int *)(long)(int)fw_arg1;
arch/mips/pci/pci-ar71xx.c+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
2424 #include <asm/mach-ath79/pci.h>
2525
2626 #define AR71XX_PCI_MEM_BASE 0x10000000
27−#define AR71XX_PCI_MEM_SIZE 0x08000000
27+#define AR71XX_PCI_MEM_SIZE 0x07000000
2828
2929 #define AR71XX_PCI_WIN0_OFFS 0x10000000
3030 #define AR71XX_PCI_WIN1_OFFS 0x11000000
arch/mips/pci/pci-ar724x.c+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #define AR724X_PCI_CTRL_SIZE 0x100
2222
2323 #define AR724X_PCI_MEM_BASE 0x10000000
24−#define AR724X_PCI_MEM_SIZE 0x08000000
24+#define AR724X_PCI_MEM_SIZE 0x04000000
2525
2626 #define AR724X_PCI_REG_RESET 0x18
2727 #define AR724X_PCI_REG_INT_STATUS 0x4c