2023-01-20 04:18:06

by David E. Box

[permalink] [raw]
Subject: [PATCH V10 0/4] Enable PCIe ASPM and LTR on select hardware

This series adds a work around for enabling PCIe ASPM and for setting PCIe
LTR values on VMD reserved root ports on select platforms. While
configuration of these capabilities is usually done by BIOS, on these
platforms these capabilities will not be configured because the ports are
not visible to BIOS. This was part of an initial design that expected the
driver to completely handle the ports, including power management. However
on Linux those ports are still managed by the PCIe core, which has the
expectation that they adhere to device standards including BIOS
configuration, leading to this problem.

The target platforms are Tiger Lake, Alder Lake, and Raptor Lake though the
latter has already implemented support for configuring the LTR values.
Meteor Lake is expected add BIOS ASPM support, eliminating the future need
for this work around.

Note, the driver programs the LTRs because BIOS would also normally do this
for devices that do not set them by default. Without this, SoC power
management would be blocked on those platform. This SoC specific value is
the maximum latency required to allow the SoC to enter the deepest power
state.

This patch addresses the following open bugzillas on VMD enabled laptops
that cannot enter low power states.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=212355
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215063
Link: https://bugzilla.kernel.org/show_bug.cgi?id=213717

David E. Box (3):
PCI: vmd: Use PCI_VDEVICE in device list
PCI: vmd: Create feature grouping for client products
PCI: vmd: Add quirk to configure PCIe ASPM and LTR

Michael Bottini (1):
PCI/ASPM: Add pci_enable_link_state()

drivers/pci/controller/vmd.c | 97 ++++++++++++++++++++++++++----------
drivers/pci/pcie/aspm.c | 54 ++++++++++++++++++++
include/linux/pci.h | 7 +++
3 files changed, 132 insertions(+), 26 deletions(-)


base-commit: 5dc4c995db9eb45f6373a956eb1f69460e69e6d4
--
2.34.1


2023-01-20 04:29:07

by David E. Box

[permalink] [raw]
Subject: [PATCH V10 3/4] PCI: vmd: Create feature grouping for client products

Simplify the device ID list by creating a grouping of features shared by
client products.

Suggested-by: Jon Derrick <[email protected]>
Signed-off-by: David E. Box <[email protected]>
---
V10 - No change.

V9 - No change.

V8 - New patch.

drivers/pci/controller/vmd.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 1fc3f2174359..47fa3e5f2dc5 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -68,6 +68,10 @@ enum vmd_features {
VMD_FEAT_CAN_BYPASS_MSI_REMAP = (1 << 4),
};

+#define VMD_FEATS_CLIENT (VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP | \
+ VMD_FEAT_HAS_BUS_RESTRICTIONS | \
+ VMD_FEAT_OFFSET_FIRST_VECTOR)
+
static DEFINE_IDA(vmd_instance_ida);

/*
@@ -1024,29 +1028,17 @@ static const struct pci_device_id vmd_ids[] = {
VMD_FEAT_HAS_BUS_RESTRICTIONS |
VMD_FEAT_CAN_BYPASS_MSI_REMAP,},
{PCI_VDEVICE(INTEL, 0x467f),
- .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
- VMD_FEAT_HAS_BUS_RESTRICTIONS |
- VMD_FEAT_OFFSET_FIRST_VECTOR,},
+ .driver_data = VMD_FEATS_CLIENT,},
{PCI_VDEVICE(INTEL, 0x4c3d),
- .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
- VMD_FEAT_HAS_BUS_RESTRICTIONS |
- VMD_FEAT_OFFSET_FIRST_VECTOR,},
+ .driver_data = VMD_FEATS_CLIENT,},
{PCI_VDEVICE(INTEL, 0xa77f),
- .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
- VMD_FEAT_HAS_BUS_RESTRICTIONS |
- VMD_FEAT_OFFSET_FIRST_VECTOR,},
+ .driver_data = VMD_FEATS_CLIENT,},
{PCI_VDEVICE(INTEL, 0x7d0b),
- .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
- VMD_FEAT_HAS_BUS_RESTRICTIONS |
- VMD_FEAT_OFFSET_FIRST_VECTOR,},
+ .driver_data = VMD_FEATS_CLIENT,},
{PCI_VDEVICE(INTEL, 0xad0b),
- .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
- VMD_FEAT_HAS_BUS_RESTRICTIONS |
- VMD_FEAT_OFFSET_FIRST_VECTOR,},
+ .driver_data = VMD_FEATS_CLIENT,},
{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_VMD_9A0B),
- .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
- VMD_FEAT_HAS_BUS_RESTRICTIONS |
- VMD_FEAT_OFFSET_FIRST_VECTOR,},
+ .driver_data = VMD_FEATS_CLIENT,},
{0,}
};
MODULE_DEVICE_TABLE(pci, vmd_ids);
--
2.34.1

Subject: Re: [PATCH V10 0/4] Enable PCIe ASPM and LTR on select hardware



On 1/19/23 7:15 PM, David E. Box wrote:
> This series adds a work around for enabling PCIe ASPM and for setting PCIe
> LTR values on VMD reserved root ports on select platforms. While
> configuration of these capabilities is usually done by BIOS, on these
> platforms these capabilities will not be configured because the ports are
> not visible to BIOS. This was part of an initial design that expected the
> driver to completely handle the ports, including power management. However
> on Linux those ports are still managed by the PCIe core, which has the
> expectation that they adhere to device standards including BIOS
> configuration, leading to this problem.
>
> The target platforms are Tiger Lake, Alder Lake, and Raptor Lake though the
> latter has already implemented support for configuring the LTR values.
> Meteor Lake is expected add BIOS ASPM support, eliminating the future need
> for this work around.
>
> Note, the driver programs the LTRs because BIOS would also normally do this
> for devices that do not set them by default. Without this, SoC power
> management would be blocked on those platform. This SoC specific value is
> the maximum latency required to allow the SoC to enter the deepest power
> state.
>
> This patch addresses the following open bugzillas on VMD enabled laptops
> that cannot enter low power states.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=212355
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=215063
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=213717
>

Looks good to me.

Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>

> David E. Box (3):
> PCI: vmd: Use PCI_VDEVICE in device list
> PCI: vmd: Create feature grouping for client products
> PCI: vmd: Add quirk to configure PCIe ASPM and LTR
>
> Michael Bottini (1):
> PCI/ASPM: Add pci_enable_link_state()
>
> drivers/pci/controller/vmd.c | 97 ++++++++++++++++++++++++++----------
> drivers/pci/pcie/aspm.c | 54 ++++++++++++++++++++
> include/linux/pci.h | 7 +++
> 3 files changed, 132 insertions(+), 26 deletions(-)
>
>
> base-commit: 5dc4c995db9eb45f6373a956eb1f69460e69e6d4

--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

2023-02-02 15:07:22

by Lorenzo Pieralisi

[permalink] [raw]
Subject: Re: [PATCH V10 0/4] Enable PCIe ASPM and LTR on select hardware

On Thu, 19 Jan 2023 19:15:18 -0800, David E. Box wrote:
> This series adds a work around for enabling PCIe ASPM and for setting PCIe
> LTR values on VMD reserved root ports on select platforms. While
> configuration of these capabilities is usually done by BIOS, on these
> platforms these capabilities will not be configured because the ports are
> not visible to BIOS. This was part of an initial design that expected the
> driver to completely handle the ports, including power management. However
> on Linux those ports are still managed by the PCIe core, which has the
> expectation that they adhere to device standards including BIOS
> configuration, leading to this problem.
>
> [...]

Applied to pci/controller/vmd, thanks!

[1/4] PCI/ASPM: Add pci_enable_link_state()
https://git.kernel.org/pci/pci/c/de82f60f9c86
[2/4] PCI: vmd: Use PCI_VDEVICE in device list
https://git.kernel.org/pci/pci/c/cca0dfecdba3
[3/4] PCI: vmd: Create feature grouping for client products
https://git.kernel.org/pci/pci/c/14d2079af648
[4/4] PCI: vmd: Add quirk to configure PCIe ASPM and LTR
https://git.kernel.org/pci/pci/c/f492edb40b54

Thanks,
Lorenzo