diff mbox

[5/7] ARM: hw_breakpoint: make boot quieter without CPUID feature registers

Message ID 1350487901-3108-6-git-send-email-will.deacon@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Will Deacon Oct. 17, 2012, 3:31 p.m. UTC
Booting on a v6 core without the CPUID feature registers (e.g. 1136)
leads to a noisy dmesg complaining about their absence.

This patch changes the pr_warning into a WARN_ONCE to keep the log
quieter.

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/kernel/hw_breakpoint.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Comments

Stephen Boyd Oct. 24, 2012, 10:53 p.m. UTC | #1
On 10/17/12 08:31, Will Deacon wrote:
> Booting on a v6 core without the CPUID feature registers (e.g. 1136)
> leads to a noisy dmesg complaining about their absence.
>
> This patch changes the pr_warning into a WARN_ONCE to keep the log
> quieter.
>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> @@ -135,11 +135,10 @@ static u8 get_debug_arch(void)
>  	u32 didr;
>  
>  	/* Do we implement the extended CPUID interface? */
> -	if (((read_cpuid_id() >> 16) & 0xf) != 0xf) {
> -		pr_warning("CPUID feature registers not supported. "
> -			   "Assuming v6 debug is present.\n");
> +	if (WARN_ONCE(((read_cpuid_id() >> 16) & 0xf) != 0xf,
> +		"CPUID feature registers not supported. "
> +		"Assuming v6 debug is present.\n"))

Won't this print a big stack trace instead of a one liner? Perhaps you
want pr_warn_once()?
diff mbox

Patch

diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index b6f4aec..f267120 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -135,11 +135,10 @@  static u8 get_debug_arch(void)
 	u32 didr;
 
 	/* Do we implement the extended CPUID interface? */
-	if (((read_cpuid_id() >> 16) & 0xf) != 0xf) {
-		pr_warning("CPUID feature registers not supported. "
-			   "Assuming v6 debug is present.\n");
+	if (WARN_ONCE(((read_cpuid_id() >> 16) & 0xf) != 0xf,
+		"CPUID feature registers not supported. "
+		"Assuming v6 debug is present.\n"))
 		return ARM_DEBUG_ARCH_V6;
-	}
 
 	ARM_DBG_READ(c0, 0, didr);
 	return (didr >> 16) & 0xf;