Skip to content

Commit

Permalink
platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3
Browse files Browse the repository at this point in the history
On Meteor Lake, the GNA, IPU, and VPU devices are booted in D0 power state
and will block the SoC from going into the deepest Package C-state if a
driver is not present. Put each device in D3hot if no driver is found.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
  • Loading branch information
debox1 authored and intel-lab-lkp committed Apr 8, 2023
1 parent 4f59630 commit 04453d4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions drivers/platform/x86/intel/pmc/mtl.c
Expand Up @@ -8,6 +8,7 @@
*
*/

#include <linux/pci.h>
#include "core.h"

const struct pmc_reg_map mtl_reg_map = {
Expand Down Expand Up @@ -45,8 +46,38 @@ void mtl_core_configure(struct pmc_dev *pmcdev)
pmc_core_send_ltr_ignore(pmcdev, 3);
}

#define MTL_GNA_PCI_DEV 0x7e4c
#define MTL_IPU_PCI_DEV 0x7d19
#define MTL_VPU_PCI_DEV 0x7d1d
void mtl_set_device_d3(unsigned int device)
{
struct pci_dev *pcidev;

pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL);
if (pcidev) {
if (!device_trylock(&pcidev->dev)) {
pci_dev_put(pcidev);
return;
}
if (!pcidev->dev.driver) {
dev_info(&pcidev->dev, "Setting to D3hot\n");
pci_set_power_state(pcidev, PCI_D3hot);
}
device_unlock(&pcidev->dev);
pci_dev_put(pcidev);
}
}

void mtl_core_init(struct pmc_dev *pmcdev)
{
pmcdev->map = &mtl_reg_map;
pmcdev->core_configure = mtl_core_configure;

/*
* Set power state of select devices that do not have drivers to D3
* so that they do not block Package C entry.
*/
mtl_set_device_d3(MTL_GNA_PCI_DEV);
mtl_set_device_d3(MTL_IPU_PCI_DEV);
mtl_set_device_d3(MTL_VPU_PCI_DEV);
}

0 comments on commit 04453d4

Please sign in to comment.