From: Guanqun Lu Subject: [PATCH 2 of 3] fix S3 suspend error Date: Mon, 23 Feb 2009 23:27:48 +0800 Message-ID: <0e17f070db2aa92bc74f.1235402868@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Guanqun Lu # Date 1235401621 -28800 # Node ID 0e17f070db2aa92bc74f29245cdb8528aa72bbe3 # Parent b713518a241b6f6e07edb10c3fc38143138f82ea fix S3 suspend error platform_time_calibration() is invoked in S3 when irq is disabled, which causes ASSERT() error in spin_lock_irq(). spin_lock_irqsave() saves us. Signed-off-by: Guanqun Lu diff -r b713518a241b -r 0e17f070db2a xen/arch/x86/time.c --- a/xen/arch/x86/time.c Mon Feb 23 23:06:32 2009 +0800 +++ b/xen/arch/x86/time.c Mon Feb 23 23:07:01 2009 +0800 @@ -607,13 +607,14 @@ static void platform_time_calibration(vo { u64 count; s_time_t stamp; - - spin_lock_irq(&platform_timer_lock); + unsigned long flags; + + spin_lock_irqsave(&platform_timer_lock, flags); count = plt_stamp64 + ((plt_src.read_counter() - plt_stamp) & plt_mask); stamp = __read_platform_stime(count); stime_platform_stamp = stamp; platform_timer_stamp = count; - spin_unlock_irq(&platform_timer_lock); + spin_unlock_irqrestore(&platform_timer_lock, flags); } static void resume_platform_timer(void)