Thread (41 messages) 41 messages, 7 authors, 2016-06-01

Re: [PATCH] PCI: Power on bridges before scanning new devices

From: Rafael J. Wysocki <hidden>
Date: 2016-05-25 20:45:48
Also in: linux-pci

On Wednesday, May 25, 2016 04:19:48 PM Mika Westerberg wrote:
On Wed, May 25, 2016 at 12:13:09AM +0300, Mika Westerberg wrote:
quoted
On Tue, May 24, 2016 at 03:53:23PM +0300, Mika Westerberg wrote:
quoted
quoted
I dropped "ACPI / hotplug / PCI: Runtime resume bridge before rescan"
on the assumption that "PCI: Power on bridges before scanning new
devices" is sufficient to cover both the ACPI and the generic PCi
rescan cases, but I'd like some reassurance about that.
I agree with your reasoning that the patch should not be needed anymore.
However, I have the machine which needed that patch at home so I'm not
able to test it now. I'll do that later today when I get back home.
I tried now on my Lenovo Yoga 900 laptop and unfortunately "PCI: Power
on bridges before scanning new devices" seems not to be enough. This
machine has SD-card reader connected to one PCIe port and once I unload
the sdhci-pci driver and enable runtime PM for the device, next system
suspend/resume cycle loses the SD-card reader PCI device.

I will investigate more tomorrow -- it is getting late here.
I think I found reason for the issue.

When the laptop resumes it will send ACPI BUS_CHECK event for the two
PCIe root ports. This ends up in acpiphp_check_bridge() where it goes
through all slots in that bridge checking if the devices are still
present. This happens before we call pci_scan_bridge() for the bridge
itself.

Since the bridge is in D3 config space of the device behind it is not
available and we determine that the device is not there anymore.

It looks like we either need that ACPI hotplug patch or alternatively we
could add pm_runtime_get/put() in acpiphp_check_bridge().
Have you tried the latter?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help