Subject: [PATCH v2] ARM: save/restore diagnostic register on Cortex-A9 suspend/resume

From: [email-masked] (Will Deacon)
Date: Wed, 2 Jul 2014 13:34:44 +0100

Hi Tomasz,

I asked the hardware guys to take a closer look at your issue and they've
uncovered the problem with trying to document an undocumented register.

On Tue, Jul 01, 2014 at 05:26:05PM +0100, Tomasz Figa wrote:
> On 01.07.2014 16:44, Russell King - ARM Linux wrote:
> > On Tue, Jun 24, 2014 at 07:40:27PM +0200, Tomasz Figa wrote:
> >> On 24.06.2014 18:33, Will Deacon wrote:
> >>> On A9, it should be write-ignore. Are you seeing problems on a real SoC?
> >>
> >> I'm observing a complete system hang on Exynos4412-based Trats2 board if
> >> I try to write this register in resume from system-wide sleep.

In actual fact, this register causes an undefined instruction exception if
you try to write it from a non-secure mode (although reads work fine, for
whatever that's worth). That nicely explains what you're seeing, but it
leaves us in a right old two and eight with respect to the suspend/resume
code.

Given that we don't know whether we're running secure or non-secure, I'm
not sure about the best approach to solve this. For arm64, we simply mandate
booting non-secure and require firmware to do everything that requires
secure access, but we're not in a position to attempt imposing these sorts
of restrictions for arch/arm/.

Does anybody have any ideas? We could try `handling' the undef, but it's
ugly and fragile.

Anyway, apologies for the mistake earlier on -- I assumed the documentation
I had was correct.

Will