From: Hans de Goede <hdegoede@redhat.com>
To: "David E. Box" <david.e.box@linux.intel.com>,
srinivas.pandruvada@linux.intel.com, irenic.rajneesh@gmail.com,
david.e.box@intel.com, markgross@kernel.org, rjw@rjwysocki.net
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3
Date: Sat, 8 Apr 2023 10:57:53 +0200 [thread overview]
Message-ID: <f7a20a10-3871-8b2d-251f-35b0136d684d@redhat.com> (raw)
In-Reply-To: <20230408022629.727721-1-david.e.box@linux.intel.com>
Hi David,
On 4/8/23 04:26, 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>
> ---
> 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
> +void mtl_set_device_d3(unsigned int device)
As pointed out by "kernel test robot <lkp@intel.com>" this needs to
be static. Otherwise this LGTM. With this fixed please add my:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
to version 2 of the patch.
Regards,
Hans
> +{
> + 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
next prev parent reply other threads:[~2023-04-08 8:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-08 2:26 David E. Box
2023-04-08 4:19 ` kernel test robot
2023-04-08 5:31 ` kernel test robot
2023-04-08 8:57 ` Hans de Goede [this message]
2023-04-09 19:14 ` David E. Box
2023-04-08 11:50 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7a20a10-3871-8b2d-251f-35b0136d684d@redhat.com \
--to=hdegoede@redhat.com \
--cc=david.e.box@intel.com \
--cc=david.e.box@linux.intel.com \
--cc=irenic.rajneesh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®