Skip to contentSkip to conversation

acpiphp broken on Lenovo X220 from 3.6 onwards

Bug 53811 Bjorn Helgaas 2 participants 3 messages Apr 4, 2013 – Apr 5, 2013 3 messages not in the archive PCI

lore
Share & tools
lore

Bjorn Helgaas

author maintainer
#2 lore raw
In reply to a message not in the archive
Quoted 6 lines

https://bugzilla.kernel.org/show_bug.cgi?id=53811

It appears that the SCI is generated when hotplug event occurs even if the root port is in low power state. But because the configuration space of subordinate devices is not accessible when the root port is in low power state, the hotplugged device is not detected.

If the problem is with config space access, not with the SCI, why can't you just put the root port back in D0 before scanning its secondary bus? That seems like a more direct fix.

Quoted 8 lines
Quoted 3 lines

However, I don't think this is a complete solution because acpiphp does not claim all root ports that can generate hotplug SCI events. Bug #54981 is one example.

In #54981, if acpiphp is used, PCIe hotplug does not work regardless we put the root port into low power state or not. If pciehp is used, the pciehp will register the hotplug slots, so that we will prevent putting the root port into low power state. So I think the comment #26 patch is a practical solution.

My point here is not about power; only that acpiphp cannot reliably identify all slots, so we can't rely on slot presence as a way to decide what to do about power. On the machine in bug #54981, we must use acpiphp because the BIOS doesn't let us use pciehp.

author maintainer
#4 lore raw
In reply to a message not in the archive
Quoted 8 lines
Quoted 3 lines

If the problem is with config space access, not with the SCI, why can't you just put the root port back in D0 before scanning its secondary bus? That seems like a more direct fix.

comment #4 patch does exactly like that. ALLurGroceries tried that patch and it works for him in comment #7. But in comment #14, ALLurGroceries reported that it does not work reliably enough. So I write comment #26 patch to fix the issue in a more conservative way, and it works reliable for ALLurGroceries.

The comment #4 patch adds "pm_runtime_get_sync(&bridge->pci_dev->dev)" before re-enumerating. If that is supposed to keep the bridge in D0 but doesn't, we need to figure out why. I don't know how PM works, but maybe Rafael will chime in.

Quoted 5 lines

If acpiphp cannot identify the slots, acpiphp cannot work regardless whether the bridge is put into low power state. If acpiphp can identify the slots, with the help of comment #26 patch, acpiphp can work properly and the root port will not be put into low power state. So I think the point is to make acpiphp identify all slots. And comment #26 patch is a valid fix.

Please look at the bug #54981 DSDT and explain either (1) why we should use pciehp rather than acpiphp on that machine, or (2) how we can make acpiphp identify the ExpressCard slot.

My contention is that the "slot identification" model currently used by acpiphp is fundamentally broken and that we should change acpiphp so it doesn't depend on identifying slots. I don't believe it is possible to identify all possible slots by looking at the DSDT, and therefore, I don't want to make changes like the comment #26 patch that depend on identifying slots.

#5 lore raw
Quoted 9 lines · Bjorn Helgaas
Quoted 8 lines
Quoted 3 lines

If the problem is with config space access, not with the SCI, why can't you just put the root port back in D0 before scanning its secondary bus? That seems like a more direct fix.

comment #4 patch does exactly like that. ALLurGroceries tried that patch and it works for him in comment #7. But in comment #14, ALLurGroceries reported that it does not work reliably enough. So I write comment #26 patch to fix the issue in a more conservative way, and it works reliable for ALLurGroceries.

Quoted 4 lines

The comment #4 patch adds "pm_runtime_get_sync(&bridge->pci_dev->dev)" before re-enumerating. If that is supposed to keep the bridge in D0 but doesn't, we need to figure out why. I don't know how PM works, but maybe Rafael will chime in.

Quite frankly, this looks like unreliable hardware to me in the face of comment #14. It looks like with that patch applied the problem is randomly reproducible, which suggests that we probably don't wait for a sufficiently long time during the PCIe port resume. Or there's a race I'm not seeing at the moment.

So it might be a good idea to repeat the experiment with a similar patch, but with increased timeouts (and the "put" part need not be "sync").

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.