All of lore.kernel.org
 help / color / mirror / Atom feed
From: "K.Prasad" <prasad@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@elte.hu>, Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Fix traceback seen when resuming after suspend-to-ram
Date: Wed, 22 Jul 2009 20:41:23 +0530	[thread overview]
Message-ID: <20090722151123.GA4934@in.ibm.com> (raw)

Hi Ingo,
	Please accept a patch that fixes the warning message and traceback
seen upon a resume after suspend-to-ram.

The warning message is emitted because
spin_unlock_bh()<--load_debug_registers() is invoked with interrupts
disabled upon 'resume' unlike when invoked at boot-time, and was
reported on LKML here: http://lkml.org/lkml/2009/7/18/145.

This patch modifies load_debug_registers() to block all interrupts and not
just bottom-halves (bottom-halves were blocked in load_debug_registers()
prevent flush_thread_hw_breakpoint() from interfering when invoked from
SoftIRQ context).

Fix traceback seen when resuming after suspend-to-ram

This patch fixes a traceback when resuming after a suspend-to-ram operation.
The traceback warns about entering slowpatch due to a spin_unlock_bh() done
from interrupt context.

Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
---
 kernel/hw_breakpoint.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Index: linux-2.6-tip/kernel/hw_breakpoint.c
===================================================================
--- linux-2.6-tip.orig/kernel/hw_breakpoint.c
+++ linux-2.6-tip/kernel/hw_breakpoint.c
@@ -80,17 +80,15 @@ void load_debug_registers(void)
 	unsigned long flags;
 	struct task_struct *tsk = current;
 
-	spin_lock_bh(&hw_breakpoint_lock);
-
 	/* Prevent IPIs for new kernel breakpoint updates */
-	local_irq_save(flags);
+	spin_lock_irqsave(&hw_breakpoint_lock, flags);
+
 	arch_update_kernel_hw_breakpoint(NULL);
-	local_irq_restore(flags);
 
 	if (test_tsk_thread_flag(tsk, TIF_DEBUG))
 		arch_install_thread_hw_breakpoint(tsk);
 
-	spin_unlock_bh(&hw_breakpoint_lock);
+	spin_unlock_irqrestore(&hw_breakpoint_lock, flags);
 }
 
 /*

             reply	other threads:[~2009-07-22 15:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-22 15:11 K.Prasad [this message]
2009-07-28  3:50 ` Fix traceback seen when resuming after suspend-to-ram Frederic Weisbecker

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=20090722151123.GA4934@in.ibm.com \
    --to=prasad@linux.vnet.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.