]> git.itanic.dy.fi Git - linux-stable/commit
PCI/ASPM: Save LTR Capability for suspend/resume
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 9 Jan 2019 14:22:08 +0000 (08:22 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Apr 2019 07:17:03 +0000 (09:17 +0200)
commitb851a25507e2c90ff3ec64079d238c94d6d3d634
treea8a0e4928c5541bbcd7a9674c4e7cf1615d7711e
parent75e3256e2309dbc3063623f2d9b55ceaa889559f
PCI/ASPM: Save LTR Capability for suspend/resume

[ Upstream commit dbbfadf2319005cf528b0f15f12a05d4e4644303 ]

Latency Tolerance Reporting (LTR) allows Endpoints and Switch Upstream
Ports to report their latency requirements to upstream components.  If ASPM
L1 PM substates are enabled, the LTR information helps determine when a
Link enters L1.2 [1].

Software must set the maximum latency values in the LTR Capability based on
characteristics of the platform, then set LTR Mechanism Enable in the
Device Control 2 register in the PCIe Capability.  The device can then use
LTR to report its latency tolerance.

If the device reports a maximum latency value of zero, that means the
device requires the highest possible performance and the ASPM L1.2 substate
is effectively disabled.

We put devices in D3 for suspend, and we assume their internal state is
lost.  On resume, previously we did not restore the LTR Capability, but we
did restore the LTR Mechanism Enable bit, so devices would request the
highest possible performance and ASPM L1.2 wouldn't be used.

[1] PCIe r4.0, sec 5.5.1
Link: https://bugzilla.kernel.org/show_bug.cgi?id=201469
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/pci.c