]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume"
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 3 Feb 2023 19:57:29 +0000 (13:57 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2023 18:11:41 +0000 (19:11 +0100)
commitda301b9e97e5b1ca4a6dc1a6211a80bcaaeacd12
treed1eda17816116889a2cd0f90eea7f8712285b464
parentf7d568f5037bb20e367fd8267a09f7721322142c
Revert "PCI/ASPM: Save L1 PM Substates Capability for suspend/resume"

commit 5c168d03e9f875e7d1162b83e577da9f9ea568a8 upstream.

This reverts commit efcd698d7e52737575b5ce9c51d9ea0d4f6a8b22.

Tasev Nikola and Mark Enriquez reported that resume from suspend was broken
in v6.1-rc1.  Tasev bisected to 98c9c12c8ad7 ("PCI/PTM: Cache PTM
Capability offset"), but we can't figure out how that could be related.

Mark saw the same symptoms and bisected to efcd698d7e52 ("PCI/ASPM: Save L1
PM Substates Capability for suspend/resume"), which does have a connection:
it restores L1 Substates configuration while ASPM L1 may be enabled:

  pci_restore_state
    pci_restore_aspm_l1ss_state
      aspm_program_l1ss
        pci_write_config_dword(PCI_L1SS_CTL1, ctl1)         # L1SS restore
    pci_restore_pcie_state
      pcie_capability_write_word(PCI_EXP_LNKCTL, cap[i++])  # L1 restore

which is a problem because PCIe r6.0, sec 5.5.4, requires that:

  If setting either or both of the enable bits for ASPM L1 PM
  Substates, both ports must be configured as described in this
  section while ASPM L1 is disabled.

Separately, Thomas Witt reported that 79181434adc3 ("PCI/ASPM: Refactor L1
PM Substates Control Register programming") broke suspend/resume, and it
depends on efcd698d7e52.

Revert efcd698d7e52 ("PCI/ASPM: Save L1 PM Substates Capability for
suspend/resume") to fix the resume issue and enable revert of 79181434adc3
to fix the issue Thomas reported.

Note that reverting efcd698d7e52 means L1 Substates config may be lost on
suspend/resume.  As far as we know the system will use more power but will
still *work* correctly.

Fixes: efcd698d7e52 ("PCI/ASPM: Save L1 PM Substates Capability for suspend/resume")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216782
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216877
Reported-by: Tasev Nikola <tasev.stefanoska@skynet.be>
Reported-by: Mark Enriquez <enriquezmark36@gmail.com>
Reported-by: Thomas Witt <kernel@witt.link>
Tested-by: Mark Enriquez <enriquezmark36@gmail.com>
Tested-by: Thomas Witt <kernel@witt.link>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org # v6.1+
Cc: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/pcie/aspm.c