mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] [1/2] Add a SYSTEM_PANIC state
Date: Tue,  2 Sep 2008 15:49:22 +0200 (CEST)	[thread overview]
Message-ID: <20080902134922.9401F3E6A00@basil.firstfloor.org> (raw)
In-Reply-To: <20080902349.573187695@firstfloor.org>


Natural extension of the other system states.

This is useful to do some special case code on system panic.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 include/linux/kernel.h |    1 +
 kernel/panic.c         |    2 ++
 2 files changed, 3 insertions(+)

Index: linux/include/linux/kernel.h
===================================================================
--- linux.orig/include/linux/kernel.h
+++ linux/include/linux/kernel.h
@@ -248,6 +248,7 @@ extern enum system_states {
 	SYSTEM_POWER_OFF,
 	SYSTEM_RESTART,
 	SYSTEM_SUSPEND_DISK,
+	SYSTEM_PANIC,
 } system_state;
 
 #define TAINT_PROPRIETARY_MODULE	(1<<0)
Index: linux/kernel/panic.c
===================================================================
--- linux.orig/kernel/panic.c
+++ linux/kernel/panic.c
@@ -68,6 +68,8 @@ NORET_TYPE void panic(const char * fmt, 
 	unsigned long caller = (unsigned long) __builtin_return_address(0);
 #endif
 
+	system_state = SYSTEM_PANIC;
+
 	/*
 	 * It's possible to come here directly from a panic-assertion and not
 	 * have preempt disabled. Some functions called from here want

  reply	other threads:[~2008-09-02 13:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 13:49 [PATCH] [0/2] Fix panic regression in 2.6.27 Andi Kleen
2008-09-02 13:49 ` Andi Kleen [this message]
2008-09-03 19:04   ` [PATCH] [1/2] Add a SYSTEM_PANIC state Andrew Morton
2008-09-03 19:16     ` Andi Kleen
2008-09-03 19:32       ` Andrew Morton
2008-09-03 19:44         ` Andi Kleen
2008-09-02 13:49 ` [PATCH] [2/2] Don't complain about disabled irqs when the system has paniced Andi Kleen
2008-09-02 14:28   ` Peter Zijlstra
2008-09-02 14:40     ` Andi Kleen
2008-09-02 14:45       ` Peter Zijlstra
2008-09-02 15:00         ` Andi Kleen
2008-09-03  6:02           ` Nick Piggin
2008-09-03  6:59             ` Andi Kleen
2008-09-03  9:37               ` Nick Piggin
2008-09-03  9:48                 ` Andi Kleen
2008-09-03 10:17                   ` Nick Piggin
2008-09-03 10:26                     ` Jens Axboe
2008-09-12 19:50   ` Pavel Machek

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=20080902134922.9401F3E6A00@basil.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

Powered by JetHome