Skip to contentSkip to conversation

xHCI not waking up from D3 after S3 Resume on Ivybridge

DISCUSSION Tom Goetz 4 participants 13 messages Mar 15, 2012 – Mar 26, 2012 15 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Tom Goetz

author
#6 lore raw
In reply to a message not in the archive
Quoted 18 lines · Tom Goetz
Quoted 15 lines · Tom Goetz
Quoted 12 lines · Sarah Sharp
Quoted 10 lines · Tom Goetz
Quoted 4 lines

Why were you posting there in particular? You're much more likely to get your USB questions answered on this mailing list. :)

I'm concerned that this may be a bug in the Xen PVOPs MSI code. To that end I've posted updates on xen-devel here:

http://lists.xen.org/archives/html/xen-devel/2012-03/msg00904.html
http://lists.xen.org/archives/html/xen-devel/2012-03/msg00727.html
http://lists.xen.org/archives/html/xen-devel/2012-03/msg00978.html

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Does the xHCI host work fine without Xen? I.e. running Linux directly as the host OS, suspending, resuming, and then plugging in a device?

It works in Ubuntu 12.04 Beta 1 with Linux 3.2.0. So it's either broken between 3.2.0 and 3.2.5 or it's broken in Xen. I haven't made a direct comparison yet. I'm putting Ubuntu on my SDP now to test that.

xHCI wakes up from D3 on the SDP with Ubuntu 12.04 Beta 1 and 3.2.11. This fails with the same 3.2.11 kernel and Xen. So the problem is Xen related.

Another update.

On the Ivybridge laptop, xHCI is not waking up because when I plug a device into a xHCI port the ACPI wakeup events are going to the e1000e. Pre S3, it eventually gets a interrupt from the device that wakes it up. Post S3 it never gets an interrupt from the device.

On the SDP, I get ACPI wake up calls for the xHCI before S3, but not after. Both cases work with out Xen. I'm assuming Xen/PVOPs is leaving the device in a state the causes the ACPI wake up events to be masked. Can you tell me what what state that could be? I can look at decompiling the ASL to find out, but that's not my first choice. Toggling the power policy (auto->on->auto) does not fix delivery of ACPI wake up events for this device. I am still getting ACPI wake ups for the e1000e, so it's not all wake ups that are blocked.

Thanks for any help.

-Tom

#8 lore raw
In reply to a message not in the archive

Cross posting to the linux-acpi and linux-pci list for help.

Summary: After an Ivy Bridge laptop is resumed from S3 and the USB 3.0 host controller is in D3, under Xen, the host controller will never come out of D3 to report a USB device connection. The same laptop with a standard Ubuntu install with the same 3.2.11 kernel works fine.

I'm not sure what to make of the ACPI details about wakeup events being routed to e1000e instead of the xHCI host. Can someone help out here?

Quoted 49 lines · Tom Goetz
Quoted 18 lines · Tom Goetz
Quoted 17 lines · Tom Goetz
Quoted 15 lines · Sarah Sharp
Quoted 10 lines · Tom Goetz
Quoted 3 lines

Why were you posting there in particular? You're much more likely to get your USB questions answered on this mailing list. :)

I'm concerned that this may be a bug in the Xen PVOPs MSI code. To that end I've posted updates on xen-devel here:

http://lists.xen.org/archives/html/xen-devel/2012-03/msg00904.html
http://lists.xen.org/archives/html/xen-devel/2012-03/msg00727.html
http://lists.xen.org/archives/html/xen-devel/2012-03/msg00978.html

Does the xHCI host work fine without Xen? I.e. running Linux directly as the host OS, suspending, resuming, and then plugging in a device?

Quoted 8 lines
Quoted 4 lines

It works in Ubuntu 12.04 Beta 1 with Linux 3.2.0. So it's either broken between 3.2.0 and 3.2.5 or it's broken in Xen. I haven't made a direct comparison yet. I'm putting Ubuntu on my SDP now to test that.

xHCI wakes up from D3 on the SDP with Ubuntu 12.04 Beta 1 and 3.2.11. This fails with the same 3.2.11 kernel and Xen. So the problem is Xen related.

Another update.

On the Ivybridge laptop, xHCI is not waking up because when I plug a device into a xHCI port the ACPI wakeup events are going to the e1000e. Pre S3, it eventually gets a interrupt from the device that wakes it up. Post S3 it never gets an interrupt from the device.

On the SDP, I get ACPI wake up calls for the xHCI before S3, but not after. Both cases work with out Xen. I'm assuming Xen/PVOPs is leaving the device in a state the causes the ACPI wake up events to be masked. Can you tell me what what state that could be? I can look at decompiling the ASL to find out, but that's not my first choice. Toggling the power policy (auto->on->auto) does not fix delivery of ACPI wake up events for this device. I am still getting ACPI wake ups for the e1000e, so it's not all wake ups that are blocked.

Thanks for any help.

-Tom-- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
In reply to a message not in the archive

Cross posting to the linux-acpi and linux-pci list for help.

Summary: After an Ivy Bridge laptop is resumed from S3 and the USB 3.0 host controller is in D3, under Xen, the host controller will never come out of D3 to report a USB device connection. The same laptop with a standard Ubuntu install with the same 3.2.11 kernel works fine.

I'm not sure what to make of the ACPI details about wakeup events being routed to e1000e instead of the xHCI host. Can someone help out here?

Quoted 49 lines · Tom Goetz
Quoted 18 lines · Tom Goetz
Quoted 17 lines · Tom Goetz
Quoted 15 lines · Sarah Sharp
Quoted 10 lines · Tom Goetz
Quoted 3 lines

Why were you posting there in particular? You're much more likely to get your USB questions answered on this mailing list. :)

I'm concerned that this may be a bug in the Xen PVOPs MSI code. To that end I've posted updates on xen-devel here:

http://lists.xen.org/archives/html/xen-devel/2012-03/msg00904.html
http://lists.xen.org/archives/html/xen-devel/2012-03/msg00727.html
http://lists.xen.org/archives/html/xen-devel/2012-03/msg00978.html

Does the xHCI host work fine without Xen? I.e. running Linux directly as the host OS, suspending, resuming, and then plugging in a device?

Quoted 8 lines
Quoted 4 lines

It works in Ubuntu 12.04 Beta 1 with Linux 3.2.0. So it's either broken between 3.2.0 and 3.2.5 or it's broken in Xen. I haven't made a direct comparison yet. I'm putting Ubuntu on my SDP now to test that.

xHCI wakes up from D3 on the SDP with Ubuntu 12.04 Beta 1 and 3.2.11. This fails with the same 3.2.11 kernel and Xen. So the problem is Xen related.

Another update.

On the Ivybridge laptop, xHCI is not waking up because when I plug a device into a xHCI port the ACPI wakeup events are going to the e1000e. Pre S3, it eventually gets a interrupt from the device that wakes it up. Post S3 it never gets an interrupt from the device.

On the SDP, I get ACPI wake up calls for the xHCI before S3, but not after. Both cases work with out Xen. I'm assuming Xen/PVOPs is leaving the device in a state the causes the ACPI wake up events to be masked. Can you tell me what what state that could be? I can look at decompiling the ASL to find out, but that's not my first choice. Toggling the power policy (auto->on->auto) does not fix delivery of ACPI wake up events for this device. I am still getting ACPI wake ups for the e1000e, so it's not all wake ups that are blocked.

Thanks for any help.

-Tom-- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw
In reply to a message not in the archive
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Does the xHCI host work fine without Xen?  I.e. running Linux directly as the host OS, suspending, resuming, and then plugging in a device?

It works in Ubuntu 12.04 Beta 1 with Linux 3.2.0. So it's either broken between 3.2.0 and 3.2.5 or it's broken in Xen. I haven't made a direct comparison yet. I'm putting Ubuntu on my SDP now to test that.

Quoted 7 lines
Quoted 1 line

xHCI wakes up from D3 on the SDP with Ubuntu 12.04 Beta 1 and 3.2.11. This fails with the same 3.2.11 kernel and Xen. So the problem is Xen related.

Another update.

On the Ivybridge laptop, xHCI is not waking up because when I plug a device into a xHCI port the ACPI wakeup events are going to the e1000e. Pre S3, it eventually gets a interrupt from the device that wakes it up. Post S3 it never gets an interrupt from the device.

So these are all MSI related issues right. The e1000e is also MSI? In other words the issues you are having is that the MSI after resume are not delivered - but some are ?

If you print out the MSI vector table (from xen) before and resume are the vectors the same? Is there a pending bit set on the one that are not woken up?

Quoted 11 lines

On the SDP, I get ACPI wake up calls for the xHCI before S3, but not after. Both cases work with out Xen. I'm assuming Xen/PVOPs is leaving the device in a state the causes the ACPI wake up events to be masked. Can you tell me what what state that could be? I can look at decompiling the ASL to find out, but that's not my first choice. Toggling the power policy (auto->on->auto) does not fix delivery of ACPI wake up events for this device. I am still getting ACPI wake ups for the e1000e, so it's not all wake ups that are blocked.

Thanks for any help.

-Tom
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#12 lore raw
In reply to a message not in the archive
Quoted 10 lines · Konrad Rzeszutek Wilk
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Does the xHCI host work fine without Xen? I.e. running Linux directly as the host OS, suspending, resuming, and then plugging in a device?

It works in Ubuntu 12.04 Beta 1 with Linux 3.2.0. So it's either broken between 3.2.0 and 3.2.5 or it's broken in Xen. I haven't made a direct comparison yet. I'm putting Ubuntu on my SDP now to test that.

xHCI wakes up from D3 on the SDP with Ubuntu 12.04 Beta 1 and 3.2.11. This fails with the same 3.2.11 kernel and Xen. So the problem is Xen related.

Quoted 5 lines
Quoted 3 lines

Another update.

On the Ivybridge laptop, xHCI is not waking up because when I plug a device into a xHCI port the ACPI wakeup events are going to the e1000e. Pre S3, it eventually gets a interrupt from the device that wakes it up. Post S3 it never gets an interrupt from the device.

So these are all MSI related issues right.

Maybe.

Quoted 1 line

The e1000e is also MSI?

Yes. The e1000e getting the xHCI's wake ups is only on one machine. I assume thats a BIOS bug. The broad based issue is that on two manufacturers Ivybridge plus an Intel SDP Ivybridge, xHCI will not wake up from D3 when a USB device is plugged in.

Quoted 3 lines

In
other words the issues you are having is that the MSI after resume are not delivered - but some are ?

Only D3 wake ups (ACPI and PME) are not being delivered. If I change the runtime power policy for the device from "auto" to "on" xHCI works fine.

Quoted 3 lines

If you print out the MSI vector table (from xen) before and resume are the vectors the same?

No.

< (XEN)    IRQ:  24 affinity:00000000,00000000,00000000,00000001 vec:c8 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:279(----),
< (XEN)    IRQ:  25 affinity:00000000,00000000,00000000,00000001 vec:61 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:278(----),

---

Quoted 2 lines
(XEN)    IRQ:  24 affinity:00000000,00000000,00000000,00000001 vec:69 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:279(----),
(XEN)    IRQ:  25 affinity:00000000,00000000,00000000,00000001 vec:71 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:278(----),

29,30c29,30

< (XEN)    IRQ:  28 affinity:00000000,00000000,00000000,00000001 vec:39 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:275(----),
< (XEN)    IRQ:  29 affinity:00000000,00000000,00000000,00000001 vec:41 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:274(----),

---

Quoted 6 lines
(XEN)    IRQ:  28 affinity:00000000,00000000,00000000,00000001 vec:79 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:275(----),
(XEN)    IRQ:  29 affinity:00000000,00000000,00000000,00000001 vec:91 type=PCI-MSI         status=00000010 in-flight=0 domain-list=0:274(----),

Is there a pending bit set on the one that are
not woken up?

No

The thing that confuses it for me is that the device works fine outside of D3. If the MSI was routed incorrectly after S3, then why does it work outside of D3 resume?

#14 lore raw
In reply to a message not in the archive

Am Montag, 19. März 2012, 14:32:01 schrieb Tom Goetz:

Quoted 10 lines
Quoted 1 line

The e1000e is also MSI?

Yes. The e1000e getting the xHCI's wake ups is only on one machine. I assume thats a BIOS bug. The broad based issue is that on two manufacturers Ivybridge plus an Intel SDP Ivybridge, xHCI will not wake up from D3 when a USB device is plugged in.

Quoted 3 lines

In
other words the issues you are having is that the MSI after resume are not delivered - but some are ?

Only D3 wake ups (ACPI and PME) are not being delivered. If I change the runtime power policy for the device from "auto" to "on" xHCI works fine.

This indicates that xhci is not turned into a sources for wakeups because the device is already asleep and suspend() won't be called twice.

Does it work if you suspend with a device for which autosuspend isn't on?

Regards
Oliver

author
#16 lore raw
In reply to a message not in the archive
Quoted 9 lines · Oliver Neukum

Am Montag, 19. März 2012, 14:32:01 schrieb Tom Goetz:

Quoted 8 lines
Quoted 1 line

The e1000e is also MSI?

Yes. The e1000e getting the xHCI's wake ups is only on one machine. I assume thats a BIOS bug. The broad based issue is that on two manufacturers Ivybridge plus an Intel SDP Ivybridge, xHCI will not wake up from D3 when a USB device is plugged in.

Quoted 3 lines

In
other words the issues you are having is that the MSI after resume are not delivered - but some are ?

Quoted 6 lines
Quoted 2 lines

Only D3 wake ups (ACPI and PME) are not being delivered. If I change the runtime power policy for the device from "auto" to "on" xHCI works fine.

This indicates that xhci is not turned into a sources for wakeups because the device is already asleep and suspend() won't be called twice.

Why would that be the case? The device was successfully set up after the machine returned from S3. It subsequently went into D3. If you wake it up by setting the power policy to "on", it works. Set it back to "auto" and it goes back to sleep and still won't wake.

Quoted 2 lines

Does it work if you suspend with a device for which autosuspend isn't on?

Do you mean if I S3 suspend with power policy "on"? The power policy when it goes into S3 doesn't matter. It setting the policy to "auto" after resuming from S3 that is the issue. I'm testing this on a Intel SDP with the following steps:

1. S3 suspend
2. S3 resume
3. Set xHCI policy to "auto"
4. plug USB stick into xHCI
5. xHCI doesn't wake up.

That's my current way of reproducing it, but the bug originated because laptops lost xHCI if they resumed on battery.

author
#17 lore raw
In reply to a message not in the archive
Quoted 17 lines · Tom Goetz
Quoted 14 lines · Konrad Rzeszutek Wilk
Quoted 13 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Does the xHCI host work fine without Xen? I.e. running Linux directly as the host OS, suspending, resuming, and then plugging in a device?

It works in Ubuntu 12.04 Beta 1 with Linux 3.2.0. So it's either broken between 3.2.0 and 3.2.5 or it's broken in Xen. I haven't made a direct comparison yet. I'm putting Ubuntu on my SDP now to test that.

xHCI wakes up from D3 on the SDP with Ubuntu 12.04 Beta 1 and 3.2.11. This fails with the same 3.2.11 kernel and Xen. So the problem is Xen related.

Another update.

On the Ivybridge laptop, xHCI is not waking up because when I plug a device into a xHCI port the ACPI wakeup events are going to the e1000e. Pre S3, it eventually gets a interrupt from the device that wakes it up. Post S3 it never gets an interrupt from the device.

Quoted 7 lines
Quoted 1 line

So these are all MSI related issues right.

Maybe.

Quoted 1 line

The e1000e is also MSI?

Yes. The e1000e getting the xHCI's wake ups is only on one machine. I assume thats a BIOS bug. The broad based issue is that on two manufacturers Ivybridge plus an Intel SDP Ivybridge, xHCI will not wake up from D3 when a USB device is plugged in.

I've just found that if the xHCI is in D3, has a USB device plugged in, and is not waking up, it will wake up when another device in D3 wakes up. Here's the steps I followed:

1. S3 suspend
2. S3 Resume
3. set xHCI power policy to "auto"
4. xHCI goes into D3
5. Plug USB device into xHCI
6. xHCI does not wake up
7. set e1000e power policy to "auto"
8. Unplug ethernet cable
9. e100e goes into D3
10. Plug in ethernet cable
11. Both e1000e and xHCI wake up.

In this case, xHCI wakes from a ACPI event. Trace below:

Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029015] pci_acpi_wake_dev[48] 0000:00:1d.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029019] pci_acpi_wake_dev[53] 0000:00:1d.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029027] rpm_resume[512] 0000:00:1d.0 before
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029031] pci_acpi_wake_dev[48] 0000:00:1a.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029033] pci_acpi_wake_dev[53] 0000:00:1a.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029039] rpm_resume[512] 0000:00:1a.0 before
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029042] pci_acpi_wake_dev[48] 0000:00:1b.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029044] pci_acpi_wake_dev[53] 0000:00:1b.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029049] rpm_resume[512] 0000:00:1b.0 before
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029052] pci_acpi_wake_dev[48] 0000:00:19.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029054] pci_acpi_wake_dev[53] 0000:00:19.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029063] rpm_resume[512] 0000:00:19.0 before
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.029066] pci_pm_runtime_resume[1047] 0000:00:19.0 before
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045804] e1000e 0000:00:19.0: BAR 0: set to [mem 0xb0600000-0xb061ffff] (PCI address [0xb0600000-0xb061ffff])
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045815] e1000e 0000:00:19.0: BAR 1: set to [mem 0xb0650000-0xb0650fff] (PCI address [0xb0650000-0xb0650fff])
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045824] e1000e 0000:00:19.0: BAR 2: set to [io  0x3080-0x309f] (PCI address [0x3080-0x309f])
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045854] e1000e 0000:00:19.0: restoring config space at offset 0xf (was 0x100, writing 0x105)
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045899] e1000e 0000:00:19.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045931] acpi_dev_run_wake[293]
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045939] acpi_pci_run_wake[340] 0000:00:19.0 acpi_dev_run_wake
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045948] e1000e 0000:00:19.0: PME# disabled polled 0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.045951] pci_pm_runtime_resume[1055] 0000:00:19.0 after
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046022] pci_enable_msi_block[699] 0000:00:19.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046039] pci_enable_msi_block[703] 0000:00:19.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046044] pci_enable_msi_block[709] 0000:00:19.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046059] pci_enable_msi_block[716] 0000:00:19.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046061] pci_enable_msi_block[724] 0000:00:19.0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046118] xen_bind_pirq_msi_to_irq[737] irq 303
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046143] bind_evtchn_to_cpu[304] evtchn 38 cpu 0
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046145] __startup_pirq[564] irq 303 ec 38
Mar 19 15:42:25 2012-Client-Platform kernel: [ 8648.046149] bind_evtchn_to_cpu[304] evtchn 38 cpu 0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206492] rpm_idle[206] 0000:00:19.0 before
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206496] __pm_runtime_idle[812] pci0000:00 RPM_GET_PUT 0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206498] rpm_idle[206] pci0000:00 before
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206501] rpm_check_suspend_allowed[139] pci0000:00 depth
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206503] rpm_idle[210] pci0000:00 !conditions
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206506] pm_runtime_work[709] 0000:00:19.0 RPM_REQ_IDLE
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206508] rpm_idle[206] 0000:00:19.0 before
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206511] pci_pm_runtime_idle[1064] 0000:00:19.0 before
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206515] pci_acpi_wake_dev[48] 0000:00:14.0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206517] pci_acpi_wake_dev[53] 0000:00:14.0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206525] rpm_resume[512] 0000:00:14.0 before
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.206527] pci_pm_runtime_resume[1047] 0000:00:14.0 before
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226027] acpi_dev_run_wake[293]
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226041] acpi_pci_run_wake[340] 0000:00:14.0 acpi_dev_run_wake
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226050] xhci_hcd 0000:00:14.0: PME# disabled polled 0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226052] pci_pm_runtime_resume[1055] 0000:00:14.0 after
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226058] __pci_enable_device_flags[1129] 0000:00:14.0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226060] __pci_enable_device_flags[1133] 0000:00:14.0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226066] __pci_enable_device_flags[1145] 0000:00:14.0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226068] pci_set_master[2621] 0000:00:14.0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226070] __pci_set_master[2594] 0000:00:14.0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226076] pci_bus_write_config_word[65] a0:4 op ffffffff8149ad20
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226078] pci_write[70] 4 : 2
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226083] __pci_set_master[2607] 0000:00:14.0 enabling pci_write_config_word ret 0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226088] xhci_hcd 0000:00:14.0: setting latency timer to 64
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226136] usb_hcd_resume_root_hub[2079] xHCI Host Controller
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226138] ------------[ cut here ]------------
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226145] WARNING: at /home/likewise-open/ORC/tgoetz/sandbox/orc-precise/linux-3.2/drivers/usb/core/hcd.c:2080 usb_hcd_resume_root_hub+0x4f/0xa0()
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226149] Hardware name: 2012 Client Platform
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226150] Modules linked in: nls_iso8859_1 nls_cp437 vfat fat usb_storage e1000e iwlwifi(O) mac80211(O) cfg80211(O) xhci_hcd tpm_tis tpm tpm_bios ehci_hcd xt_mac xt_tcpudp ipt_MASQUERADE iscsi_scst(O) xt_state scst_vdisk(O) xt_multiport crc32c iptable_filter libcrc32c iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 scst_cdrom(O) ip_tables x_tables scst(O) bridge stp llc microcode iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi arc4 snd_hda_codec_realtek snd_hda_intel snd_hda_codec shpchp snd_hwdep snd_pcm snd_timer snd soundcore snd_page_alloc zram(C) usbhid hid i915 drm_kms_helper drm ahci libahci i2c_algo_bit video intel_agp intel_gtt [last unloaded: tpm_bios]
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226220] Pid: 222, comm: kworker/0:2 Tainted: G        WC O 3.2.11-orc #12
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226222] Call Trace:
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226228]  [<ffffffff810643df>] warn_slowpath_common+0x7f/0xc0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226232]  [<ffffffff8106443a>] warn_slowpath_null+0x1a/0x20
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226235]  [<ffffffff8141a7bf>] usb_hcd_resume_root_hub+0x4f/0xa0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226241]  [<ffffffffa0458490>] xhci_resume+0x2a0/0x2e0 [xhci_hcd]
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226245]  [<ffffffffa046544d>] xhci_pci_resume+0x4d/0x60 [xhci_hcd]
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226249]  [<ffffffff8142a6c5>] resume_common+0xd5/0x170
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226252]  [<ffffffff8142a773>] hcd_pci_runtime_resume+0x13/0x20
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226257]  [<ffffffff812d9507>] pci_pm_runtime_resume+0xd7/0xf0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226260]  [<ffffffff812d9430>] ? pci_pm_default_resume_early+0x30/0x30
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226264]  [<ffffffff8139cb93>] __rpm_callback+0x43/0x90
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226267]  [<ffffffff8139d4ec>] rpm_resume+0x44c/0x6b0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226271]  [<ffffffff81305ff4>] ? acpi_os_wait_events_complete+0x23/0x23
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226275]  [<ffffffff8139e523>] __pm_runtime_resume+0x53/0xc0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226278]  [<ffffffff812f0729>] pci_acpi_wake_dev+0xb9/0xe0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226283]  [<ffffffff81315717>] acpi_ev_notify_dispatch+0x67/0x7e
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226286]  [<ffffffff8130601b>] acpi_os_execute_deferred+0x27/0x34
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226290]  [<ffffffff810805ba>] process_one_work+0x11a/0x480
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226295]  [<ffffffff8100ad42>] ? check_events+0x12/0x20
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226299]  [<ffffffff8108125e>] worker_thread+0x15e/0x360
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226303]  [<ffffffff81081100>] ? manage_workers.isra.29+0x230/0x230
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226306]  [<ffffffff810860bc>] kthread+0x8c/0xa0
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226311]  [<ffffffff815832f4>] kernel_thread_helper+0x4/0x10
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226315]  [<ffffffff815813a3>] ? int_ret_from_sys_call+0x7/0x1b
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226319]  [<ffffffff8157957c>] ? retint_restore_args+0x5/0x6
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226323]  [<ffffffff815832f0>] ? gs_change+0x13/0x13
Mar 19 15:42:26 2012-Client-Platform kernel: [ 8648.226325] ---[ end trace 6eb36a2336c449d5 ]---
author
#19 lore raw
In reply to a message not in the archive
Quoted 26 lines · Tom Goetz
Quoted 12 lines · Tom Goetz
Quoted 9 lines · Konrad Rzeszutek Wilk
Quoted 8 lines
Quoted 2 lines

xHCI wakes up from D3 on the SDP with Ubuntu 12.04 Beta 1 and 3.2.11. This fails with the same 3.2.11 kernel and Xen. So the problem is Xen related.

Another update.

On the Ivybridge laptop, xHCI is not waking up because when I plug a device into a xHCI port the ACPI wakeup events are going to the e1000e. Pre S3, it eventually gets a interrupt from the device that wakes it up. Post S3 it never gets an interrupt from the device.

Quoted 7 lines
Quoted 1 line

So these are all MSI related issues right.

Maybe.

Quoted 1 line

The e1000e is also MSI?

Yes. The e1000e getting the xHCI's wake ups is only on one machine. I assume thats a BIOS bug. The broad based issue is that on two manufacturers Ivybridge plus an Intel SDP Ivybridge, xHCI will not wake up from D3 when a USB device is plugged in.

I've just found that if the xHCI is in D3, has a USB device plugged in, and is not waking up, it will wake up when another device in D3 wakes up. Here's the steps I followed:

Quoted 11 lines

1. S3 suspend
2. S3 Resume
3. set xHCI power policy to "auto"
4. xHCI goes into D3
5. Plug USB device into xHCI
6. xHCI does not wake up
7. set e1000e power policy to "auto"
8. Unplug ethernet cable
9. e100e goes into D3
10. Plug in ethernet cable
11. Both e1000e and xHCI wake up.

I think xHCI waking from D3 when e1000e wakes from D3 is because they share the same GPE (0xd). Instrumenting PME polling shows that PME is enabled, but PME status is never set on the xHCI when a USB device is plugged in.

What can mask PME from firing when it's enabled on the device?

#21 lore raw
In reply to a message not in the archive
Quoted 16 lines · Tom Goetz
Quoted 14 lines · Tom Goetz

On Mar 19, 2012, at 9:32 AM, Tom Goetz wrote:
I've just found that if the xHCI is in D3, has a USB device plugged in, and is not waking up, it will wake up when another device in D3 wakes up. Here's the steps I followed:

1. S3 suspend
2. S3 Resume
3. set xHCI power policy to "auto"
4. xHCI goes into D3
5. Plug USB device into xHCI
6. xHCI does not wake up
7. set e1000e power policy to "auto"
8. Unplug ethernet cable
9. e100e goes into D3
10. Plug in ethernet cable
11. Both e1000e and xHCI wake up.

Quoted 3 lines

I think xHCI waking from D3 when e1000e wakes from D3 is because they share the same GPE (0xd). Instrumenting PME polling shows that PME is enabled, but PME status is never set on the xHCI when a USB device is plugged in.

What can mask PME from firing when it's enabled on the device?

Intel had a issue with ACPI tables being incorrect in some Ivy Bridge systems. This led to the kernel ignoring PMEs from the xHCI host controller because it didn't know the PME was associated with the xHCI PCI device. That ACPI table fix was supposed to make it into the Intel reference BIOS. Have you tried updating your BIOS?

However, the kernel was patched to wake up all PCI devices under the PCI bridge that reported a spurious PME, so you shouldn't even need the BIOS update. See commit 379021d5c0899fcf9410cae4ca7a59a5a94ca769 "PCI / PM:
Extend PME polling to all PCI devices".

I don't know why a Linux kernel with that fix that's hosted by Xen wouldn't work when it worked natively. Perhaps Xen blocks the spurious PME before it reaches the kernel?

Can you post the ACPI tables, both before and after suspend, on both the native Linux install and Xen?

Sarah Sharp

author
#23 lore raw
In reply to a message not in the archive
Quoted 19 lines · Sarah Sharp
Quoted 18 lines · Tom Goetz
Quoted 14 lines · Tom Goetz

On Mar 19, 2012, at 9:32 AM, Tom Goetz wrote:
I've just found that if the xHCI is in D3, has a USB device plugged in, and is not waking up, it will wake up when another device in D3 wakes up. Here's the steps I followed:

1. S3 suspend
2. S3 Resume
3. set xHCI power policy to "auto"
4. xHCI goes into D3
5. Plug USB device into xHCI
6. xHCI does not wake up
7. set e1000e power policy to "auto"
8. Unplug ethernet cable
9. e100e goes into D3
10. Plug in ethernet cable
11. Both e1000e and xHCI wake up.

I think xHCI waking from D3 when e1000e wakes from D3 is because they share the same GPE (0xd). Instrumenting PME polling shows that PME is enabled, but PME status is never set on the xHCI when a USB device is plugged in.

Quoted 7 lines
Quoted 1 line

What can mask PME from firing when it's enabled on the device?

Intel had a issue with ACPI tables being incorrect in some Ivy Bridge systems. This led to the kernel ignoring PMEs from the xHCI host controller because it didn't know the PME was associated with the xHCI PCI device. That ACPI table fix was supposed to make it into the Intel reference BIOS. Have you tried updating your BIOS?

Was running last months. Updated today. Still happens.

Quoted 5 lines

However, the kernel was patched to wake up all PCI devices under the PCI bridge that reported a spurious PME, so you shouldn't even need the BIOS update. See commit 379021d5c0899fcf9410cae4ca7a59a5a94ca769 "PCI / PM:
Extend PME polling to all PCI devices".

I've looked at the that code. I instrumented it to verify that PME was enabled and PME status was never set.

Quoted 7 lines

I don't know why a Linux kernel with that fix that's hosted by Xen wouldn't work when it worked natively. Perhaps Xen blocks the spurious PME before it reaches the kernel?

Can you post the ACPI tables, both before and after suspend, on both the native Linux install and Xen?

I'm assuming you meant the contents of /sys/firmware/acpi. I had previously dumped the DSDT pre and post S3 and not seen any differences.

Here are links to zip files of the contents of /sys/firmware/acpi for each situation:

http://dl.dropbox.com/u/68173361/Work/acpi_native_postS3.zip
http://dl.dropbox.com/u/68173361/Work/acpi_native_preS3.zip
http://dl.dropbox.com/u/68173361/Work/acpi_xen_preS3.zip
http://dl.dropbox.com/u/68173361/Work/acpi_xen_postS3.zip

Quoted 2 lines

Sarah Sharp

Thanks for all of the help.

#25 lore raw
In reply to a message not in the archive
Quoted 33 lines · Tom Goetz
Quoted 19 lines · Sarah Sharp
Quoted 18 lines · Tom Goetz
Quoted 14 lines · Tom Goetz

On Mar 19, 2012, at 9:32 AM, Tom Goetz wrote:
I've just found that if the xHCI is in D3, has a USB device plugged in, and is not waking up, it will wake up when another device in D3 wakes up. Here's the steps I followed:

1. S3 suspend
2. S3 Resume
3. set xHCI power policy to "auto"
4. xHCI goes into D3
5. Plug USB device into xHCI
6. xHCI does not wake up
7. set e1000e power policy to "auto"
8. Unplug ethernet cable
9. e100e goes into D3
10. Plug in ethernet cable
11. Both e1000e and xHCI wake up.

I think xHCI waking from D3 when e1000e wakes from D3 is because they share the same GPE (0xd). Instrumenting PME polling shows that PME is enabled, but PME status is never set on the xHCI when a USB device is plugged in.

Quoted 7 lines
Quoted 1 line

What can mask PME from firing when it's enabled on the device?

Intel had a issue with ACPI tables being incorrect in some Ivy Bridge systems. This led to the kernel ignoring PMEs from the xHCI host controller because it didn't know the PME was associated with the xHCI PCI device. That ACPI table fix was supposed to make it into the Intel reference BIOS. Have you tried updating your BIOS?

Was running last months. Updated today. Still happens.

Quoted 1 line
Quoted 6 lines
Quoted 4 lines

However, the kernel was patched to wake up all PCI devices under the PCI bridge that reported a spurious PME, so you shouldn't even need the BIOS update. See commit 379021d5c0899fcf9410cae4ca7a59a5a94ca769 "PCI / PM:
Extend PME polling to all PCI devices".

I've looked at the that code. I instrumented it to verify that PME was enabled and PME status was never set.

Ok. Maybe the port change bits weren't cleared before the host was placed into D3 after suspend. Can you turn on CONFIG_USB_DEBUG and CONFIG_USB_XHCI_HCD_DEBUGGING, and capture the log messages from the time you suspend the system to when you resume and the xHCI host goes into D3?

Sarah Sharp

author
#27 lore raw
In reply to a message not in the archive
Quoted 8 lines · Sarah Sharp

Ok. Maybe the port change bits weren't cleared before the host was placed into D3 after suspend. Can you turn on CONFIG_USB_DEBUG and CONFIG_USB_XHCI_HCD_DEBUGGING, and capture the log messages from the time you suspend the system to when you resume and the xHCI host goes into D3?

Sarah Sharp

Here's the log:

http://dl.dropbox.com/u/68173361/Work/syslog_xhci_s3_d3.log

It also has my debugging mixed in. Mostly "function[line]" but one or two warnings for the call stacks of critical events.

One of the theories I'm considering is that it is also broken in native, but works due to some secondary mechanism that is not available in Xen.

-Tom