mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Will Deacon <will.deacon@arm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: hw_breakpoint: Trap undef instruction exceptions on wake-up
Date: Wed, 17 Sep 2014 13:18:20 +0100	[thread overview]
Message-ID: <20140917121820.GR12361@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1410955036-1956-1-git-send-email-geert+renesas@glider.be>

On Wed, Sep 17, 2014 at 01:57:16PM +0200, Geert Uytterhoeven wrote:
> If power area D4, which contains the Coresight-ETM hardware block, is
> powered down on R-Mobile A1 (r8a7740), the kernel crashes when
> suspending from s2ram with:
> 
>     Internal error: Oops - undefined instruction: 0 [#1] ARM
> 
> This happens because dbg_cpu_pm_notify() calls reset_ctrl_regs(), which
> can't access the debug registers as the debug module is powered down.
> 
> Protect the call to reset_ctrl_regs() by an undefined instruction hook,
> like was done in commit 0d352e3d006c9589 ("ARM: hw_breakpoint: trap
> undef instruction exceptions in reset_ctrl_regs") for another caller.

I'd prefer a better solution to this (such as tracking whether the ETM
block is powered down).  This feels very much like a hack than a good
solution.

Also, the undefined instruction hook was not supposed to be used in this
way - certainly *not* dynamically like this.  While the lookup of the
undef handler is done in a safe atomic way, calling the resulting
function is outside of the locks.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2014-09-17 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 11:57 Geert Uytterhoeven
2014-09-17 12:18 ` Russell King - ARM Linux [this message]
2014-09-23 13:30   ` Geert Uytterhoeven

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=20140917121820.GR12361@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=dietmar.eggemann@arm.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=will.deacon@arm.com \
    /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

all inboxes | Powered by JetHome®