Bug 79621 - ASPM states for PCIe devices are not enabled in POWERSAVE mode
Summary: ASPM states for PCIe devices are not enabled in POWERSAVE mode
Status: CLOSED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Power Management
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Rafael J. Wysocki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-07 17:54 UTC by Vidya Sagar
Modified: 2015-07-22 01:05 UTC (History)
5 users (show)

See Also:
Kernel Version: 3.10 +
Tree: Mainline
Regression: Yes


Attachments
ASPM call flow (88.53 KB, application/pdf)
2014-07-07 17:54 UTC, Vidya Sagar
Details
log with 'dmesg' and 'lspci -vvv' before applying the proposed patch (57.51 KB, text/plain)
2014-07-08 05:23 UTC, Vidya Sagar
Details
log with 'dmesg' and 'lspci -vvv' after applying the proposed patch (57.65 KB, text/plain)
2014-07-08 05:26 UTC, Vidya Sagar
Details
Patch to fix the ASPM issue being discussed in this bug (1.80 KB, patch)
2014-07-08 05:27 UTC, Vidya Sagar
Details | Diff
The patch that got applied for 3.17 (5.77 KB, text/html)
2014-07-16 20:46 UTC, Vidya Sagar
Details

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

Note You need to log in before you can comment on or make changes to this bug.