diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-17 12:42:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-17 12:42:03 -0400 |
commit | fa121bb3fed6313b1f0af23952301e06cf6d32ed (patch) | |
tree | d69b35c59365d028a501e64dc52414313ed10c89 /arch/mips/kernel | |
parent | 7d4901c08ae573e569dd01a29bef2ad404a40f97 (diff) | |
parent | e5793cd1b5fedb39337cfa62251a25030f526e56 (diff) |
Merge tag 'mips_5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS updates from Paul Burton:
"A light batch this time around but significant improvements for
certain systems:
- Removal of readq & writeq for MIPS32 kernels where they would
simply BUG() anyway, allowing drivers or other code that #ifdefs on
their presence to work properly.
- Improvements for Ingenic JZ4740 systems, including support for the
external memory controller & pinmuxing fixes for qi_lb60/NanoNote
systems.
- Improvements for Lantiq systems, in particular around SMP & IPIs.
- DT updates for ralink/MediaTek MT7628a systems to probe & configure
a bunch more devices.
- Miscellaneous cleanups & build fixes"
* tag 'mips_5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (30 commits)
MIPS: fix some more fall through errors in arch/mips
MIPS: perf events: handle switch statement falling through warnings
mips/kprobes: Export kprobe_fault_handler()
MAINTAINERS: Add myself as Ingenic SoCs maintainer
MIPS: ralink: mt7628a.dtsi: Add watchdog controller DT node
MIPS: ralink: mt7628a.dtsi: Add SPI controller DT node
MIPS: ralink: mt7628a.dtsi: Add GPIO controller DT node
MIPS: ralink: mt7628a.dtsi: Add pinctrl DT properties to the UART nodes
MIPS: ralink: mt7628a.dtsi: Add pinmux DT node
MIPS: ralink: mt7628a.dtsi: Add SPDX GPL-2.0 license identifier
MIPS: lantiq: Add SMP support for lantiq interrupt controller
MIPS: lantiq: Shorten register names, remove unused macros
MIPS: lantiq: Fix bitfield masking
MIPS: lantiq: Remove unused macros
MIPS: lantiq: Fix attributes of of_device_id structure
MIPS: lantiq: Change variables to the same type as the source
MIPS: lantiq: Move macro directly to iomem function
mips: Remove q-accessors from non-64bit platforms
FDDI: defza: Include linux/io-64-nonatomic-lo-hi.h
MIPS: configs: Remove useless UEVENT_HELPER_PATH
...
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/ftrace.c | 23 | ||||
-rw-r--r-- | arch/mips/kernel/perf_event_mipsxx.c | 30 |
2 files changed, 27 insertions, 26 deletions
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index 4b5e1f2bfbce..2625232bfe52 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c | |||
@@ -333,20 +333,21 @@ void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra, | |||
333 | return; | 333 | return; |
334 | 334 | ||
335 | /* | 335 | /* |
336 | * "parent_ra_addr" is the stack address saved the return address of | 336 | * "parent_ra_addr" is the stack address where the return address of |
337 | * the caller of _mcount. | 337 | * the caller of _mcount is saved. |
338 | * | 338 | * |
339 | * if the gcc < 4.5, a leaf function does not save the return address | 339 | * If gcc < 4.5, a leaf function does not save the return address |
340 | * in the stack address, so, we "emulate" one in _mcount's stack space, | 340 | * in the stack address, so we "emulate" one in _mcount's stack space, |
341 | * and hijack it directly, but for a non-leaf function, it save the | 341 | * and hijack it directly. |
342 | * return address to the its own stack space, we can not hijack it | 342 | * For a non-leaf function, it does save the return address to its own |
343 | * directly, but need to find the real stack address, | 343 | * stack space, so we can not hijack it directly, but need to find the |
344 | * ftrace_get_parent_addr() does it! | 344 | * real stack address, which is done by ftrace_get_parent_addr(). |
345 | * | 345 | * |
346 | * if gcc>= 4.5, with the new -mmcount-ra-address option, for a | 346 | * If gcc >= 4.5, with the new -mmcount-ra-address option, for a |
347 | * non-leaf function, the location of the return address will be saved | 347 | * non-leaf function, the location of the return address will be saved |
348 | * to $12 for us, and for a leaf function, only put a zero into $12. we | 348 | * to $12 for us. |
349 | * do it in ftrace_graph_caller of mcount.S. | 349 | * For a leaf function, it just puts a zero into $12, so we handle |
350 | * it in ftrace_graph_caller() of mcount.S. | ||
350 | */ | 351 | */ |
351 | 352 | ||
352 | /* old_parent_ra = *parent_ra_addr; */ | 353 | /* old_parent_ra = *parent_ra_addr; */ |
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index e0ebaa0a333e..a3e2da8391ea 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c | |||
@@ -790,15 +790,19 @@ static void reset_counters(void *arg) | |||
790 | case 4: | 790 | case 4: |
791 | mipsxx_pmu_write_control(3, 0); | 791 | mipsxx_pmu_write_control(3, 0); |
792 | mipspmu.write_counter(3, 0); | 792 | mipspmu.write_counter(3, 0); |
793 | /* fall through */ | ||
793 | case 3: | 794 | case 3: |
794 | mipsxx_pmu_write_control(2, 0); | 795 | mipsxx_pmu_write_control(2, 0); |
795 | mipspmu.write_counter(2, 0); | 796 | mipspmu.write_counter(2, 0); |
797 | /* fall through */ | ||
796 | case 2: | 798 | case 2: |
797 | mipsxx_pmu_write_control(1, 0); | 799 | mipsxx_pmu_write_control(1, 0); |
798 | mipspmu.write_counter(1, 0); | 800 | mipspmu.write_counter(1, 0); |
801 | /* fall through */ | ||
799 | case 1: | 802 | case 1: |
800 | mipsxx_pmu_write_control(0, 0); | 803 | mipsxx_pmu_write_control(0, 0); |
801 | mipspmu.write_counter(0, 0); | 804 | mipspmu.write_counter(0, 0); |
805 | /* fall through */ | ||
802 | } | 806 | } |
803 | } | 807 | } |
804 | 808 | ||
@@ -1380,7 +1384,7 @@ static int mipsxx_pmu_handle_shared_irq(void) | |||
1380 | struct perf_sample_data data; | 1384 | struct perf_sample_data data; |
1381 | unsigned int counters = mipspmu.num_counters; | 1385 | unsigned int counters = mipspmu.num_counters; |
1382 | u64 counter; | 1386 | u64 counter; |
1383 | int handled = IRQ_NONE; | 1387 | int n, handled = IRQ_NONE; |
1384 | struct pt_regs *regs; | 1388 | struct pt_regs *regs; |
1385 | 1389 | ||
1386 | if (cpu_has_perf_cntr_intr_bit && !(read_c0_cause() & CAUSEF_PCI)) | 1390 | if (cpu_has_perf_cntr_intr_bit && !(read_c0_cause() & CAUSEF_PCI)) |
@@ -1401,20 +1405,16 @@ static int mipsxx_pmu_handle_shared_irq(void) | |||
1401 | 1405 | ||
1402 | perf_sample_data_init(&data, 0, 0); | 1406 | perf_sample_data_init(&data, 0, 0); |
1403 | 1407 | ||
1404 | switch (counters) { | 1408 | for (n = counters - 1; n >= 0; n--) { |
1405 | #define HANDLE_COUNTER(n) \ | 1409 | if (!test_bit(n, cpuc->used_mask)) |
1406 | case n + 1: \ | 1410 | continue; |
1407 | if (test_bit(n, cpuc->used_mask)) { \ | 1411 | |
1408 | counter = mipspmu.read_counter(n); \ | 1412 | counter = mipspmu.read_counter(n); |
1409 | if (counter & mipspmu.overflow) { \ | 1413 | if (!(counter & mipspmu.overflow)) |
1410 | handle_associated_event(cpuc, n, &data, regs); \ | 1414 | continue; |
1411 | handled = IRQ_HANDLED; \ | 1415 | |
1412 | } \ | 1416 | handle_associated_event(cpuc, n, &data, regs); |
1413 | } | 1417 | handled = IRQ_HANDLED; |
1414 | HANDLE_COUNTER(3) | ||
1415 | HANDLE_COUNTER(2) | ||
1416 | HANDLE_COUNTER(1) | ||
1417 | HANDLE_COUNTER(0) | ||
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | #ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS | 1420 | #ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS |