1 // SPDX-License-Identifier: GPL-2.0 1 2 #include <linux/nmi.h> 3 #include <linux/cpufreq.h> 4 #include <linux/perf/arm_pmu.h> 5 6 /* 7 * Safe maximum CPU frequency in case a partic 8 * cpufreq driver. Although, architecture does 9 * maximum frequency but 5 GHz seems to be saf 10 * Arm CPUs in the market which are clocked mu 11 * hand, we can't make it much higher as it wo 12 * detection timeout on parts which are runnin 13 * Developerbox) and doesn't possess a cpufreq 14 */ 15 #define SAFE_MAX_CPU_FREQ 5000000000UL / 16 u64 hw_nmi_get_sample_period(int watchdog_thre 17 { 18 unsigned int cpu = smp_processor_id(); 19 unsigned long max_cpu_freq; 20 21 max_cpu_freq = cpufreq_get_hw_max_freq 22 if (!max_cpu_freq) 23 max_cpu_freq = SAFE_MAX_CPU_FR 24 25 return (u64)max_cpu_freq * watchdog_th 26 } 27 28 bool __init arch_perf_nmi_is_available(void) 29 { 30 /* 31 * hardlockup_detector_perf_init() wil 32 * however, the pmu interrupts will ac 33 * NMI and the hardlockup detector wou 34 */ 35 return arm_pmu_irq_is_nmi(); 36 } 37
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.