Bug 79621

Summary: ASPM states for PCIe devices are not enabled in POWERSAVE mode
Product: Power Management Reporter: Vidya Sagar (sagar.tv)
Component: OtherAssignee: Rafael J. Wysocki (rjw)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: high CC: bjorn, lenb, rjw, swarren, tianyu.lan
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.10 + Subsystem:
Regression: Yes Bisected commit-id:
Attachments: ASPM call flow
log with 'dmesg' and 'lspci -vvv' before applying the proposed patch
log with 'dmesg' and 'lspci -vvv' after applying the proposed patch
Patch to fix the ASPM issue being discussed in this bug
The patch that got applied for 3.17

Description Vidya Sagar 2014-07-07 17:54:19 UTC
Created attachment 142341 [details]
ASPM call flow

The expectation from PCIe sub system is that when a driver for a particular PCIe device is loaded, pci_enable_device() API gets called which would eventually enable the ASPM states for the links. This is not happening as of today because of the following check in 

drivers/pci/pci.c: pci_set_power_state()
/* Check if we're already there */
if (dev->current_state == state)
    return 0;

Because of this, call to pcie_aspm_powersave_config_link() is never made resulting in not enabling ASPM forever (even when CONFIG_PCIEASPM_POWERSAVE=y ). Please refer to the attached PDF (ASPM call flow) for different paths that can enable ASPM.
Comment 1 Vidya Sagar 2014-07-08 05:23:53 UTC
Created attachment 142381 [details]
log with 'dmesg' and 'lspci -vvv' before applying the proposed patch

Attached file is a log with info from commands 'dmesg' and 'lspci -vvv'
Comment 2 Vidya Sagar 2014-07-08 05:26:25 UTC
Created attachment 142391 [details]
log with 'dmesg' and 'lspci -vvv' after applying the proposed patch

Attached file is a log with info from commands 'dmesg' and 'lspci -vvv'
Comment 3 Vidya Sagar 2014-07-08 05:27:53 UTC
Created attachment 142401 [details]
Patch to fix the ASPM issue being discussed in this bug
Comment 4 Vidya Sagar 2014-07-16 20:46:57 UTC
Created attachment 143271 [details]
The patch that got applied for 3.17

This is the patch that got applied for 3.17
Comment 5 Len Brown 2015-07-22 01:05:40 UTC
in 3.17-rc1:

commit 1f6ae47ecff7f23da73417e068018b311f3b5583
Author: Vidya Sagar <sagar.tv@gmail.com>
Date:   Wed Jul 16 15:33:42 2014 +0530

    PCI: Configure ASPM when enabling device