<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [linux-pm] [RFC PATCH] ARM hibernation / suspend-to-disk support code</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>&gt; [ ... ]<BR>
&gt; &gt; &gt; r8_FIQ..r12_FIQ can store arbitrary state used by the FIQ handler,<BR>
&gt; &gt; &gt; if FIQ is in use.&nbsp; Can we expect any driver using FIQ to save/restore<BR>
&gt; &gt; &gt; this state itself, rather than doing it globally?&nbsp; This may be<BR>
&gt; &gt; &gt; reasonable.<BR>
&gt; &gt;<BR>
&gt; &gt; We don't need to save/restore those, because at the time the snapshot is<BR>
&gt; &gt; taken interrupts are off and we cannot be in any trap handler either. On<BR>
&gt; &gt; resume, the kernel that has been loaded has initialized them properly<BR>
&gt; &gt; already.<BR>
&gt;<BR>
&gt; I'm not sure if this is a safe assumption in general.&nbsp; We may decide to<BR>
&gt; switch to loading hibernate images from boot loaders, for example, and<BR>
&gt; it may not hold any more.&nbsp; Generally, please don't assume _anything_ has<BR>
&gt; been properly initialized during resume, before the image is loaded.<BR>
&gt; This has already beaten us a couple of times.<BR>
&gt;<BR>
&gt; Thanks,<BR>
&gt; Rafael<BR>
<BR>
Hi Rafael,<BR>
<BR>
regarding &quot;cannot rely on any state&quot;, if that is so then it seems quite unnecessary to save/restore _any_ ARM non-#SYSTEM_MODE state - it'd better be reinitialized by calling cpu_init() after the &quot;core restore&quot; callback. The archives were quite a bit helpful in this context:<BR>
<BR>
<A HREF="http://www.mail-archive.com/linux-omap@vger.kernel.org/msg12671.html">http://www.mail-archive.com/linux-omap@vger.kernel.org/msg12671.html</A><BR>
<BR>
that's the same situation isn't it ?<BR>
<BR>
Regarding FIQ: I agree with Russell and others who previously stated that a driver using FIQ is responsible for implementing suspend/resume hooks itself. But what could be done is to disable/enable it for the snapshot, just in case.<BR>
<BR>
I've also found out that the vmlinux.lds changes don't seem to be necessary - they've been the last remnant of the &quot;old&quot; ARM hibernation patch, but just leaving those out looks to make no difference (the nosave data still ends up in the same place, with the same elf section attributes).<BR>
<BR>
With all this in mind, the core part of the patch becomes somewhat simpler. See attached.<BR>
<BR>
<BR>
I'll test this on Monday.<BR>
FrankH.<BR>
</FONT>
</P>

</BODY>
</HTML>