mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Properly unregister reboot notifier in case of failure in ehci hcd
@ 2006-07-12  6:38 Aleksey Gorelov
  2006-07-13  4:55 ` [linux-usb-devel] " David Brownell
  2006-07-14  2:15 ` Andrew Morton
  0 siblings, 2 replies; 13+ messages in thread
From: Aleksey Gorelov @ 2006-07-12  6:38 UTC (permalink / raw)
  To: linux-usb-devel, linux-kernel; +Cc: gregkh

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;
 }
 


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-07-31 23:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-12  6:38 [PATCH] Properly unregister reboot notifier in case of failure in ehci hcd Aleksey Gorelov
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

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®