linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* OHCI problems with suspend/resume
@ 2003-07-23 22:08 Pavel Machek
  2003-07-24  1:19 ` [linux-usb-devel] " David Brownell
                   ` (2 more replies)
  0 siblings, 3 replies; 50+ messages in thread
From: Pavel Machek @ 2003-07-23 22:08 UTC (permalink / raw)
  To: weissg, kernel list, linux-usb-devel

Hi!

In 2.6.0-test1, OHCI is non-functional after first suspend/resume, and
kills machine during secon suspend/resume cycle.

What happens is that ohci_irq gets ohci->hcca == NULL, and kills
machine. Why is ohci->hcca == NULL? ohci_stop was called from
hcd_panic() and freed ohci->hcca.

I believe that we should

1) not free ohci->hcca so that system has better chance surviving
hcd_panic()

and 

2) inform user when hcd panics.

This patch does both, please apply,

[Okay, you probably want to kill the ifdefs, and kill the code,
leaving just a comment...]
								Pavel

--- /usr/src/tmp/linux/drivers/usb/core/hcd.c	2003-07-06 20:07:49.000000000 +0200
+++ /usr/src/linux/drivers/usb/core/hcd.c	2003-07-23 23:32:55.000000000 +0200
@@ -1486,6 +1486,7 @@
 static void hcd_panic (void *_hcd)
 {
 	struct usb_hcd *hcd = _hcd;
+	printk(KERN_CRIT "Host controller panicked\n");
 	hcd->driver->stop (hcd);
 }
 
--- /usr/src/tmp/linux/drivers/usb/host/ohci-hcd.c	2003-05-27 13:43:39.000000000 +0200
+++ /usr/src/linux/drivers/usb/host/ohci-hcd.c	2003-07-23 23:31:46.000000000 +0200
@@ -627,12 +632,18 @@
 	
 	remove_debug_files (ohci);
 	ohci_mem_cleanup (ohci);
+#if 0
+	/* Freeing hcca at this point is bad idea, because ohci_irq
+	   can't cope with ohci->hcca being NULL, and therefore will
+	   crash the machine after hcd_panic()
+	 */
 	if (ohci->hcca) {
 		pci_free_consistent (ohci->hcd.pdev, sizeof *ohci->hcca,
 					ohci->hcca, ohci->hcca_dma);
 		ohci->hcca = NULL;
 		ohci->hcca_dma = 0;
 	}
+#endif
 }
 
 /*-------------------------------------------------------------------------*/

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

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

end of thread, other threads:[~2003-08-07 23:04 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-23 22:08 OHCI problems with suspend/resume Pavel Machek
2003-07-24  1:19 ` [linux-usb-devel] " David Brownell
2003-07-24 10:24   ` Pavel Machek
2003-07-24 17:10     ` David Brownell
2003-07-24 22:10       ` Pavel Machek
2003-07-24 12:37 ` Dominik Brugger
2003-07-24 12:56   ` Dominik Brugger
2003-07-24 22:04   ` Pavel Machek
2003-07-24 22:46   ` Pavel Machek
2003-07-25  7:52     ` Dominik Brugger
2003-07-25 15:06       ` [linux-usb-devel] " Alan Stern
2003-07-25 17:20         ` Benjamin Herrenschmidt
2003-07-25 22:48           ` David Brownell
2003-07-26 16:02             ` Alan Stern
2003-07-26 21:01             ` Pavel Machek
2003-07-26 21:16               ` David Brownell
2003-07-27 14:57               ` Alan Stern
2003-07-31  3:27               ` David Brownell
2003-07-31  3:51                 ` David Brownell
2003-07-31  9:42                 ` Pavel Machek
2003-07-31 13:37                   ` David Brownell
2003-07-31 14:09                     ` Pavel Machek
2003-07-31 17:32                       ` David Brownell
2003-07-31 17:31                         ` Pavel Machek
2003-07-31 21:32                         ` Benjamin Herrenschmidt
2003-07-31 21:30                       ` Benjamin Herrenschmidt
2003-07-31 21:29                     ` Benjamin Herrenschmidt
2003-07-31  9:47                 ` Pavel Machek
2003-07-31 13:30                   ` David Brownell
2003-07-31 16:06                     ` Pavel Machek
2003-07-31  9:49                 ` Pavel Machek
2003-07-31 13:23                   ` David Brownell
2003-07-31 16:07                     ` Pavel Machek
2003-07-31 21:25                     ` Benjamin Herrenschmidt
2003-07-31 21:25                   ` Benjamin Herrenschmidt
2003-07-31 22:08                     ` Pavel Machek
2003-07-31 21:23                 ` Benjamin Herrenschmidt
2003-07-31 21:55                   ` David Brownell
2003-07-31 22:05                     ` Benjamin Herrenschmidt
2003-07-31 22:09                       ` Pavel Machek
2003-07-31 23:12                         ` Oliver Neukum
2003-08-01  9:33                           ` Pavel Machek
2003-07-31 22:03                   ` Pavel Machek
2003-08-01  0:27                     ` Benjamin Herrenschmidt
2003-08-04 19:25                       ` Pavel Machek
2003-08-01 18:20       ` Dominik Brugger
2003-07-29 13:16 ` [linux-usb-devel] " David Brownell
2003-07-31 14:18   ` Pavel Machek
2003-08-01 17:41     ` David Brownell
2003-08-07 22:35       ` Pavel Machek

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).