mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aleksey Gorelov <dared1st@yahoo.com>
To: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Cc: gregkh@suse.de
Subject: [PATCH] Properly unregister reboot notifier in case of failure in ehci hcd
Date: Tue, 11 Jul 2006 23:38:41 -0700 (PDT)	[thread overview]
Message-ID: <20060712063841.18958.qmail@web81202.mail.mud.yahoo.com> (raw)

Hi,

  If some problem occurs during ehci startup, for instance, request_irq fails, echi hcd driver
tries it best to cleanup, but fails to unregister reboot notifier, which in turn leads to crash on
reboot/poweroff. Below is the patch against current git to fix this.
  I did not check if the same problem existed for uhci/ohci host drivers.

Signed off by: Aleks Gorelov <dared1st@yahoo.com>

--- linux-2.6/drivers/usb/host/ehci-hcd.c-orig	2006-07-11 17:27:54.000000000 -0700
+++ linux-2.6/drivers/usb/host/ehci-hcd.c	2006-07-11 17:27:20.000000000 -0700
@@ -483,9 +483,6 @@
 	}
 	ehci->command = temp;
 
-	ehci->reboot_notifier.notifier_call = ehci_reboot;
-	register_reboot_notifier(&ehci->reboot_notifier);
-
 	return 0;
 }
 
@@ -499,7 +496,6 @@
 
 	/* EHCI spec section 4.1 */
 	if ((retval = ehci_reset(ehci)) != 0) {
-		unregister_reboot_notifier(&ehci->reboot_notifier);
 		ehci_mem_cleanup(ehci);
 		return retval;
 	}
@@ -560,6 +556,9 @@
 	 */
 	create_debug_files(ehci);
 
+	ehci->reboot_notifier.notifier_call = ehci_reboot;
+	register_reboot_notifier(&ehci->reboot_notifier);
+
 	return 0;
 }
 


             reply	other threads:[~2006-07-12  6:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12  6:38 Aleksey Gorelov [this message]
2006-07-13  4:55 ` [linux-usb-devel] " David Brownell
2006-07-14  2:15 ` Andrew Morton
2006-07-14 16:46   ` Aleksey Gorelov
2006-07-14 18:37     ` [linux-usb-devel] " Alan Stern
2006-07-14 21:33     ` David Brownell
2006-07-31 17:23       ` Aleksey Gorelov
2006-07-31 18:18         ` Alan Stern
2006-07-31 18:28           ` Aleksey Gorelov
2006-07-31 18:58             ` Alan Stern
2006-07-31 19:35               ` Aleksey Gorelov
2006-07-31 19:46                 ` Alan Stern
2006-07-31 21:30                   ` David Brownell

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=20060712063841.18958.qmail@web81202.mail.mud.yahoo.com \
    --to=dared1st@yahoo.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®