linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: Forced HW_BREAKPOINT
Date: Wed, 1 Dec 2010 17:32:38 -0000	[thread overview]
Message-ID: <004f01cb917d$c04b4910$40e1db30$@deacon@arm.com> (raw)
In-Reply-To: <4CF67C52.4000300@ti.com>

Cyril,

> This was without a debugger connected.  It is possible that I have
> missed some top level debug enable in the SoC (haven't traced through
> the entire logic yet).

Please can you try this patch?


diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 21e3a4a..bcf8437 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -268,9 +268,6 @@ static u8 get_max_wp_len(void)
        if (debug_arch < ARM_DEBUG_ARCH_V7_ECP14)
                goto out;
 
-       if (enable_monitor_mode())
-               goto out;
-
        memset(&ctrl, 0, sizeof(ctrl));
        ctrl.len = ARM_BREAKPOINT_LEN_8;
        ctrl_reg = encode_ctrl_reg(ctrl);
@@ -784,15 +781,18 @@ static void __init reset_ctrl_regs(void *unused)
 
 static int __init arch_hw_breakpoint_init(void)
 {
-       int ret = 0;
        u32 dscr;
 
        debug_arch = get_debug_arch();
 
        if (debug_arch > ARM_DEBUG_ARCH_V7_ECP14) {
                pr_info("debug architecture 0x%x unsupported.\n", debug_arch);
-               ret = -ENODEV;
-               goto out;
+               return 0;
+       }
+
+       if (enable_monitor_mode()) {
+               pr_warning("unable to activate monitor debug mode.\n");
+               return 0;
        }
 
        /* Determine how many BRPs/WRPs are available. */
@@ -829,8 +829,7 @@ static int __init arch_hw_breakpoint_init(void)
        hook_ifault_code(2, hw_breakpoint_pending, SIGTRAP, TRAP_HWBKPT,
                        "breakpoint debug exception");
 
-out:
-       return ret;
+       return 0;
 }
 arch_initcall(arch_hw_breakpoint_init);


This should cause the hw_breakpoint stuff to give up if monitor-mode
cannot be enabled.

Will

  reply	other threads:[~2010-12-01 17:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 23:56 Forced HW_BREAKPOINT Cyril Chemparathy
2010-12-01  9:54 ` Will Deacon
2010-12-01 16:17   ` Cyril Chemparathy
2010-12-01 16:28     ` Will Deacon
2010-12-01 16:48       ` Cyril Chemparathy
2010-12-01 17:32         ` Will Deacon [this message]
2010-12-01 20:14           ` Cyril Chemparathy
2010-12-02  9:37             ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004f01cb917d$c04b4910$40e1db30$@deacon@arm.com' \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).