Commit fd4a6fd1 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[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.
parent 2ffe5f2f
...@@ -190,6 +190,8 @@ static void ohci_dump_roothub (struct ohci_hcd *controller, int verbose) ...@@ -190,6 +190,8 @@ static void ohci_dump_roothub (struct ohci_hcd *controller, int verbose)
__u32 temp, ndp, i; __u32 temp, ndp, i;
temp = roothub_a (controller); temp = roothub_a (controller);
if (temp == ~(u32)0)
return;
ndp = (temp & RH_A_NDP); ndp = (temp & RH_A_NDP);
if (verbose) { if (verbose) {
......
...@@ -502,11 +502,19 @@ static void ohci_irq (struct usb_hcd *hcd) ...@@ -502,11 +502,19 @@ static void ohci_irq (struct usb_hcd *hcd)
if ((ohci->hcca->done_head != 0) if ((ohci->hcca->done_head != 0)
&& ! (le32_to_cpup (&ohci->hcca->done_head) & 0x01)) { && ! (le32_to_cpup (&ohci->hcca->done_head) & 0x01)) {
ints = OHCI_INTR_WDH; ints = OHCI_INTR_WDH;
} else if ((ints = (readl (&regs->intrstatus)
& readl (&regs->intrenable))) == 0) { /* cardbus/... hardware gone before remove() */
} else if ((ints = readl (&regs->intrstatus)) == ~(u32)0) {
ohci->disabled++;
err ("%s device removed!", hcd->self.bus_name);
return;
/* interrupt for some other device? */
} else if ((ints &= readl (&regs->intrenable)) == 0) {
return; return;
} }
// dbg ("Interrupt: %x frame: %x", ints, le16_to_cpu (ohci->hcca->frame_no)); // dbg ("Interrupt: %x frame: %x", ints, le16_to_cpu (ohci->hcca->frame_no));
if (ints & OHCI_INTR_UE) { if (ints & OHCI_INTR_UE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment