Skip to contentSkip to conversation

DISCUSSION Lukas Hejtmanek 3 participants 6 messages May 20, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

<[email protected]>, Greg KH <[email protected]>
Bcc:
Subject: Re: [Bug #10630] USB devices plugged into dock are not discoverred
until reload of ehci-hcd
Reply-To:
In-Reply-To: <[email protected]>
X-echelon: NSA, CIA, CI5, MI5, FBI, KGB, BIS, Plutonium, Bin Laden, bomb

Quoted 5 lines · Oliver Neukum
Quoted 2 lines

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?

Signature · 1 line
Lukáš Hejtmánek
#1 lore raw

Am Dienstag 20 Mai 2008 14:34:23 schrieb Lukas Hejtmanek:

Quoted 9 lines

<[email protected]>, Greg KH <[email protected]>
Bcc:
Subject: Re: [Bug #10630] USB devices plugged into dock are not discoverred
until reload of ehci-hcd
Reply-To:
In-Reply-To: <[email protected]>
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:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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

---

drivers/usb/host/ehci-hcd.c +6 -1
@@ -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]);
drivers/usb/core/hcd.c +2 -0
@@ -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
#2 lore raw

Re: [Bug #10630] USB devices plugged into dock are not discoverred until reload of ehci-hcd

Quoted 8 lines · Oliver Neukum
Quoted 3 lines
Quoted 1 line
Quoted 1 line

http://bugzilla.kernel.org/show_bug.cgi?id=10630

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.

Should I use USB_SUSPEND or not?

Signature · 1 line
Lukáš Hejtmánek
#3 lore raw

Re: [Bug #10630] USB devices plugged into dock are not discoverred until reload of ehci-hcd

Am Dienstag 20 Mai 2008 16:11:32 schrieb Lukas Hejtmanek:

Quoted 11 lines · Oliver Neukum
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

http://bugzilla.kernel.org/show_bug.cgi?id=10630

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.

Should I use USB_SUSPEND or not?

Yes, use USB_SUSPEND.

Regards
Oliver

maintainer
#4 lore raw

Re: your mail

In reply to Lukas Hejtmanek
Quoted 9 lines · Lukas Hejtmanek

<[email protected]>, Greg KH <[email protected]>
Bcc:
Subject: Re: [Bug #10630] USB devices plugged into dock are not discoverred
until reload of ehci-hcd
Reply-To:
In-Reply-To: <[email protected]>
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:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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

drivers/usb/host/ehci.h +2 -0
Index: 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 */
drivers/usb/host/ehci-hub.c +4 -2
Index: 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 */
#5 lore raw

Re: [Bug #10630] USB devices plugged into dock are not discoverred until reload of ehci-hcd

Quoted 10 lines · Alan Stern
Quoted 9 lines · Oliver Neukum
Quoted 5 lines
Quoted 2 lines

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?

Quoted 6 lines

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.

seems to be working, device is detected. Thanks. Please, push the patch.

Signature · 1 line
Lukáš Hejtmánek