Commit d1244336 authored by Will Deacon's avatar Will Deacon

ARM: hw_breakpoint: reduce the number of WARN_ONCE invocations

The ARM hw_breakpoint backend is currently a bit too noisy when things
start to go awry.

This patch removes a couple of over-zealous WARN_ONCE invocations and
replaces then with pr_warnings instead.
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 0d352e3d
...@@ -136,10 +136,11 @@ static u8 get_debug_arch(void) ...@@ -136,10 +136,11 @@ static u8 get_debug_arch(void)
u32 didr; u32 didr;
/* Do we implement the extended CPUID interface? */ /* Do we implement the extended CPUID interface? */
if (WARN_ONCE((((read_cpuid_id() >> 16) & 0xf) != 0xf), if (((read_cpuid_id() >> 16) & 0xf) != 0xf) {
"CPUID feature registers not supported. " pr_warning("CPUID feature registers not supported. "
"Assuming v6 debug is present.\n")) "Assuming v6 debug is present.\n");
return ARM_DEBUG_ARCH_V6; return ARM_DEBUG_ARCH_V6;
}
ARM_DBG_READ(c0, 0, didr); ARM_DBG_READ(c0, 0, didr);
return (didr >> 16) & 0xf; return (didr >> 16) & 0xf;
...@@ -231,7 +232,7 @@ static int enable_monitor_mode(void) ...@@ -231,7 +232,7 @@ static int enable_monitor_mode(void)
/* Ensure that halting mode is disabled. */ /* Ensure that halting mode is disabled. */
if (WARN_ONCE(dscr & ARM_DSCR_HDBGEN, if (WARN_ONCE(dscr & ARM_DSCR_HDBGEN,
"halting debug mode enabled. Unable to access hardware resources.\n")) { "halting debug mode enabled. Unable to access hardware resources.\n")) {
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
...@@ -626,10 +627,9 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) ...@@ -626,10 +627,9 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
* we can use the mismatch feature as a poor-man's hardware * we can use the mismatch feature as a poor-man's hardware
* single-step, but this only works for per-task breakpoints. * single-step, but this only works for per-task breakpoints.
*/ */
if (WARN_ONCE(!bp->overflow_handler && if (!bp->overflow_handler && (arch_check_bp_in_kernelspace(bp) ||
(arch_check_bp_in_kernelspace(bp) || !core_has_mismatch_brps() !core_has_mismatch_brps() || !bp->hw.bp_target)) {
|| !bp->hw.bp_target), pr_warning("overflow handler required but none found\n");
"overflow handler required but none found\n")) {
ret = -EINVAL; ret = -EINVAL;
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment