diff options
Diffstat (limited to 'arch/s390/oprofile/hwsampler.c')
| -rw-r--r-- | arch/s390/oprofile/hwsampler.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c index 33cbd373cce4..053caa0fd276 100644 --- a/arch/s390/oprofile/hwsampler.c +++ b/arch/s390/oprofile/hwsampler.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | * Author: Heinz Graalfs <graalfs@de.ibm.com> | 5 | * Author: Heinz Graalfs <graalfs@de.ibm.com> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/kernel_stat.h> | ||
| 8 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
| 9 | #include <linux/module.h> | 10 | #include <linux/module.h> |
| 10 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
| @@ -674,17 +675,11 @@ int hwsampler_activate(unsigned int cpu) | |||
| 674 | static void hws_ext_handler(unsigned int ext_int_code, | 675 | static void hws_ext_handler(unsigned int ext_int_code, |
| 675 | unsigned int param32, unsigned long param64) | 676 | unsigned int param32, unsigned long param64) |
| 676 | { | 677 | { |
| 677 | int cpu; | ||
| 678 | struct hws_cpu_buffer *cb; | 678 | struct hws_cpu_buffer *cb; |
| 679 | 679 | ||
| 680 | cpu = smp_processor_id(); | 680 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CPM]++; |
| 681 | cb = &per_cpu(sampler_cpu_buffer, cpu); | 681 | cb = &__get_cpu_var(sampler_cpu_buffer); |
| 682 | 682 | atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32); | |
| 683 | atomic_xchg( | ||
| 684 | &cb->ext_params, | ||
| 685 | atomic_read(&cb->ext_params) | ||
| 686 | | S390_lowcore.ext_params); | ||
| 687 | |||
| 688 | if (hws_wq) | 683 | if (hws_wq) |
| 689 | queue_work(hws_wq, &cb->worker); | 684 | queue_work(hws_wq, &cb->worker); |
| 690 | } | 685 | } |
| @@ -764,7 +759,7 @@ static int worker_check_error(unsigned int cpu, int ext_params) | |||
| 764 | if (!sdbt || !*sdbt) | 759 | if (!sdbt || !*sdbt) |
| 765 | return -EINVAL; | 760 | return -EINVAL; |
| 766 | 761 | ||
| 767 | if (ext_params & EI_IEA) | 762 | if (ext_params & EI_PRA) |
| 768 | cb->req_alert++; | 763 | cb->req_alert++; |
| 769 | 764 | ||
| 770 | if (ext_params & EI_LSDA) | 765 | if (ext_params & EI_LSDA) |
| @@ -1009,7 +1004,7 @@ int hwsampler_deallocate() | |||
| 1009 | if (hws_state != HWS_STOPPED) | 1004 | if (hws_state != HWS_STOPPED) |
| 1010 | goto deallocate_exit; | 1005 | goto deallocate_exit; |
| 1011 | 1006 | ||
| 1012 | smp_ctl_clear_bit(0, 5); /* set bit 58 CR0 off */ | 1007 | ctl_clear_bit(0, 5); /* set bit 58 CR0 off */ |
| 1013 | deallocate_sdbt(); | 1008 | deallocate_sdbt(); |
| 1014 | 1009 | ||
| 1015 | hws_state = HWS_DEALLOCATED; | 1010 | hws_state = HWS_DEALLOCATED; |
| @@ -1123,7 +1118,7 @@ int hwsampler_shutdown() | |||
| 1123 | mutex_lock(&hws_sem); | 1118 | mutex_lock(&hws_sem); |
| 1124 | 1119 | ||
| 1125 | if (hws_state == HWS_STOPPED) { | 1120 | if (hws_state == HWS_STOPPED) { |
| 1126 | smp_ctl_clear_bit(0, 5); /* set bit 58 CR0 off */ | 1121 | ctl_clear_bit(0, 5); /* set bit 58 CR0 off */ |
| 1127 | deallocate_sdbt(); | 1122 | deallocate_sdbt(); |
| 1128 | } | 1123 | } |
| 1129 | if (hws_wq) { | 1124 | if (hws_wq) { |
| @@ -1198,7 +1193,7 @@ start_all_exit: | |||
| 1198 | hws_oom = 1; | 1193 | hws_oom = 1; |
| 1199 | hws_flush_all = 0; | 1194 | hws_flush_all = 0; |
| 1200 | /* now let them in, 1407 CPUMF external interrupts */ | 1195 | /* now let them in, 1407 CPUMF external interrupts */ |
| 1201 | smp_ctl_set_bit(0, 5); /* set CR0 bit 58 */ | 1196 | ctl_set_bit(0, 5); /* set CR0 bit 58 */ |
| 1202 | 1197 | ||
| 1203 | return 0; | 1198 | return 0; |
| 1204 | } | 1199 | } |
