Bug 194895

Summary: ASPM is not getting enabled following hotplug on default policy
Product: Drivers Reporter: Sinan Kaya (okaya)
Component: PCIAssignee: drivers_pci (drivers_pci)
Status: NEW ---    
Severity: normal CC: bjorn
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.10 Tree: Mainline
Regression: No
Attachments: boot log with 4.9
lspci_after_insertion_with_01_01_00_0
lspci_before_remove_l0s_enabled_on_01_01_00_00

Description Sinan Kaya 2017-03-15 18:10:35 UTC
When the operating system is booted with the default ASPM policy
(POLICY_DEFAULT), current code is querying the enable/disable
states from ASPM registers to determine the policy.

For example, a BIOS could set the power saving state to performance
and clear all ASPM control registers. A balanced ASPM policy could
enable L0s and disable L1. A power conscious BIOS could enable both
L0s and L1 to trade off latency and performance vs. power.

After hotplug removal, pcie_aspm_exit_link_state() function clears
the ASPM registers. An insertion following hotplug removal reads
incorrect policy as ASPM disabled even though ASPM was enabled
during boot.

This is caused by the fact that same function is used for reconfiguring
ASPM regardless of the of the power on state.
Comment 1 Bjorn Helgaas 2017-03-15 19:14:14 UTC
I understand the bug here and I agree we need to fix this, but for completeness and the benefit of future readers, could you please attach a complete "lspci -vv" output before the hotplug removal, another one from after the hotplug insertion, and the complete dmesg log?  I wonder if there's anything we could log in dmesg that would be useful here.  It might be more noise than it's worth, but then again, ASPM problems seem pretty common.
Comment 2 Sinan Kaya 2017-03-16 02:52:50 UTC
Created attachment 255275 [details]
boot log with 4.9

I have network connectivity issues on 4.10 that is preventing me to collect logs. 

I attached the logs from 4.9 instead as the issue is there as well.
Comment 3 Sinan Kaya 2017-03-16 02:53:22 UTC
Created attachment 255277 [details]
lspci_after_insertion_with_01_01_00_0
Comment 4 Sinan Kaya 2017-03-16 02:53:55 UTC
Created attachment 255279 [details]
lspci_before_remove_l0s_enabled_on_01_01_00_00