Re: [Linux-usb-users] OHCI root_port_reset() deadly loop...

From: David Brownell
Date: Tue Oct 09 2007 - 15:00:02 EST


> Here is a proposed patch. I haven't tried running it, but it compiles
> okay.

Looks about right, too; thanks. Minor comments:

> --- usb-2.6.orig/drivers/usb/core/hcd.h
> +++ usb-2.6/drivers/usb/core/hcd.h
> @@ -470,5 +472,9 @@ static inline void usbmon_urb_complete(s
> : (in_interrupt () ? "in_interrupt" : "can sleep"))
>
>
> -#endif /* __KERNEL__ */
> +/* Mutual exclusion for EHCI CF initialization. This interferes with
> + * port reset on some companion controllers.
> + */
> +extern struct rw_semaphore ehci_cf_port_reset_rwsem;

You have two copies of that comment; I'd drop this one, and add a
better one around CF initialization.

What I'd have here is a comment that this symbol is exported ONLY
for use by the EHCI driver, trespassers will be violated, etc.


> --- usb-2.6.orig/drivers/usb/host/ehci-hcd.c
> +++ usb-2.6/drivers/usb/host/ehci-hcd.c
> @@ -646,9 +646,11 @@ static int ehci_run (struct usb_hcd *hcd
> * involved with the root hub. (Except where one is integrated,
> * and there's no companion controller unless maybe for USB OTG.)
> */
> + down_write(&ehci_cf_port_reset_rwsem);
> hcd->state = HC_STATE_RUNNING;
> ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
> ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
> + up_write(&ehci_cf_port_reset_rwsem);

That deserves a comment about how CF and companion port resets
don't mix well.

... assuming this does check out as the problem, which I expect
it will.

- Dave

>
> temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
> ehci_info (ehci,
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/