public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>,
	George Anzinger <george@mvista.com>,
	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>,
	Len Brown <len.brown@intel.com>
Subject: Re: spin_lock error in arch/i386/kernel/time.c on APM resume
Date: Sat, 12 Mar 2005 09:45:50 -0800	[thread overview]
Message-ID: <20050312094550.A23946@unix-os.sc.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0503120942570.2166@montezuma.fsmlabs.com>; from zwane@arm.linux.org.uk on Sat, Mar 12, 2005 at 09:46:54AM -0700

On Sat, Mar 12, 2005 at 09:46:54AM -0700, Zwane Mwaikambo wrote:
> On Sat, 12 Mar 2005, Venkatesh Pallipadi wrote:
> 
> > On Sat, Mar 12, 2005 at 09:25:13AM -0700, Zwane Mwaikambo wrote:
> > 
> > How about this patch? Also fixes one other use of rtc_lock in acpi/sleep/proc.c
> >
> > rtc_lock is held during timer interrupts. So, we should block interrupts
> > while holding it.
> 
> It's certainly a lot safer with saving/restoring eflags and the 
> drivers/acpi/sleep/proc.c change is a good catch, but i think the 
> get_cmos_time() callers should take care of the interrupt disabling. btw, 
> s/spin_unlock_restore/spin_unlock_irqrestore/. Please submit the proc.c 
> change.
> 

So, I will assume get_cmos_time issue will be fixed in some other way.
Sending the proper proc.c change this time. 
Andrew: Please apply.

Thanks,
Venki

rtc_lock is held during timer interrupts. So, we should block interrupts
while holding it.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>

--- linux-2.6.10/drivers/acpi/sleep/proc.c.org	2005-03-12 10:50:40.000000000 -0800
+++ linux-2.6.10/drivers/acpi/sleep/proc.c	2005-03-12 10:53:08.000000000 -0800
@@ -84,10 +84,11 @@ static int acpi_system_alarm_seq_show(st
 	u32			sec, min, hr;
 	u32			day, mo, yr;
 	unsigned char		rtc_control = 0;
+	unsigned long 		flags;
 
 	ACPI_FUNCTION_TRACE("acpi_system_alarm_seq_show");
 
-	spin_lock(&rtc_lock);
+	spin_lock_irqsave(&rtc_lock, flags);
 
 	sec = CMOS_READ(RTC_SECONDS_ALARM);
 	min = CMOS_READ(RTC_MINUTES_ALARM);
@@ -109,7 +110,7 @@ static int acpi_system_alarm_seq_show(st
 	else
 		yr = CMOS_READ(RTC_YEAR);
 
-	spin_unlock(&rtc_lock);
+	spin_unlock_irqrestore(&rtc_lock, flags);
 
 	if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
 		BCD_TO_BIN(sec);

  reply	other threads:[~2005-03-12 17:47 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 [this message]
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
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=20050312094550.A23946@unix-os.sc.intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=akpm@osdl.org \
    --cc=bfields@fieldses.org \
    --cc=george@mvista.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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