# ASPM in custom kernel

## nacitar

I've recently swapped from genkernel to a kernel I built myself, for my Dell Latitude E6520 (new) laptop.  Prior to making the swap, I logged my "sudo lspci -vvv" output to a file so I could compare it to my new one.  However, one small thing is troubling me..

cat genkernel_lspci.log | grep ASPM

 *Quote:*   

> 
> 
> 		LnkCap:	Port #2, Speed 5GT/s, Width x16, ASPM L0s L1, Latency L0 <256ns, L1 <4us
> 
> 		LnkCtl:	ASPM L0s L1 Enabled; RCB 64 bytes Disabled- Retrain- CommClk+
> ...

 

However, for the new one... sudo lspci -vvv | grep ASPM

 *Quote:*   

> 
> 
> 		LnkCap:	Port #2, Speed 5GT/s, Width x16, ASPM L0s L1, Latency L0 <256ns, L1 <4us
> 
> 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
> ...

 

As you can see, in genkernel everything lists CAPABILITY of ASPM, and all but _one_ thing actually uses ASPM.

However, in my kernel, all except for _three_ things DO NOT use ASPM (says disabled).

Any ideas why genkernel == 12 devices ASPM working, 1 device ASPM disabled

And yet, custom kernel == 3 devices ASPM working, 10 devices ASPM disabled

in my kernel, I have already enabled PCIEASPM (PCI Express ASPM control), WMI  and DELL_WMI (Dell WMI Extras)... and, as SOME things are using ASPM, I'm guessing it must be supported properly... but why would it flip flop and not be using it as much now?

----------

## lcidw

Not that i have tried genkernel, but i'm running into this problem as well, especially with hardened-sources .38 installed now (it was .37 on a previous install where it stopped complaining about ASPM). My lspci is even worse:

```
# lspci -vvv | grep -i aspm

      LnkCap:   Port #0, Speed unknown, Width x0, ASPM unknown, Latency L0 <64ns, L1 <1us

      LnkCtl:   ASPM Disabled; Disabled- Retrain- CommClk-

      LnkCap:   Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <1us, L1 <4us

      LnkCtl:   ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk-

      LnkCap:   Port #5, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <256ns, L1 <4us

      LnkCtl:   ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+

      LnkCap:   Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <128ns, L1 <32us

      LnkCtl:   ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
```

The following message appears:

```
# dmesg | grep -i aspm

[    0.763728] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
```

Tried the pcie_aspm=force kernel parameter, and that enables 1 device. Google isn't helping much, except that the now apparently not marked experimental kernel code iirc, is still buggy as hell. Now, the above post by nacitar is giving me hope that i'm (or, we're) doing something, somehow, wrong (or not good/properly enough).

For a Thinkpad x201, with stuff like link power management (and ASPM iirc) enabled in BIOS, and..

```
# lspci -vvv | grep -o Power\ .* | sort -u

Power Management version 2

Power Management version 3
```

..i'd expect better, and i have serious doubts that it's the hardware. It's impossible to disable ASPM in the kernel, autoselected by i don't know what, if my kernel config is wanted just let me know.

I've been testing the manual steps documented at http://wireless.kernel.org/en/users/Documentation/ASPM#Linux_kernel_ASPM_support, for both PCIE controllers as well as my wireless card, as these are the only devices currently reporting "LnkCap ASPM L0s L1", but i doubt this is the correct way of handling it.

Hoping for a solution, thanks in advance!

----------

## lcidw

Some more testing resulted in the following, quite interesting results, in this order..Booting with pcie_aspm=force (as stated before), the PCIE bridge and wireless card connected to that bridge, had status "LnkCtl: ASPM L1 Enabled".

echo powersave > /sys/module/pcie_aspm/parameters/policy, and suddenly those two had status "LnkCtl: ASPM L0s L1 Enabled".

modprobe iwlagn, and everything went to status "LnkCtl: ASPM Disabled".

Changing to default/performance/powersave in /sys/module/pcie_aspm/parameters/policy, has no further effect.

rmmod iwlagn, results in a PCI panic, though i remember having that before even touching PCIE ASPM stuff (pcie_aspm or setpci wise), so that might be unrelated. Keeping iwlagn loaded, seems stable.

setpci the ASPM L0s and L1 on the Link Control Register of those two, seems stable. Changing to default/performance/powersave in /sys/module/pcie_aspm/parameters/policy, has no further effect.

On top of that, even with wireless on, and these ASPM set manually, powertop reports a power usage of just 6W, where the lowest before (even with the .37 kernel) was 7W with wireless off, 8W with wireless on. So, really want this to work properly   :Shocked: .Last edited by lcidw on Mon Jun 13, 2011 2:11 pm; edited 1 time in total

----------

## Ant P.

0.6W seems impossibly low, my netbook doesn't dip below 7.0 even completely idle.

----------

## nacitar

dmesg | grep -i aspm

[    0.776861] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it

I'm getting that too...

----------

## nacitar

Even booting the gentoo installation livecd.. lspci -vvv | grep -i aspm shows almost everything enabled ASPM-wise; anything genkernel does this.  However, anything non-genkernel does not.

What setting could it be?

I think it has to do with the dmesg line:

[    0.777926] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it

Because if I use pcie_aspm=force on my command line, i can get the lspci -vvv output the same as I was getting with genkernel; but not without it.

----------

## lcidw

 *nacitar wrote:*   

> Even booting the gentoo installation livecd.. lspci -vvv | grep -i aspm shows almost everything enabled ASPM-wise

 

Same, just that the livecd comes with the .37 kernel, and from what i understand, they broke it upstream in the .38. I'm gonna wait till .39 or 3.* stable and see what that brings.

----------

