diff options
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/cevt-r4k.c | 38 | ||||
| -rw-r--r-- | arch/mips/kernel/cpufreq/loongson2_clock.c | 1 | ||||
| -rw-r--r-- | arch/mips/kernel/perf_event_mipsxx.c | 8 | ||||
| -rw-r--r-- | arch/mips/kernel/scall32-o32.S | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-64.S | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-n32.S | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-o32.S | 2 | ||||
| -rw-r--r-- | arch/mips/kernel/traps.c | 3 |
8 files changed, 34 insertions, 24 deletions
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index 98c5a9737c14..e2d8e199be32 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c | |||
| @@ -103,19 +103,10 @@ static int c0_compare_int_pending(void) | |||
| 103 | 103 | ||
| 104 | /* | 104 | /* |
| 105 | * Compare interrupt can be routed and latched outside the core, | 105 | * Compare interrupt can be routed and latched outside the core, |
| 106 | * so a single execution hazard barrier may not be enough to give | 106 | * so wait up to worst case number of cycle counter ticks for timer interrupt |
| 107 | * it time to clear as seen in the Cause register. 4 time the | 107 | * changes to propagate to the cause register. |
| 108 | * pipeline depth seems reasonably conservative, and empirically | ||
| 109 | * works better in configurations with high CPU/bus clock ratios. | ||
| 110 | */ | 108 | */ |
| 111 | 109 | #define COMPARE_INT_SEEN_TICKS 50 | |
| 112 | #define compare_change_hazard() \ | ||
| 113 | do { \ | ||
| 114 | irq_disable_hazard(); \ | ||
| 115 | irq_disable_hazard(); \ | ||
| 116 | irq_disable_hazard(); \ | ||
| 117 | irq_disable_hazard(); \ | ||
| 118 | } while (0) | ||
| 119 | 110 | ||
| 120 | int c0_compare_int_usable(void) | 111 | int c0_compare_int_usable(void) |
| 121 | { | 112 | { |
| @@ -126,8 +117,12 @@ int c0_compare_int_usable(void) | |||
| 126 | * IP7 already pending? Try to clear it by acking the timer. | 117 | * IP7 already pending? Try to clear it by acking the timer. |
| 127 | */ | 118 | */ |
| 128 | if (c0_compare_int_pending()) { | 119 | if (c0_compare_int_pending()) { |
| 129 | write_c0_compare(read_c0_count()); | 120 | cnt = read_c0_count(); |
| 130 | compare_change_hazard(); | 121 | write_c0_compare(cnt); |
| 122 | back_to_back_c0_hazard(); | ||
| 123 | while (read_c0_count() < (cnt + COMPARE_INT_SEEN_TICKS)) | ||
| 124 | if (!c0_compare_int_pending()) | ||
| 125 | break; | ||
| 131 | if (c0_compare_int_pending()) | 126 | if (c0_compare_int_pending()) |
| 132 | return 0; | 127 | return 0; |
| 133 | } | 128 | } |
| @@ -136,7 +131,7 @@ int c0_compare_int_usable(void) | |||
| 136 | cnt = read_c0_count(); | 131 | cnt = read_c0_count(); |
| 137 | cnt += delta; | 132 | cnt += delta; |
| 138 | write_c0_compare(cnt); | 133 | write_c0_compare(cnt); |
| 139 | compare_change_hazard(); | 134 | back_to_back_c0_hazard(); |
| 140 | if ((int)(read_c0_count() - cnt) < 0) | 135 | if ((int)(read_c0_count() - cnt) < 0) |
| 141 | break; | 136 | break; |
| 142 | /* increase delta if the timer was already expired */ | 137 | /* increase delta if the timer was already expired */ |
| @@ -145,12 +140,17 @@ int c0_compare_int_usable(void) | |||
| 145 | while ((int)(read_c0_count() - cnt) <= 0) | 140 | while ((int)(read_c0_count() - cnt) <= 0) |
| 146 | ; /* Wait for expiry */ | 141 | ; /* Wait for expiry */ |
| 147 | 142 | ||
| 148 | compare_change_hazard(); | 143 | while (read_c0_count() < (cnt + COMPARE_INT_SEEN_TICKS)) |
| 144 | if (c0_compare_int_pending()) | ||
| 145 | break; | ||
| 149 | if (!c0_compare_int_pending()) | 146 | if (!c0_compare_int_pending()) |
| 150 | return 0; | 147 | return 0; |
| 151 | 148 | cnt = read_c0_count(); | |
| 152 | write_c0_compare(read_c0_count()); | 149 | write_c0_compare(cnt); |
| 153 | compare_change_hazard(); | 150 | back_to_back_c0_hazard(); |
| 151 | while (read_c0_count() < (cnt + COMPARE_INT_SEEN_TICKS)) | ||
| 152 | if (!c0_compare_int_pending()) | ||
| 153 | break; | ||
| 154 | if (c0_compare_int_pending()) | 154 | if (c0_compare_int_pending()) |
| 155 | return 0; | 155 | return 0; |
| 156 | 156 | ||
diff --git a/arch/mips/kernel/cpufreq/loongson2_clock.c b/arch/mips/kernel/cpufreq/loongson2_clock.c index cefc6e259baf..5426779d9fdb 100644 --- a/arch/mips/kernel/cpufreq/loongson2_clock.c +++ b/arch/mips/kernel/cpufreq/loongson2_clock.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * for more details. | 7 | * for more details. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/module.h> | ||
| 10 | #include <linux/cpufreq.h> | 11 | #include <linux/cpufreq.h> |
| 11 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
| 12 | 13 | ||
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index 4f2971bcf8e5..315fc0b250f8 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c | |||
| @@ -623,7 +623,7 @@ static int mipspmu_event_init(struct perf_event *event) | |||
| 623 | if (!atomic_inc_not_zero(&active_events)) { | 623 | if (!atomic_inc_not_zero(&active_events)) { |
| 624 | if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) { | 624 | if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) { |
| 625 | atomic_dec(&active_events); | 625 | atomic_dec(&active_events); |
| 626 | return -ENOSPC; | 626 | return -EINVAL; |
| 627 | } | 627 | } |
| 628 | 628 | ||
| 629 | mutex_lock(&pmu_reserve_mutex); | 629 | mutex_lock(&pmu_reserve_mutex); |
| @@ -732,15 +732,15 @@ static int validate_group(struct perf_event *event) | |||
| 732 | memset(&fake_cpuc, 0, sizeof(fake_cpuc)); | 732 | memset(&fake_cpuc, 0, sizeof(fake_cpuc)); |
| 733 | 733 | ||
| 734 | if (!validate_event(&fake_cpuc, leader)) | 734 | if (!validate_event(&fake_cpuc, leader)) |
| 735 | return -ENOSPC; | 735 | return -EINVAL; |
| 736 | 736 | ||
| 737 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { | 737 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { |
| 738 | if (!validate_event(&fake_cpuc, sibling)) | 738 | if (!validate_event(&fake_cpuc, sibling)) |
| 739 | return -ENOSPC; | 739 | return -EINVAL; |
| 740 | } | 740 | } |
| 741 | 741 | ||
| 742 | if (!validate_event(&fake_cpuc, event)) | 742 | if (!validate_event(&fake_cpuc, event)) |
| 743 | return -ENOSPC; | 743 | return -EINVAL; |
| 744 | 744 | ||
| 745 | return 0; | 745 | return 0; |
| 746 | } | 746 | } |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 47920657968d..a632bc144efa 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
| @@ -591,6 +591,8 @@ einval: li v0, -ENOSYS | |||
| 591 | sys sys_syncfs 1 | 591 | sys sys_syncfs 1 |
| 592 | sys sys_sendmmsg 4 | 592 | sys sys_sendmmsg 4 |
| 593 | sys sys_setns 2 | 593 | sys sys_setns 2 |
| 594 | sys sys_process_vm_readv 6 /* 4345 */ | ||
| 595 | sys sys_process_vm_writev 6 | ||
| 594 | .endm | 596 | .endm |
| 595 | 597 | ||
| 596 | /* We pre-compute the number of _instruction_ bytes needed to | 598 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index fb7334bea731..3b5a5e9ae49c 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
| @@ -430,4 +430,6 @@ sys_call_table: | |||
| 430 | PTR sys_syncfs | 430 | PTR sys_syncfs |
| 431 | PTR sys_sendmmsg | 431 | PTR sys_sendmmsg |
| 432 | PTR sys_setns | 432 | PTR sys_setns |
| 433 | PTR sys_process_vm_readv | ||
| 434 | PTR sys_process_vm_writev /* 5305 */ | ||
| 433 | .size sys_call_table,.-sys_call_table | 435 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 6de1f598346e..6be6f7020923 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
| @@ -430,4 +430,6 @@ EXPORT(sysn32_call_table) | |||
| 430 | PTR sys_syncfs | 430 | PTR sys_syncfs |
| 431 | PTR compat_sys_sendmmsg | 431 | PTR compat_sys_sendmmsg |
| 432 | PTR sys_setns | 432 | PTR sys_setns |
| 433 | PTR compat_sys_process_vm_readv | ||
| 434 | PTR compat_sys_process_vm_writev /* 6310 */ | ||
| 433 | .size sysn32_call_table,.-sysn32_call_table | 435 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 1d813169e453..54228553691d 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
| @@ -548,4 +548,6 @@ sys_call_table: | |||
| 548 | PTR sys_syncfs | 548 | PTR sys_syncfs |
| 549 | PTR compat_sys_sendmmsg | 549 | PTR compat_sys_sendmmsg |
| 550 | PTR sys_setns | 550 | PTR sys_setns |
| 551 | PTR compat_sys_process_vm_readv /* 4345 */ | ||
| 552 | PTR compat_sys_process_vm_writev | ||
| 551 | .size sys_call_table,.-sys_call_table | 553 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 261ccbc07740..5c8a49d55054 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
| @@ -1596,7 +1596,8 @@ void __cpuinit per_cpu_trap_init(void) | |||
| 1596 | } | 1596 | } |
| 1597 | #endif /* CONFIG_MIPS_MT_SMTC */ | 1597 | #endif /* CONFIG_MIPS_MT_SMTC */ |
| 1598 | 1598 | ||
| 1599 | cpu_data[cpu].asid_cache = ASID_FIRST_VERSION; | 1599 | if (!cpu_data[cpu].asid_cache) |
| 1600 | cpu_data[cpu].asid_cache = ASID_FIRST_VERSION; | ||
| 1600 | 1601 | ||
| 1601 | atomic_inc(&init_mm.mm_count); | 1602 | atomic_inc(&init_mm.mm_count); |
| 1602 | current->active_mm = &init_mm; | 1603 | current->active_mm = &init_mm; |
