public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: George Anzinger <george@mvista.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	Andrew Morton <akpm@osdl.org>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Lee Revell <rlrevell@joe-job.com>, Ingo Molnar <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: spin_lock error in arch/i386/kernel/time.c on APM resume
Date: Tue, 15 Mar 2005 01:04:50 -0800	[thread overview]
Message-ID: <4236A532.70700@mvista.com> (raw)
In-Reply-To: <20050315000612.GF9873@elf.ucw.cz>

Pavel Machek wrote:
> Hi!
> 
> 
>>>>I agree.  Still in all that follows, no one has addressed the apparent 
>>>>race described above.  The reason the system reported the errors that 
>>>>started this thread is that the APM restore code was trying to read the 
>>>>cmos clock (I assume to set the xtime clock) WHILE the timer interrupt 
>>>>code what trying to set the cmos clock from xtime.  In other words, it is 
>>>>destroying the time it is trying to read.  I repeat "Possibly the APM 
>>>>code should change time_status to STA_UNSYNC on the way into the sleep."  
>>>>I am not sure how ntp is supposed to react to the resume but I suspect 
>>>>that the system time is rather out of sync...
>>>
>>>
>>>It needs to work without NTP, too. You don't get NTP on plane (etc)
>>>where suspend is most usefull.
>>>
>>>We have CMOS clock, it should be possible to get time from there
>>>without resorting to NTP..
>>
>>Eh... sure, but... the bug was reported because the system was attempting 
>>to update the cmos clock (which it does every ~11 min.) during APM exit.   
>>It does this IF AND ONLY IF the system is synced to an external source as 
>>indicated by the STA_UNSYNC bit being cleared in the time_state.  Now, I 
>>don't know what or how APM and NTP are supposed to play together, but I 
>>suspect that on entry to APM time is no longer synced, thus my comment.
>>
>>As to your comment, the bug would never have shown its ugly face if the 
>>system wasn't using NTP.
> 
> 
> Uh, ok, you are right. We should set time to STA_UNSYNC so that we do
> not write back to CMOS during/shortly after resume. I did not realize
> what STA_UNSYNC means. Perhaps you have patch to  do that somewhere?
> ;-))))

Zwane has convinced me that the real problem is doing the right thing (tm) in 
the APM code, i.e. not allowing the timer interrupt until after reading the cmos 
clock, for which he has a patch tendered.

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/


  reply	other threads:[~2005-03-15  9:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-12 13:11 spin_lock error in arch/i386/kernel/time.c on APM resume J. Bruce Fields
2005-03-12 15:21 ` [PATCH] APM: fix interrupts enabled in device_power_up Zwane Mwaikambo
2005-03-15 22:33   ` J. Bruce Fields
2005-03-15 22:40     ` Zwane Mwaikambo
2005-03-12 15:56 ` spin_lock error in arch/i386/kernel/time.c on APM resume George Anzinger
2005-03-12 16:25   ` Zwane Mwaikambo
2005-03-12 16:36     ` Venkatesh Pallipadi
2005-03-12 16:46       ` Zwane Mwaikambo
2005-03-12 17:45         ` Venkatesh Pallipadi
2005-03-12 18:04     ` George Anzinger
2005-03-12 19:58       ` Zwane Mwaikambo
2005-03-12 20:25         ` George Anzinger
2005-03-13 18:35       ` Pavel Machek
2005-03-14 23:49         ` George Anzinger
2005-03-15  0:08           ` Pavel Machek
2005-03-15  9:04             ` George Anzinger [this message]
2005-03-12 21:14   ` Barry K. Nathan
2005-03-12 21:18   ` Lee Revell

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=4236A532.70700@mvista.com \
    --to=george@mvista.com \
    --cc=akpm@osdl.org \
    --cc=bfields@fieldses.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pavel@ucw.cz \
    --cc=rlrevell@joe-job.com \
    --cc=zwane@arm.linux.org.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