Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Will Deacon <will.deacon@arm.com>

+8 -8
+8 -8
arch/arm/kernel/hw_breakpoint.c
··· 136 136 u32 didr; 137 137 138 138 /* Do we implement the extended CPUID interface? */ 139 - if (WARN_ONCE((((read_cpuid_id() >> 16) & 0xf) != 0xf), 140 - "CPUID feature registers not supported. " 141 - "Assuming v6 debug is present.\n")) 139 + if (((read_cpuid_id() >> 16) & 0xf) != 0xf) { 140 + pr_warning("CPUID feature registers not supported. " 141 + "Assuming v6 debug is present.\n"); 142 142 return ARM_DEBUG_ARCH_V6; 143 + } 143 144 144 145 ARM_DBG_READ(c0, 0, didr); 145 146 return (didr >> 16) & 0xf; ··· 232 231 233 232 /* Ensure that halting mode is disabled. */ 234 233 if (WARN_ONCE(dscr & ARM_DSCR_HDBGEN, 235 - "halting debug mode enabled. Unable to access hardware resources.\n")) { 234 + "halting debug mode enabled. Unable to access hardware resources.\n")) { 236 235 ret = -EPERM; 237 236 goto out; 238 237 } ··· 627 626 * we can use the mismatch feature as a poor-man's hardware 628 627 * single-step, but this only works for per-task breakpoints. 629 628 */ 630 - if (WARN_ONCE(!bp->overflow_handler && 631 - (arch_check_bp_in_kernelspace(bp) || !core_has_mismatch_brps() 632 - || !bp->hw.bp_target), 633 - "overflow handler required but none found\n")) { 629 + if (!bp->overflow_handler && (arch_check_bp_in_kernelspace(bp) || 630 + !core_has_mismatch_brps() || !bp->hw.bp_target)) { 631 + pr_warning("overflow handler required but none found\n"); 634 632 ret = -EINVAL; 635 633 } 636 634 out: