* [PATCH V2] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3
@ 2023-04-09 19:25 David E. Box
2023-04-11 8:42 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: David E. Box @ 2023-04-09 19:25 UTC (permalink / raw)
To: srinivas.pandruvada, irenic.rajneesh, david.e.box, hdegoede,
markgross, rjw
Cc: platform-driver-x86, linux-kernel
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>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
V2 - Fix missing static reported by lkp
drivers/platform/x86/intel/pmc/mtl.c | 31 ++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c
index eeb3bd8c2502..33aa98b54049 100644
--- a/drivers/platform/x86/intel/pmc/mtl.c
+++ b/drivers/platform/x86/intel/pmc/mtl.c
@@ -8,6 +8,7 @@
*
*/
+#include <linux/pci.h>
#include "core.h"
const struct pmc_reg_map mtl_reg_map = {
@@ -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
+static 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);
}
base-commit: 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V2] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3
2023-04-09 19:25 [PATCH V2] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3 David E. Box
@ 2023-04-11 8:42 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2023-04-11 8:42 UTC (permalink / raw)
To: David E. Box, srinivas.pandruvada, irenic.rajneesh, david.e.box,
markgross, rjw
Cc: platform-driver-x86, linux-kernel
Hi,
On 4/9/23 21:25, David E. Box wrote:
> 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>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> ---
>
> V2 - Fix missing static reported by lkp
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
>
> drivers/platform/x86/intel/pmc/mtl.c | 31 ++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c
> index eeb3bd8c2502..33aa98b54049 100644
> --- a/drivers/platform/x86/intel/pmc/mtl.c
> +++ b/drivers/platform/x86/intel/pmc/mtl.c
> @@ -8,6 +8,7 @@
> *
> */
>
> +#include <linux/pci.h>
> #include "core.h"
>
> const struct pmc_reg_map mtl_reg_map = {
> @@ -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
> +static 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);
> }
>
> base-commit: 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-11 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-09 19:25 [PATCH V2] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3 David E. Box
2023-04-11 8:42 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).