From: Li Zefan <lizf@cn.fujitsu.com>
To: Dan Aloni <da-x@monatomic.org>
Cc: Aristeu Rozanski <aris@ruivo.org>,
Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86_64: fix a deadlock in set_rtc_mmss()
Date: Fri, 16 Nov 2007 11:26:17 +0800 [thread overview]
Message-ID: <473D0DD9.3000600@cn.fujitsu.com> (raw)
In-Reply-To: <20071115183046.GD8068@cathedrallabs.org>
Aristeu Rozanski wrote:
> Hello Dan,
>> Patch is valid only for 2.6.23.x, guessing from the recent arch/ changes
>> in 2.6.24-rc.
>>
>> set_rtc_mmss() was used to be called from interrupt context in 2.6.22,
>> however in 2.6.23, it is called from a timer context, where interrupts
>> are enabled. This patch ensures that rtc_interrupt() won't dead-lock
>> with set_rtc_mmss().
>
>> diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
>> index 6241b50..8414236 100644
>> --- a/arch/x86_64/kernel/time.c
>> +++ b/arch/x86_64/kernel/time.c
>> @@ -87,13 +87,14 @@ static int set_rtc_mmss(unsigned long nowtime)
>> int retval = 0;
>> int real_seconds, real_minutes, cmos_minutes;
>> unsigned char control, freq_select;
>> + unsigned long flags;
>>
>> /*
>> * IRQs are disabled when we're called from the timer interrupt,
>> * no need for spin_lock_irqsave()
>> */
>>
>> - spin_lock(&rtc_lock);
>> + spin_lock_irqsave(&rtc_lock, flags);
> I think it's a good idea to update or just remove the comment above.
>
David P. Reed has sent a patch to fix this bug before you.
http://lkml.org/lkml/2007/11/14/435
Li Zefan
next prev parent reply other threads:[~2007-11-16 3:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 16:55 [PATCH] x86_64: fix a deadlock in set_rtc_mmss() Dan Aloni
2007-11-15 18:30 ` Aristeu Rozanski
2007-11-16 3:26 ` Li Zefan [this message]
2007-11-17 8:34 ` Dan Aloni
2007-11-20 7:59 ` Thomas Gleixner
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=473D0DD9.3000600@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=aris@ruivo.org \
--cc=da-x@monatomic.org \
--cc=linux-kernel@vger.kernel.org \
/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