2008-06-26 15:38:27

by Lukas Hejtmanek

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

Hello,

I have another USB problem with Lenovo T61 Thinkpad.

I'm using kernel 2.6.26-rc8. I do use CONFIG_USB_SUSPEND.

If I attach USB disk (using EHCI driver), the disk is found and it is working.
If I remove the disk, undock the laptop, dock the laptop again and plug the
disk, the disk is not found at all until I remove and reinsert the EHCI
driver.

I noticed that if I do not unplug the disk berofe undocking, it works after
docking back.

If I undock with the disk removed, dmesg looks like this:
[85164.642906] usb 3-4.3: USB disconnect, address 5
[85171.901891] ACPI: \_SB_.GDCK - undocking
[85175.116094] eth0: Link is Down
[85183.063339] ACPI: \_SB_.GDCK - docking
[85185.238221] eth0: Link is Up 1000 Mbps Full Duplex, Flow Control: None

nothing more past the eth0 message.

If I undock with the disk plugged in, dmesg looks like this:
[85407.425050] ACPI: \_SB_.GDCK - undocking
[85407.453467] usb 3-4: USB disconnect, address 3
[85407.453478] usb 3-4.3: USB disconnect, address 4
[85410.870520] eth0: Link is Down
[85420.340005] ACPI: \_SB_.GDCK - docking
[85420.829661] usb 3-4: new high speed USB device using ehci_hcd and address 5
[85420.952520] usb 3-4: configuration #1 chosen from 1 choice
[85420.960006] hub 3-4:1.0: USB hub found
[85420.960006] hub 3-4:1.0: 4 ports detected
[85421.066577] usb 3-4: New USB device found, idVendor=04b3, idProduct=4485
[85421.066583] usb 3-4: New USB device strings: Mfr=0, Product=0,
SerialNumber=0
[85422.540557] eth0: Link is Up 1000 Mbps Full Duplex, Flow Control: None
[85426.366908] usb 3-4.3: new high speed USB device using ehci_hcd and address
6
[85426.465420] usb 3-4.3: configuration #1 chosen from 1 choice
[85426.485951] scsi9 : SCSI emulation for USB Mass Storage devices
[85426.485966] usb-storage: device found at 6
[85426.485966] usb-storage: waiting for device to settle before scanning
[85426.487217] usb 3-4.3: New USB device found, idVendor=152d, idProduct=2338
[85426.487217] usb 3-4.3: New USB device strings: Mfr=1, Product=2,
SerialNumber=5
[85426.487217] usb 3-4.3: Product: USB to ATA/ATAPI Bridge
[85426.487217] usb 3-4.3: Manufacturer: JMicron
[85426.487217] usb 3-4.3: SerialNumber: 222291142391
[85431.482899] usb-storage: device scan complete


any ideas?

--
Luk?? Hejtm?nek


2008-06-26 15:52:38

by Alan Stern

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

On Thu, 26 Jun 2008, Lukas Hejtmanek wrote:

> Hello,
>
> I have another USB problem with Lenovo T61 Thinkpad.
>
> I'm using kernel 2.6.26-rc8. I do use CONFIG_USB_SUSPEND.
>
> If I attach USB disk (using EHCI driver), the disk is found and it is working.
> If I remove the disk, undock the laptop, dock the laptop again and plug the
> disk, the disk is not found at all until I remove and reinsert the EHCI
> driver.
>
> I noticed that if I do not unplug the disk berofe undocking, it works after
> docking back.

What happens if instead of reloading ehci-hcd, you unplug and replug
the disk?

What happens if you undock with the disk plugged in, then unplug the
disk, then dock the laptop, and then plug in the disk?

> any ideas?

What does usbmon reveal when you dock the laptop again and then plug in
the disk (see Documentation/usb/usbmon.txt)?

Can you provide a comparable usbmon log for 2.6.25?

Did the problem go away at any time between 2.6.26-rc1 and -rc8?

Alan Stern

2008-06-27 09:17:38

by Lukas Hejtmanek

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

On Thu, Jun 26, 2008 at 11:52:25AM -0400, Alan Stern wrote:
> What happens if instead of reloading ehci-hcd, you unplug and replug
> the disk?

nothing, disk is not discovered.

> What happens if you undock with the disk plugged in, then unplug the
> disk, then dock the laptop, and then plug in the disk?

in such a case the disk is discovered.

If I keep the disk in while unplugging, the dmesg says:
[ 294.164161] ACPI: \_SB_.GDCK - undocking
[ 294.201826] usb 3-4: USB disconnect, address 3
[ 294.201838] usb 3-4.3: USB disconnect, address 4
[ 296.043225] eth0: Link is Down
[ 304.910671] ACPI: \_SB_.GDCK - docking
[ 305.421422] usb 3-4: new high speed USB device using ehci_hcd and address 5
[ 305.544580] usb 3-4: configuration #1 chosen from 1 choice
[ 305.544650] hub 3-4:1.0: USB hub found
[ 305.544796] hub 3-4:1.0: 4 ports detected
[ 305.649110] usb 3-4: New USB device found, idVendor=04b3, idProduct=4485
[ 305.649124] usb 3-4: New USB device strings: Mfr=0, Product=0,
SerialNumber=0
[ 307.185419] eth0: Link is Up 1000 Mbps Full Duplex, Flow Control: None

here I plugged the disk back.

[ 337.620406] usb 3-4.3: new high speed USB device using ehci_hcd and address
6
[ 337.717179] usb 3-4.3: configuration #1 chosen from 1 choice
[ 337.727173] scsi6 : SCSI emulation for USB Mass Storage devices
[ 337.740353] usb-storage: device found at 6
[ 337.740353] usb-storage: waiting for device to settle before scanning
[ 337.740353] usb 3-4.3: New USB device found, idVendor=152d, idProduct=2338
[ 337.740353] usb 3-4.3: New USB device strings: Mfr=1, Product=2,
SerialNumber=5
[ 337.740377] usb 3-4.3: Product: USB to ATA/ATAPI Bridge
[ 337.740380] usb 3-4.3: Manufacturer: JMicron
[ 337.740384] usb 3-4.3: SerialNumber: 222291142391


If I unplug the disk first, there are no messages about USB hub just after
ACPI docking message.

> What does usbmon reveal when you dock the laptop again and then plug in
> the disk (see Documentation/usb/usbmon.txt)?

attached as 1-26.mon.out (2.6.26-rc8)

> Can you provide a comparable usbmon log for 2.6.25?

attached as 1-25.mon.out

> Did the problem go away at any time between 2.6.26-rc1 and -rc8?

If I remember correctly, in 2.6.26-rc2 you fixed it as I reported the problem.
2.6.26-rc5 does not work (behaviour is the same as rc8). The others, I do not
know. If it is really useful, I could try it but I do not have those kernels.

--
Luk?? Hejtm?nek


Attachments:
(No filename) (2.38 kB)
1-25.mon.out (27.05 kB)
1-26.mon.out (3.56 kB)
Download all attachments

2008-06-27 20:36:17

by Alan Stern

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

On Fri, 27 Jun 2008, Lukas Hejtmanek wrote:

> > What does usbmon reveal when you dock the laptop again and then plug in
> > the disk (see Documentation/usb/usbmon.txt)?
>
> attached as 1-26.mon.out (2.6.26-rc8)
>
> > Can you provide a comparable usbmon log for 2.6.25?
>
> attached as 1-25.mon.out

This is very confusing. It appears that the two usbmon logs don't show
the same actions on your part.

Let's try to keep this as simple as possible. We'll consider a single
fixed course of action:

Make sure the disk isn't mounted and isn't in use.

Start collecting the usbmon log.

Remove the disk.

Wait at least 10 seconds.

Undock the laptop.

Wait at least 10 seconds.

Dock the laptop again.

Wait at least 10 seconds.

Plug in the disk.

Stop the usbmon log.

(The reason for those 10-second delays is because the USB stack will
automatically suspend an idle hub after a few seconds of inactivity.)

Do exactly the same thing under both operating system versions, and
then we should have suitably comparable logs.

Alan Stern

2008-06-27 20:43:37

by Alan Stern

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

On Fri, 27 Jun 2008, Alan Stern wrote:

> This is very confusing. It appears that the two usbmon logs don't show
> the same actions on your part.
>
> Let's try to keep this as simple as possible. We'll consider a single
> fixed course of action:
...
> Do exactly the same thing under both operating system versions, and
> then we should have suitably comparable logs.

I forgot to mention that you should run these tests under kernels that
were built with CONFIG_USB_DEBUG enabled, and you should post the two
dmesg logs along with the usbmon logs.

Alan Stern

2008-06-30 12:26:50

by Lukas Hejtmanek

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

On Fri, Jun 27, 2008 at 04:35:59PM -0400, Alan Stern wrote:
> Do exactly the same thing under both operating system versions, and
> then we should have suitably comparable logs.

all you wanted is attached including dmesgs.

--
Luk?? Hejtm?nek


Attachments:
(No filename) (246.00 B)
usb-25.mon.out.bz2 (4.25 kB)
usb-26.mon.out.bz2 (543.00 B)
dmesg-25.log.bz2 (14.45 kB)
dmesg-26.log.bz2 (13.37 kB)
Download all attachments

2008-06-30 17:21:26

by Alan Stern

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

On Mon, 30 Jun 2008, Lukas Hejtmanek wrote:

> On Fri, Jun 27, 2008 at 04:35:59PM -0400, Alan Stern wrote:
> > Do exactly the same thing under both operating system versions, and
> > then we should have suitably comparable logs.
>
> all you wanted is attached including dmesgs.

Ah, good. I see the problem now.

To tell the truth, this has been fixed in the development tree for so
long that I had forgotten about it. Unfortunately those fixes won't
get into the regular kernel until 2.6.27. Until then we need another
fix.

The patch below should take care of the problem. Let me know how it
works.

Alan Stern



Index: 2.6.26-rc8/drivers/usb/core/hub.c
===================================================================
--- 2.6.26-rc8.orig/drivers/usb/core/hub.c
+++ 2.6.26-rc8/drivers/usb/core/hub.c
@@ -713,18 +713,11 @@ static void hub_restart(struct usb_hub *
}

/* Was the power session lost while we were suspended? */
- switch (type) {
- case HUB_RESET_RESUME:
- portstatus = 0;
- portchange = USB_PORT_STAT_C_CONNECTION;
- break;
+ status = hub_port_status(hub, port1, &portstatus, &portchange);

- case HUB_RESET:
- case HUB_RESUME:
- status = hub_port_status(hub, port1,
- &portstatus, &portchange);
- break;
- }
+ /* If the device is gone, khubd will handle it later */
+ if (status == 0 && !(portstatus & USB_PORT_STAT_CONNECTION))
+ continue;

/* For "USB_PERSIST"-enabled children we must
* mark the child device for reset-resume and

2008-07-01 11:22:49

by Lukas Hejtmanek

[permalink] [raw]
Subject: Re: 2.6.26-rc1 regression since 2.6.25 - problem in 2.6.26-rc8 again

On Mon, Jun 30, 2008 at 01:21:00PM -0400, Alan Stern wrote:
> Ah, good. I see the problem now.
>
> To tell the truth, this has been fixed in the development tree for so
> long that I had forgotten about it. Unfortunately those fixes won't
> get into the regular kernel until 2.6.27. Until then we need another
> fix.
>
> The patch below should take care of the problem. Let me know how it
> works.

seems to be OK. Please push..

--
Luk?? Hejtm?nek