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

Lorenzo Pieralisi lorenzo.pieralisi at arm.com
Wed Jul 2 07:01:34 PDT 2014


On Wed, Jul 02, 2014 at 01:34:44PM +0100, Will Deacon wrote:
> 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.

You could try to treat it the same way as ACTLR (see cpu_v7_do_resume,
where the ACTLR is first read, if it is already set, ie equal to the
saved value, skip the write); ACTLR suffers from the same issue and IIRC
that's why Russell added the "teq" then "write" test at the time
cpu_suspend was consolidated.

Lorenzo




More information about the linux-arm-kernel mailing list