linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <andrewm@uow.edu.au>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch] perform reboot notification in process context
Date: Sun, 04 Mar 2001 22:13:40 +1100	[thread overview]
Message-ID: <3AA22364.9253CF49@uow.edu.au> (raw)

ctrl_alt_del() is called from hard interrupt context.
It traverses the reboot_notifier_list.  Many of the
callouts on that list are not designed to be called
in this context.

DAC960_Finalise()
        Calls remove_proc_entry() within interrupt context.
        remove_proc_entry uses spin_lock()s.
	Can deadlock.

drivers/char/sbc60xxwdt.c:sbc60xxwdt_unload()
        Calls misc_deregister which calls down().

drivers/i2o/i2o_core.c
        calls i2o_post_wait()
        calls i2o_reset_controller()

        Both of these schedule().  Crashes every time.

drivers/scsi/gdth.c
        gdth_halt()
        calls gdth_do_cmd
                does down().


This patch makes keventd do the callout.


--- linux-2.4.3-pre1/kernel/sys.c	Tue Oct 17 06:58:51 2000
+++ linux-akpm/kernel/sys.c	Sun Mar  4 22:04:57 2001
@@ -330,6 +330,12 @@
 	return 0;
 }
 
+static void deferred_cad(void *dummy)
+{
+	notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL);
+	machine_restart(NULL);
+}
+
 /*
  * This function gets called by ctrl-alt-del - ie the keyboard interrupt.
  * As it's called within an interrupt, it may NOT sync: the only choice
@@ -337,10 +343,13 @@
  */
 void ctrl_alt_del(void)
 {
-	if (C_A_D) {
-		notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL);
-		machine_restart(NULL);
-	} else
+	static struct tq_struct cad_tq = {
+		routine: deferred_cad,
+	};
+
+	if (C_A_D)
+		schedule_task(&cad_tq);
+	else
 		kill_proc(1, SIGINT, 1);
 }

                 reply	other threads:[~2001-03-04 11:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3AA22364.9253CF49@uow.edu.au \
    --to=andrewm@uow.edu.au \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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;
as well as URLs for NNTP newsgroup(s).