+++ /dev/null
-From e5711ab0ab6a25b276dc09f14da5331a48bf45be Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sat, 5 Oct 2019 14:04:36 +0200
-Subject: PCI/ASPM: Add L1 PM substate support to pci_disable_link_state()
-
-From: Heiner Kallweit <hkallweit1@gmail.com>
-
-[ Upstream commit aff5d0552da4055da3faa27ee4252e48bb1f5821 ]
-
-Add support for disabling states L1.1 and L1.2 to pci_disable_link_state().
-Allow separate control of ASPM and PCI PM L1 substates.
-
-Link: https://lore.kernel.org/r/d81f8036-c236-6463-48e7-ebcdcda85bba@gmail.com
-Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Stable-dep-of: 3cb4f534bac0 ("Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1"")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/pcie/aspm.c | 11 ++++++++++-
- include/linux/pci.h | 10 +++++++---
- 2 files changed, 17 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index 1f9e89c2c10d3..8f934c88dcd76 100644
---- a/drivers/pci/pcie/aspm.c
-+++ b/drivers/pci/pcie/aspm.c
-@@ -1110,7 +1110,16 @@ static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
- if (state & PCIE_LINK_STATE_L0S)
- link->aspm_disable |= ASPM_STATE_L0S;
- if (state & PCIE_LINK_STATE_L1)
-- link->aspm_disable |= ASPM_STATE_L1;
-+ /* L1 PM substates require L1 */
-+ link->aspm_disable |= ASPM_STATE_L1 | ASPM_STATE_L1SS;
-+ if (state & PCIE_LINK_STATE_L1_1)
-+ link->aspm_disable |= ASPM_STATE_L1_1;
-+ if (state & PCIE_LINK_STATE_L1_2)
-+ link->aspm_disable |= ASPM_STATE_L1_2;
-+ if (state & PCIE_LINK_STATE_L1_1_PCIPM)
-+ link->aspm_disable |= ASPM_STATE_L1_1_PCIPM;
-+ if (state & PCIE_LINK_STATE_L1_2_PCIPM)
-+ link->aspm_disable |= ASPM_STATE_L1_2_PCIPM;
- pcie_config_aspm_link(link, policy_to_aspm_state(link));
-
- if (state & PCIE_LINK_STATE_CLKPM)
-diff --git a/include/linux/pci.h b/include/linux/pci.h
-index f8036acf2c12b..5e21876341c62 100644
---- a/include/linux/pci.h
-+++ b/include/linux/pci.h
-@@ -1496,9 +1496,13 @@ extern bool pcie_ports_native;
- #define pcie_ports_native false
- #endif
-
--#define PCIE_LINK_STATE_L0S 1
--#define PCIE_LINK_STATE_L1 2
--#define PCIE_LINK_STATE_CLKPM 4
-+#define PCIE_LINK_STATE_L0S BIT(0)
-+#define PCIE_LINK_STATE_L1 BIT(1)
-+#define PCIE_LINK_STATE_CLKPM BIT(2)
-+#define PCIE_LINK_STATE_L1_1 BIT(3)
-+#define PCIE_LINK_STATE_L1_2 BIT(4)
-+#define PCIE_LINK_STATE_L1_1_PCIPM BIT(5)
-+#define PCIE_LINK_STATE_L1_2_PCIPM BIT(6)
-
- #ifdef CONFIG_PCIEASPM
- int pci_disable_link_state(struct pci_dev *pdev, int state);
---
-2.42.0
-
+++ /dev/null
-From c3e6db03cceefe02c5be01bc581b545d5d5d0121 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 4 May 2023 16:42:57 +0530
-Subject: PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1
-
-From: Ajay Agarwal <ajayagarwal@google.com>
-
-[ Upstream commit fb097dcd5a28c0a2325632405c76a66777a6bed9 ]
-
-Previously pci_disable_link_state(PCIE_LINK_STATE_L1) disabled L1SS as well
-as L1. This is unnecessary since pcie_config_aspm_link() takes care that
-L1SS is not enabled if L1 is disabled.
-
-Disable only ASPM_STATE_L1 when the caller disables L1. No functional
-changes intended.
-
-This is consistent with aspm_attr_store_common(), which disables only L1,
-not L1SS, when L1 is disabled via the sysfs "l1_aspm" file.
-
-[bhelgaas: commit log]
-Link: https://lore.kernel.org/r/20230504111301.229358-2-ajayagarwal@google.com
-Signed-off-by: Ajay Agarwal <ajayagarwal@google.com>
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
-Stable-dep-of: 3cb4f534bac0 ("Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1"")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/pcie/aspm.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index 8f934c88dcd76..8db6a9084a12a 100644
---- a/drivers/pci/pcie/aspm.c
-+++ b/drivers/pci/pcie/aspm.c
-@@ -1110,8 +1110,7 @@ static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
- if (state & PCIE_LINK_STATE_L0S)
- link->aspm_disable |= ASPM_STATE_L0S;
- if (state & PCIE_LINK_STATE_L1)
-- /* L1 PM substates require L1 */
-- link->aspm_disable |= ASPM_STATE_L1 | ASPM_STATE_L1SS;
-+ link->aspm_disable |= ASPM_STATE_L1;
- if (state & PCIE_LINK_STATE_L1_1)
- link->aspm_disable |= ASPM_STATE_L1_1;
- if (state & PCIE_LINK_STATE_L1_2)
---
-2.42.0
-
+++ /dev/null
-From 568b1487084809a7257e371ca4ede0b79eb55794 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 18 Jun 2019 23:13:48 +0200
-Subject: PCI: let pci_disable_link_state propagate errors
-
-From: Heiner Kallweit <hkallweit1@gmail.com>
-
-[ Upstream commit 4cfd218855923a07dc02a5bec3d3bb37a118ebc2 ]
-
-Drivers may rely on pci_disable_link_state() having disabled certain
-ASPM link states. If OS can't control ASPM then pci_disable_link_state()
-turns into a no-op w/o informing the caller. The driver therefore may
-falsely assume the respective ASPM link states are disabled.
-Let pci_disable_link_state() propagate errors to the caller, enabling
-the caller to react accordingly.
-
-Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
-Acked-by: Bjorn Helgaas <bhelgaas@google.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Stable-dep-of: 3cb4f534bac0 ("Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1"")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/pcie/aspm.c | 20 +++++++++++---------
- include/linux/pci-aspm.h | 7 ++++---
- 2 files changed, 15 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index 118c91586798d..f2b5f3a8535e5 100644
---- a/drivers/pci/pcie/aspm.c
-+++ b/drivers/pci/pcie/aspm.c
-@@ -1078,18 +1078,18 @@ void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
- up_read(&pci_bus_sem);
- }
-
--static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
-+static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
- {
- struct pci_dev *parent = pdev->bus->self;
- struct pcie_link_state *link;
-
- if (!pci_is_pcie(pdev))
-- return;
-+ return 0;
-
- if (pdev->has_secondary_link)
- parent = pdev;
- if (!parent || !parent->link_state)
-- return;
-+ return -EINVAL;
-
- /*
- * A driver requested that ASPM be disabled on this device, but
-@@ -1101,7 +1101,7 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
- */
- if (aspm_disabled) {
- pci_warn(pdev, "can't disable ASPM; OS doesn't have ASPM control\n");
-- return;
-+ return -EPERM;
- }
-
- if (sem)
-@@ -1120,11 +1120,13 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
- mutex_unlock(&aspm_lock);
- if (sem)
- up_read(&pci_bus_sem);
-+
-+ return 0;
- }
-
--void pci_disable_link_state_locked(struct pci_dev *pdev, int state)
-+int pci_disable_link_state_locked(struct pci_dev *pdev, int state)
- {
-- __pci_disable_link_state(pdev, state, false);
-+ return __pci_disable_link_state(pdev, state, false);
- }
- EXPORT_SYMBOL(pci_disable_link_state_locked);
-
-@@ -1132,14 +1134,14 @@ EXPORT_SYMBOL(pci_disable_link_state_locked);
- * pci_disable_link_state - Disable device's link state, so the link will
- * never enter specific states. Note that if the BIOS didn't grant ASPM
- * control to the OS, this does nothing because we can't touch the LNKCTL
-- * register.
-+ * register. Returns 0 or a negative errno.
- *
- * @pdev: PCI device
- * @state: ASPM link state to disable
- */
--void pci_disable_link_state(struct pci_dev *pdev, int state)
-+int pci_disable_link_state(struct pci_dev *pdev, int state)
- {
-- __pci_disable_link_state(pdev, state, true);
-+ return __pci_disable_link_state(pdev, state, true);
- }
- EXPORT_SYMBOL(pci_disable_link_state);
-
-diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
-index df28af5cef210..67064145d76e0 100644
---- a/include/linux/pci-aspm.h
-+++ b/include/linux/pci-aspm.h
-@@ -24,11 +24,12 @@
- #define PCIE_LINK_STATE_CLKPM 4
-
- #ifdef CONFIG_PCIEASPM
--void pci_disable_link_state(struct pci_dev *pdev, int state);
--void pci_disable_link_state_locked(struct pci_dev *pdev, int state);
-+int pci_disable_link_state(struct pci_dev *pdev, int state);
-+int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
- void pcie_no_aspm(void);
- #else
--static inline void pci_disable_link_state(struct pci_dev *pdev, int state) { }
-+static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
-+{ return 0; }
- static inline void pcie_no_aspm(void) { }
- #endif
-
---
-2.42.0
-
+++ /dev/null
-From 1402588c96fb7545d783048ade10b2d1dccedfd8 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 27 Aug 2019 11:56:20 +0200
-Subject: PCI: Move ASPM declarations to linux/pci.h
-
-From: Krzysztof Wilczynski <kw@linux.com>
-
-[ Upstream commit 7ce2e76a0420801fb4b53b9e6850940e6b326433 ]
-
-Move ASPM definitions and function prototypes from include/linux/pci-aspm.h
-to include/linux/pci.h so users only need to include <linux/pci.h>:
-
- PCIE_LINK_STATE_L0S
- PCIE_LINK_STATE_L1
- PCIE_LINK_STATE_CLKPM
- pci_disable_link_state()
- pci_disable_link_state_locked()
- pcie_no_aspm()
-
-No functional changes intended.
-
-Link: https://lore.kernel.org/r/20190827095620.11213-1-kw@linux.com
-Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Stable-dep-of: 3cb4f534bac0 ("Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1"")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/acpi/pci_root.c | 1 -
- drivers/char/xillybus/xillybus_pcie.c | 1 -
- drivers/net/ethernet/intel/e1000e/e1000.h | 1 -
- drivers/net/ethernet/jme.c | 1 -
- drivers/net/ethernet/realtek/r8169_main.c | 1 -
- drivers/net/wireless/ath/ath5k/pci.c | 1 -
- .../net/wireless/intel/iwlegacy/3945-mac.c | 1 -
- .../net/wireless/intel/iwlegacy/4965-mac.c | 1 -
- .../net/wireless/intel/iwlwifi/pcie/trans.c | 1 -
- drivers/pci/pci-acpi.c | 1 -
- drivers/pci/pcie/aspm.c | 1 -
- drivers/pci/quirks.c | 1 -
- drivers/scsi/aacraid/linit.c | 1 -
- drivers/scsi/hpsa.c | 1 -
- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 -
- include/linux/pci-aspm.h | 36 -------------------
- include/linux/pci.h | 18 ++++++++++
- 17 files changed, 18 insertions(+), 51 deletions(-)
- delete mode 100644 include/linux/pci-aspm.h
-
-diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
-index e465e720eab20..6c23a6f520bad 100644
---- a/drivers/acpi/pci_root.c
-+++ b/drivers/acpi/pci_root.c
-@@ -28,7 +28,6 @@
- #include <linux/pm_runtime.h>
- #include <linux/pci.h>
- #include <linux/pci-acpi.h>
--#include <linux/pci-aspm.h>
- #include <linux/dmar.h>
- #include <linux/acpi.h>
- #include <linux/slab.h>
-diff --git a/drivers/char/xillybus/xillybus_pcie.c b/drivers/char/xillybus/xillybus_pcie.c
-index 05e5324f60bd9..03dda2141ff42 100644
---- a/drivers/char/xillybus/xillybus_pcie.c
-+++ b/drivers/char/xillybus/xillybus_pcie.c
-@@ -12,7 +12,6 @@
-
- #include <linux/module.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/slab.h>
- #include "xillybus.h"
-
-diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
-index c5a119daa7f3c..585da186e21f8 100644
---- a/drivers/net/ethernet/intel/e1000e/e1000.h
-+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
-@@ -13,7 +13,6 @@
- #include <linux/io.h>
- #include <linux/netdevice.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/crc32.h>
- #include <linux/if_vlan.h>
- #include <linux/timecounter.h>
-diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
-index a5ab6f3403ae0..0935cf16de6eb 100644
---- a/drivers/net/ethernet/jme.c
-+++ b/drivers/net/ethernet/jme.c
-@@ -27,7 +27,6 @@
- #include <linux/module.h>
- #include <linux/kernel.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/netdevice.h>
- #include <linux/etherdevice.h>
- #include <linux/ethtool.h>
-diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
-index ecdf628e3bb89..d05bf6446a008 100644
---- a/drivers/net/ethernet/realtek/r8169_main.c
-+++ b/drivers/net/ethernet/realtek/r8169_main.c
-@@ -28,7 +28,6 @@
- #include <linux/pm_runtime.h>
- #include <linux/firmware.h>
- #include <linux/prefetch.h>
--#include <linux/pci-aspm.h>
- #include <linux/ipv6.h>
- #include <net/ip6_checksum.h>
-
-diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
-index c6156cc38940a..d5ee32ce9eb3d 100644
---- a/drivers/net/wireless/ath/ath5k/pci.c
-+++ b/drivers/net/wireless/ath/ath5k/pci.c
-@@ -18,7 +18,6 @@
-
- #include <linux/nl80211.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/etherdevice.h>
- #include <linux/module.h>
- #include "../ath.h"
-diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
-index d51a23815e186..20227f87025d1 100644
---- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
-+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
-@@ -33,7 +33,6 @@
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/slab.h>
- #include <linux/dma-mapping.h>
- #include <linux/delay.h>
-diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
-index 2b60473e7bf9c..bc5c2f4f9c51b 100644
---- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
-+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
-@@ -33,7 +33,6 @@
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/slab.h>
- #include <linux/dma-mapping.h>
- #include <linux/delay.h>
-diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
-index c69c13e762bbe..87235082acda7 100644
---- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
-+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
-@@ -67,7 +67,6 @@
- *
- *****************************************************************************/
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/interrupt.h>
- #include <linux/debugfs.h>
- #include <linux/sched.h>
-diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
-index 2777c459706a9..216a8f109be42 100644
---- a/drivers/pci/pci-acpi.c
-+++ b/drivers/pci/pci-acpi.c
-@@ -14,7 +14,6 @@
- #include <linux/msi.h>
- #include <linux/pci_hotplug.h>
- #include <linux/module.h>
--#include <linux/pci-aspm.h>
- #include <linux/pci-acpi.h>
- #include <linux/pm_runtime.h>
- #include <linux/pm_qos.h>
-diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index f2b5f3a8535e5..1f9e89c2c10d3 100644
---- a/drivers/pci/pcie/aspm.c
-+++ b/drivers/pci/pcie/aspm.c
-@@ -18,7 +18,6 @@
- #include <linux/slab.h>
- #include <linux/jiffies.h>
- #include <linux/delay.h>
--#include <linux/pci-aspm.h>
- #include "../pci.h"
-
- #ifdef MODULE_PARAM_PREFIX
-diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
-index 3a165710fbb86..db8d9cbc86bf6 100644
---- a/drivers/pci/quirks.c
-+++ b/drivers/pci/quirks.c
-@@ -20,7 +20,6 @@
- #include <linux/delay.h>
- #include <linux/acpi.h>
- #include <linux/dmi.h>
--#include <linux/pci-aspm.h>
- #include <linux/ioport.h>
- #include <linux/sched.h>
- #include <linux/ktime.h>
-diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
-index eecffc03084c0..c2748c07f9507 100644
---- a/drivers/scsi/aacraid/linit.c
-+++ b/drivers/scsi/aacraid/linit.c
-@@ -40,7 +40,6 @@
- #include <linux/moduleparam.h>
- #include <linux/pci.h>
- #include <linux/aer.h>
--#include <linux/pci-aspm.h>
- #include <linux/slab.h>
- #include <linux/mutex.h>
- #include <linux/spinlock.h>
-diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
-index 25d9bdd4bc698..77ed4324741fc 100644
---- a/drivers/scsi/hpsa.c
-+++ b/drivers/scsi/hpsa.c
-@@ -21,7 +21,6 @@
- #include <linux/interrupt.h>
- #include <linux/types.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/kernel.h>
- #include <linux/slab.h>
- #include <linux/delay.h>
-diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
-index bf659bc466dcc..78cf157fe2c19 100644
---- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
-+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
-@@ -51,7 +51,6 @@
- #include <linux/workqueue.h>
- #include <linux/delay.h>
- #include <linux/pci.h>
--#include <linux/pci-aspm.h>
- #include <linux/interrupt.h>
- #include <linux/aer.h>
- #include <linux/raid_class.h>
-diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h
-deleted file mode 100644
-index 67064145d76e0..0000000000000
---- a/include/linux/pci-aspm.h
-+++ /dev/null
-@@ -1,36 +0,0 @@
--/* SPDX-License-Identifier: GPL-2.0 */
--/*
-- * aspm.h
-- *
-- * PCI Express ASPM defines and function prototypes
-- *
-- * Copyright (C) 2007 Intel Corp.
-- * Zhang Yanmin (yanmin.zhang@intel.com)
-- * Shaohua Li (shaohua.li@intel.com)
-- *
-- * For more information, please consult the following manuals (look at
-- * http://www.pcisig.com/ for how to get them):
-- *
-- * PCI Express Specification
-- */
--
--#ifndef LINUX_ASPM_H
--#define LINUX_ASPM_H
--
--#include <linux/pci.h>
--
--#define PCIE_LINK_STATE_L0S 1
--#define PCIE_LINK_STATE_L1 2
--#define PCIE_LINK_STATE_CLKPM 4
--
--#ifdef CONFIG_PCIEASPM
--int pci_disable_link_state(struct pci_dev *pdev, int state);
--int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
--void pcie_no_aspm(void);
--#else
--static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
--{ return 0; }
--static inline void pcie_no_aspm(void) { }
--#endif
--
--#endif /* LINUX_ASPM_H */
-diff --git a/include/linux/pci.h b/include/linux/pci.h
-index 2636990e0cccf..f8036acf2c12b 100644
---- a/include/linux/pci.h
-+++ b/include/linux/pci.h
-@@ -6,12 +6,18 @@
- * Copyright 1994, Drew Eckhardt
- * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
- *
-+ * PCI Express ASPM defines and function prototypes
-+ * Copyright (c) 2007 Intel Corp.
-+ * Zhang Yanmin (yanmin.zhang@intel.com)
-+ * Shaohua Li (shaohua.li@intel.com)
-+ *
- * For more information, please consult the following manuals (look at
- * http://www.pcisig.com/ for how to get them):
- *
- * PCI BIOS Specification
- * PCI Local Bus Specification
- * PCI to PCI Bridge Specification
-+ * PCI Express Specification
- * PCI System Design Guide
- */
- #ifndef LINUX_PCI_H
-@@ -1490,9 +1496,21 @@ extern bool pcie_ports_native;
- #define pcie_ports_native false
- #endif
-
-+#define PCIE_LINK_STATE_L0S 1
-+#define PCIE_LINK_STATE_L1 2
-+#define PCIE_LINK_STATE_CLKPM 4
-+
- #ifdef CONFIG_PCIEASPM
-+int pci_disable_link_state(struct pci_dev *pdev, int state);
-+int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
-+void pcie_no_aspm(void);
- bool pcie_aspm_support_enabled(void);
- #else
-+static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
-+{ return 0; }
-+static inline int pci_disable_link_state_locked(struct pci_dev *pdev, int state)
-+{ return 0; }
-+static inline void pcie_no_aspm(void) { }
- static inline bool pcie_aspm_support_enabled(void) { return false; }
- #endif
-
---
-2.42.0
-
+++ /dev/null
-From 8b08bc1854f27aad6e9a7e1cadcaf24e39ec15c4 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 11 Oct 2023 09:36:40 +0200
-Subject: Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables
- L1"
-
-From: Heiner Kallweit <hkallweit1@gmail.com>
-
-[ Upstream commit 3cb4f534bac010258b2688395c2f13459a932be9 ]
-
-This reverts commit fb097dcd5a28c0a2325632405c76a66777a6bed9.
-
-After fb097dcd5a28 ("PCI/ASPM: Disable only ASPM_STATE_L1 when driver
-disables L1"), disabling L1 via pci_disable_link_state(PCIE_LINK_STATE_L1),
-then enabling one substate, e.g., L1.1, via sysfs actually enables *all*
-the substates.
-
-For example, r8169 disables L1 because of hardware issues on a number of
-systems, which implicitly disables the L1.1 and L1.2 substates.
-
-On some systems, L1 and L1.1 work fine, but L1.2 causes missed rx packets.
-Enabling L1.1 via the sysfs "aspm_l1_1" attribute unexpectedly enables L1.2
-as well as L1.1.
-
-After fb097dcd5a28, pci_disable_link_state(PCIE_LINK_STATE_L1) adds only
-ASPM_L1 (but not any of the L1.x substates) to the "aspm_disable" mask:
-
- --- Before fb097dcd5a28
- +++ After fb097dcd5a28
-
- # r8169 disables L1:
- pci_disable_link_state(PCIE_LINK_STATE_L1)
- - disable |= ASPM_L1 | ASPM_L1_1 | ASPM_L1_2 | ... # disable L1, L1.x
- + disable |= ASPM_L1 # disable L1 only
-
- # write "1" to sysfs "aspm_l1_1" attribute:
- l1_1_aspm
- aspm_attr_store_common(state = ASPM_L1_1)
- disable &= ~ASPM_L1_1 # enable L1.1
- if (state & (ASPM_L1_1 | ...)) # if enabling any substate
- disable &= ~ASPM_L1 # enable L1
-
- # final state:
- - disable = ASPM_L1_2 | ... # L1, L1.1 enabled; L1.2 disabled
- + disable = 0 # L1, L1.1, L1.2 all enabled
-
-Enabling an L1.x substate removes the substate and L1 from the
-"aspm_disable" mask. After fb097dcd5a28, the substates were not added to
-the mask when disabling L1, so enabling one substate implicitly enables all
-of them.
-
-Revert fb097dcd5a28 so enabling one substate doesn't enable the others.
-
-Link: https://lore.kernel.org/r/c75931ac-7208-4200-9ca1-821629cf5e28@gmail.com
-Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
-[bhelgaas: work through example in commit log]
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Cc: stable@vger.kernel.org
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/pcie/aspm.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index 8db6a9084a12a..8f934c88dcd76 100644
---- a/drivers/pci/pcie/aspm.c
-+++ b/drivers/pci/pcie/aspm.c
-@@ -1110,7 +1110,8 @@ static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
- if (state & PCIE_LINK_STATE_L0S)
- link->aspm_disable |= ASPM_STATE_L0S;
- if (state & PCIE_LINK_STATE_L1)
-- link->aspm_disable |= ASPM_STATE_L1;
-+ /* L1 PM substates require L1 */
-+ link->aspm_disable |= ASPM_STATE_L1 | ASPM_STATE_L1SS;
- if (state & PCIE_LINK_STATE_L1_1)
- link->aspm_disable |= ASPM_STATE_L1_1;
- if (state & PCIE_LINK_STATE_L1_2)
---
-2.42.0
-
perf-intel-pt-adjust-sample-flags-for-vm-exit.patch
perf-intel-pt-fix-async-branch-flags.patch
smb3-fix-touch-h-of-symlink.patch
-pci-let-pci_disable_link_state-propagate-errors.patch
-pci-move-aspm-declarations-to-linux-pci.h.patch
-pci-aspm-add-l1-pm-substate-support-to-pci_disable_l.patch
-pci-aspm-disable-only-aspm_state_l1-when-driver-disa.patch
-revert-pci-aspm-disable-only-aspm_state_l1-when-driv.patch
s390-mm-fix-phys-vs-virt-confusion-in-mark_kernel_px.patch
s390-cmma-fix-detection-of-dat-pages.patch
mtd-cfi_cmdset_0001-support-the-absence-of-protectio.patch