From: Will Deacon <will.deacon@arm.com>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Will Deacon <will@willdeacon.co.uk>,
Lokesh Vutla <lokeshvutla@ti.com>,
Dietmar Eggemann <Dietmar.Eggemann@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] ARM: hw_breakpoint: Enable debug powerdown only if system supports 'has_ossr'
Date: Mon, 18 Mar 2013 17:06:49 +0000 [thread overview]
Message-ID: <20130318170649.GA29585@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <514736D4.4070906@ti.com>
On Mon, Mar 18, 2013 at 03:46:28PM +0000, Santosh Shilimkar wrote:
> On Monday 18 March 2013 08:37 PM, Will Deacon wrote:
> > That really sucks :( Does this affect all OMAP-based boards?
> >
> All OMAP4 based boards..
Brilliant. Is there any way that the secure code can be fixed in future
products?
> >> + /* Check if we have access to CPU debug features */
> >> + ARM_DBG_READ(c7, c14, 6, val);
> >> + if ((val & 0x1) == 0) {
> >> + pr_warn_once("CPU %d debug is unavailable\n", cpu);
> >> + cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu));
> >> + return;
> >> + }
> >
> > There are a few of problems here:
> >
> > 1. That is only checking for non-secure access, which precludes
> > running Linux in secure mode.
> >
> We can check bit 4 as well to take care linux running in secure mode.
It still doesn't help unless we know whether Linux is running secure or
non-secure.
> > 2. DBGAUTHSTATUS accesses are UNPREDICTABLE when the double-lock is
> > set for v7.1 processors.
> >
> > 3. DBGAUTHSTATUS doesn't exist in ARMv6.
> >
> We cans skip the code for these versions like...
> if (!ARM_DEBUG_ARCH_V7_ECP14 == get_debug_arch())
> goto skip_dbgsts_read;
Sure, I was just pointing out that the code needs fixing for this.
> > 4. CPUs without the security extensions have DBGAUTHSTATUS.NSE == 0
> >
> Which bit is that ? I don't find this bit in Cortex-A9 docs. With all
> these checks, may be a separate function like 'is_debug_available()'
> would be better.
NSE is bit 0 (the one you're checking).
>
> > 5. Accessing DBGAUTHSTATUS requires DBGEN to be driven high.
> > Assuming that your pr_warn_once is emitted, this implies that
> > DBGEN is driven high from cold boot, yet the NSE bit is low,
> > implying that DBGEN is also low. That's contradictory, so I have
> > no idea what's going on...
> >
> Me neither. The warning is emitted at least.
Any chance you could follow up with your firmware/hardware guys about this
please? I'd really like to understand how we end up in this state in case we
can do something in the architecture to stop it from happening in future.
> > Apart from that, it's fine!
> >
> If you agree, I can update patch accordingly.
> BTW, do you have any better trick to take care of
> above scenraio ?
Well, we could just add the warn_once prints but that doesn't stop debug
from breaking after the first pm/suspend/hotplug operation.
Will
next prev parent reply other threads:[~2013-03-18 17:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 6:52 [PATCH] ARM: hw_breakpoint: Enable debug powerdown only if system supports 'has_ossr' Lokesh Vutla
2013-03-13 12:05 ` Dietmar Eggemann
2013-03-13 12:29 ` Lokesh Vutla
2013-03-14 7:38 ` Santosh Shilimkar
2013-03-15 5:00 ` Will Deacon
2013-03-18 6:51 ` Santosh Shilimkar
2013-03-18 15:07 ` Will Deacon
2013-03-18 15:46 ` Santosh Shilimkar
2013-03-18 17:06 ` Will Deacon [this message]
2013-03-19 6:39 ` Santosh Shilimkar
2013-03-19 10:28 ` Will Deacon
2013-03-25 9:11 ` Santosh Shilimkar
2013-03-25 10:49 ` Will Deacon
2013-03-25 10:55 ` Santosh Shilimkar
2013-03-28 11:59 ` Dietmar Eggemann
2013-03-14 17:38 ` Kevin Hilman
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=20130318170649.GA29585@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=Dietmar.Eggemann@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=lokeshvutla@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=will@willdeacon.co.uk \
/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).