<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.604   -&gt; 1.604.1.1
#	drivers/usb/host/ohci-hcd.c	1.17    -&gt; 1.18   
#	drivers/usb/host/ohci-dbg.c	1.6     -&gt; 1.7    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/06/21	david-b@pacbell.net	1.604.1.1
# [PATCH] ohci-hcd cardbus unplug
# 
# This is the 2.5 version of that 2.4 patch I sent recently,
# which makes the OHCI driver behave usably on at least
# some cardbus systems when the card is just ejected without
# a clean shutdown.
# --------------------------------------------
#
diff -Nru a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
--- a/drivers/usb/host/ohci-dbg.c	Fri Jul  5 14:51:29 2002
+++ b/drivers/usb/host/ohci-dbg.c	Fri Jul  5 14:51:29 2002
@@ -190,6 +190,8 @@
 	__u32			temp, ndp, i;
 
 	temp = roothub_a (controller);
+	if (temp == ~(u32)0)
+		return;
 	ndp = (temp &amp; RH_A_NDP);
 
 	if (verbose) {
diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
--- a/drivers/usb/host/ohci-hcd.c	Fri Jul  5 14:51:29 2002
+++ b/drivers/usb/host/ohci-hcd.c	Fri Jul  5 14:51:29 2002
@@ -502,10 +502,18 @@
 	if ((ohci-&gt;hcca-&gt;done_head != 0)
 			&amp;&amp; ! (le32_to_cpup (&amp;ohci-&gt;hcca-&gt;done_head) &amp; 0x01)) {
 		ints =  OHCI_INTR_WDH;
-	} else if ((ints = (readl (&amp;regs-&gt;intrstatus)
-			&amp; readl (&amp;regs-&gt;intrenable))) == 0) {
+
+	/* cardbus/... hardware gone before remove() */
+	} else if ((ints = readl (&amp;regs-&gt;intrstatus)) == ~(u32)0) {
+		ohci-&gt;disabled++;
+		err ("%s device removed!", hcd-&gt;self.bus_name);
+		return;
+
+	/* interrupt for some other device? */
+	} else if ((ints &amp;= readl (&amp;regs-&gt;intrenable)) == 0) {
 		return;
 	} 
+
 
 	// dbg ("Interrupt: %x frame: %x", ints, le16_to_cpu (ohci-&gt;hcca-&gt;frame_no));
 
</pre></body></html>