* Re:
2008-05-20 12:34 Lukas Hejtmanek
@ 2008-05-20 12:40 ` Oliver Neukum
2008-05-20 14:11 ` [Bug #10630] USB devices plugged into dock are not discoverred until reload of ehci-hcd Lukas Hejtmanek
2008-05-20 15:20 ` your mail Alan Stern
1 sibling, 1 reply; 6+ messages in thread
From: Oliver Neukum @ 2008-05-20 12:40 UTC (permalink / raw)
To: Lukas Hejtmanek
Cc: Rafael J. Wysocki, Linux Kernel Mailing List, stern, greg, linux-usb
Am Dienstag 20 Mai 2008 14:34:23 schrieb Lukas Hejtmanek:
> <stern@rowland.harvard.edu>, Greg KH <greg@kroah.com>
> Bcc:
> Subject: Re: [Bug #10630] USB devices plugged into dock are not discoverred
> until reload of ehci-hcd
> Reply-To:
> In-Reply-To: <200805201327.34678.oliver@neukum.org>
> X-echelon: NSA, CIA, CI5, MI5, FBI, KGB, BIS, Plutonium, Bin Laden, bomb
>
> On Tue, May 20, 2008 at 01:27:34PM +0200, Oliver Neukum wrote:
> > > done.
> > > http://bugzilla.kernel.org/show_bug.cgi?id=10630
> >
> > Aha. Thanks.
> > Please recompile without CONFIG_USB_SUSPEND
>
> Hm, without USB_SUSPEND it works. So what next, considered fixed or any
> further investigation is needed?
It is by no means fixed!
Now we find out what exactly doesn't work. Please apply this patch
and provide "dmesg -c" before you plug in the device and after that.
Regards
Oliver
---
--- linux-2.6.25/drivers/usb/host/ehci-hcd.c 2008-05-20 10:07:45.585199135 +0200
+++ alt/drivers/usb/host/ehci-hcd.c 2008-05-20 11:11:53.614580823 +0200
@@ -712,11 +712,15 @@ static irqreturn_t ehci_irq (struct usb_
unsigned i = HCS_N_PORTS (ehci->hcs_params);
pcd_status = status;
+ printk(KERN_ERR"Detected PCD bit set\n");
/* resume root hub? */
- if (!(ehci_readl(ehci, &ehci->regs->command) & CMD_RUN))
+ if (!(ehci_readl(ehci, &ehci->regs->command) & CMD_RUN)) {
+ printk(KERN_ERR"About to resume root hub due to PCD\n");
usb_hcd_resume_root_hub(hcd);
+ }
while (i--) {
+ printk(KERN_ERR"Checking motherboard port %d\n", i);
int pstatus = ehci_readl(ehci,
&ehci->regs->port_status [i]);
@@ -730,6 +734,7 @@ static irqreturn_t ehci_irq (struct usb_
* and make khubd collect PORT_STAT_C_SUSPEND to
* stop that signaling.
*/
+ printk(KERN_ERR"Starting timer for port %d\n", i);
ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
mod_timer(&hcd->rh_timer, ehci->reset_done[i]);
--- linux-2.6.25/drivers/usb/core/hcd.c 2008-05-20 10:07:45.583199804 +0200
+++ alt/drivers/usb/core/hcd.c 2008-05-20 11:12:23.506597140 +0200
@@ -589,6 +589,8 @@ void usb_hcd_poll_rh_status(struct usb_h
hcd->poll_pending = 1;
}
spin_unlock_irqrestore(&hcd_root_hub_lock, flags);
+ } else {
+ printk(KERN_ERR"hub_status_data() returned 0\n");
}
/* The USB 2.0 spec says 256 ms. This is close enough and won't
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: your mail
2008-05-20 12:34 Lukas Hejtmanek
2008-05-20 12:40 ` Oliver Neukum
@ 2008-05-20 15:20 ` Alan Stern
2008-05-20 16:11 ` [Bug #10630] USB devices plugged into dock are not discoverred until reload of ehci-hcd Lukas Hejtmanek
1 sibling, 1 reply; 6+ messages in thread
From: Alan Stern @ 2008-05-20 15:20 UTC (permalink / raw)
To: Lukas Hejtmanek
Cc: Oliver Neukum, Rafael J. Wysocki, Linux Kernel Mailing List,
greg, linux-usb
On Tue, 20 May 2008, Lukas Hejtmanek wrote:
> <stern@rowland.harvard.edu>, Greg KH <greg@kroah.com>
> Bcc:
> Subject: Re: [Bug #10630] USB devices plugged into dock are not discoverred
> until reload of ehci-hcd
> Reply-To:
> In-Reply-To: <200805201327.34678.oliver@neukum.org>
> X-echelon: NSA, CIA, CI5, MI5, FBI, KGB, BIS, Plutonium, Bin Laden, bomb
>
> On Tue, May 20, 2008 at 01:27:34PM +0200, Oliver Neukum wrote:
> > > done.
> > > http://bugzilla.kernel.org/show_bug.cgi?id=10630
> >
> > Aha. Thanks.
> > Please recompile without CONFIG_USB_SUSPEND
>
> Hm, without USB_SUSPEND it works. So what next, considered fixed or any
> further investigation is needed?
No further investigation is needed. I tried doing essentially the same
thing on my system and the same problem occurred.
It is caused by the way ehci-hcd "auto-clears" the port
change-suspend feature. This patch should fix the problem. Please
try it out and let us know if it works.
Alan Stern
Index: usb-2.6/drivers/usb/host/ehci.h
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci.h
+++ usb-2.6/drivers/usb/host/ehci.h
@@ -97,6 +97,8 @@ struct ehci_hcd { /* one per controlle
dedicated to the companion controller */
unsigned long owned_ports; /* which ports are
owned by the companion during a bus suspend */
+ unsigned long port_c_suspend; /* which ports have
+ the change-suspend feature turned on */
/* per-HC memory pools (could be per-bus, but ...) */
struct dma_pool *qh_pool; /* qh per active urb */
Index: usb-2.6/drivers/usb/host/ehci-hub.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci-hub.c
+++ usb-2.6/drivers/usb/host/ehci-hub.c
@@ -609,7 +609,7 @@ static int ehci_hub_control (
}
break;
case USB_PORT_FEAT_C_SUSPEND:
- /* we auto-clear this feature */
+ clear_bit(wIndex, &ehci->port_c_suspend);
break;
case USB_PORT_FEAT_POWER:
if (HCS_PPC (ehci->hcs_params))
@@ -688,7 +688,7 @@ static int ehci_hub_control (
/* resume completed? */
else if (time_after_eq(jiffies,
ehci->reset_done[wIndex])) {
- status |= 1 << USB_PORT_FEAT_C_SUSPEND;
+ set_bit(wIndex, &ehci->port_c_suspend);
ehci->reset_done[wIndex] = 0;
/* stop resume signaling */
@@ -765,6 +765,8 @@ static int ehci_hub_control (
status |= 1 << USB_PORT_FEAT_RESET;
if (temp & PORT_POWER)
status |= 1 << USB_PORT_FEAT_POWER;
+ if (test_bit(wIndex, &ehci->port_c_suspend))
+ status |= 1 << USB_PORT_FEAT_C_SUSPEND;
#ifndef VERBOSE_DEBUG
if (status & ~0xffff) /* only if wPortChange is interesting */
^ permalink raw reply [flat|nested] 6+ messages in thread