BACKPORT: FROMLIST: PCI/ASPM: Disable ASPM when save/restore PCI state

Certain PCIe devices (e.g. GL9750) have high penalties (e.g. high Port
T_POWER_ON) when exiting L1 but enter L1 aggressively. As a result,
such devices enter and exit L1 frequently during pci_save_state and
pci_restore_state; eventually causing poor suspend/resume performance.

Based on the observation that PCI accesses dominance pci_save_state/
pci_restore_state plus these accesses are fairly close to each other, the
actual time the device could stay in low power states is negligible.
Therefore, the little power-saving benefit from ASPM during suspend/resume
does not overweight the performance degradation caused by high L1 exit
penalties.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211187
Signed-off-by: Victor Ding <victording@google.com>
(am from https://patchwork.kernel.org/patch/12053999/)
(also found at https://lore.kernel.org/r/20210128155237.v2.1.I42c1001f8b0eaac973a99e1e5c2170788ee36c9c@changeid)

Conflicts:
   drivers/pci/pci.c
   include/linux/pci.h

[victording: resolved trivial context conflicts in above files due to
chromeos-5.4 missing upstream af65d1ad4 ("PCI/AER: Save AER Capability
for suspend/resume"), 39850ed5 ("PCI/PTM: Save/restore Precision Time
Measurement Capability for suspend/resume"), ecdf57b4 ("PCI/ASPM: Remove
struct aspm_register_info.l1ss_cap_ptr"), and ee8b1c47 ("PCI: Return u16
from pci_find_ext_capability() and similar")]

BUG=b:171470014
TEST=Performed 50 iterations suspend/resume on a zork device; suspend
	time variation reduced from ~65ms to ~12ms, resume time
	variation reduced from ~200ms to ~20ms.

Signed-off-by: Victor Ding <victording@google.com>
Change-Id: I42c1001f8b0eaac973a99e1e5c2170788ee36c9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2662456
Reviewed-by: Victor Ding <victording@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Tested-by: Victor Ding <victording@chromium.org>
Commit-Queue: Victor Ding <victording@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
(cherry picked from commit 564972c5c3e2118120a69e1511e72413cf8575c9)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2670464
4 files changed