Lines Matching +full:detector +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0-only
3 // VCPU stall detector.
63 /* Reload the stall detector counter register every in vcpu_stall_detect_timer_fn()
86 struct hrtimer *vcpu_hrtimer = &vcpu_stall_detector->vcpu_hrtimer; in start_stall_detector_cpu()
91 /* Compute the number of ticks required for the stall detector in start_stall_detector_cpu()
99 /* Enable the internal clock and start the stall detector */ in start_stall_detector_cpu()
102 /* Pet the stall detector at half of its expiration timeout in start_stall_detector_cpu()
109 vcpu_hrtimer->function = vcpu_stall_detect_timer_fn; in start_stall_detector_cpu()
110 vcpu_stall_detector->is_initialized = true; in start_stall_detector_cpu()
123 if (!vcpu_stall_detector->is_initialized) in stop_stall_detector_cpu()
126 /* Disable the stall detector for the current CPU */ in stop_stall_detector_cpu()
127 hrtimer_cancel(&vcpu_stall_detector->vcpu_hrtimer); in stop_stall_detector_cpu()
129 vcpu_stall_detector->is_initialized = false; in stop_stall_detector_cpu()
141 struct device_node *np = pdev->dev.of_node; in vcpu_stall_detect_probe()
143 vcpu_stall_detectors = devm_alloc_percpu(&pdev->dev, in vcpu_stall_detect_probe()
146 return -ENOMEM; in vcpu_stall_detect_probe()
150 dev_err(&pdev->dev, "Failed to get memory resource\n"); in vcpu_stall_detect_probe()
154 if (!of_property_read_u32(np, "clock-frequency", &clock_freq_hz)) { in vcpu_stall_detect_probe()
157 dev_warn(&pdev->dev, "clk out of range\n"); in vcpu_stall_detect_probe()
162 if (!of_property_read_u32(np, "timeout-sec", &stall_timeout_sec)) { in vcpu_stall_detect_probe()
165 dev_warn(&pdev->dev, "stall timeout out of range\n"); in vcpu_stall_detect_probe()
181 dev_err(&pdev->dev, "failed to install cpu hotplug"); in vcpu_stall_detect_probe()
204 { .compatible = "qemu,vcpu-stall-detector", },
223 MODULE_DESCRIPTION("VCPU stall detector");