Message ID | 20230408022629.727721-1-david.e.box@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp643967vqo; Fri, 7 Apr 2023 19:58:21 -0700 (PDT) X-Google-Smtp-Source: AKy350ZNkQTxO9z/OeaISJPCtXROLO+AVexJ61SKPN6jMeBPfv7G0iFzeyS8zscJByebxalms5yW X-Received: by 2002:a17:90b:2250:b0:23d:1143:1e3c with SMTP id hk16-20020a17090b225000b0023d11431e3cmr4572116pjb.44.1680922701673; Fri, 07 Apr 2023 19:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680922701; cv=none; d=google.com; s=arc-20160816; b=J8ymI+NkZ8hn9AW0+PTp4rNnA1Das5Opo4GK+D1MDVgTXw3YV1sfhkSyd8A62gCiTJ OWyLckZLZDYS38x6ZaustisC9vgz9mvkQ4PVvs+PErZNisBFUx05omsGTVKGwAZzREV2 lX0SZGvGRfoBhKRZQDsLGWzn4P0iVAtPNaEaHMMytFAZriVH9A6odjylJMkqtDyDDY7t Y9lO7G5wJ4HMbllEuf6cRURsdYFr5HbC2IbAWj6wSJQSOQ7qSSnN/V87t6bn8TWmY05g TLVdxeDM3v1LelS5Ttmirnl8seRs1enIT5PD84qhh07gNKNeN+07Aq7qblmEs/vhAdlO h0Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/wZg+vzf89w0UDp9pCCoyjf8+Lut04fw+kOLJUnUJQU=; b=w1naqAHr7LCP6leIeYovP4W28LB202wK1HQhNcR+iwX7psSXfl76NyrX40l1dQSz8b SPCGR8GM0dqyvi+IlTJJBgX5INPqlm036kVZ05ykESGkt7qdF6d/l3Cli+z4fbh4Ce5F ZxYcm3GVuYWN9WnjH2I2BcmvujXDEXx6J+zHrfZj3LrTsGQLAcqrzID65q9Doa6g2yKU /C4jcVPPhAY7UCOW/SNDoglkwwlqa2usfhnzqK+OlwWTATVnDoBbKfBzEzUpH2M25Bim aB1es81NPltrIBHqwPHnkHoERP7ox9/TMXA2AzOMW4k4uIZAwcFITtzdzX771j+4XWbe Bwog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L36bI+GQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a17090acb1300b002449259314esi5312679pjt.158.2023.04.07.19.58.09; Fri, 07 Apr 2023 19:58:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L36bI+GQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbjDHC0c (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Fri, 7 Apr 2023 22:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjDHC0b (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 7 Apr 2023 22:26:31 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6831BCC1F; Fri, 7 Apr 2023 19:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680920790; x=1712456790; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DP/6n7B8aOJPPw9H6I1+IBM8O6GwGkK+AtSPpjSso4s=; b=L36bI+GQrna0oArrKWZy9MMhpQ2pNqNP+vQ0p056EGw9qll7YvgSXYqn 693uKt2/5Sr3/g0ejEzewKlbht8t7AWS67+9sjlv+9BN0AqwngAtzMV7x MxVpFQl9chy63druYDPqPaJDYmyRJnMLKH2h88lDl4srWs16wWSPRFpH5 GapQ+1w1uYkDXxAuHSdPKJUbbfF1rayiB7SgRk3SCYiXqHX5h2bfuTq0h fftAPqagFZIcYoMTKoW07F0YBjxjAXClF4zq378RQbDMJ83lnrWp1Jgxp 44LKRiTy+ZV5QDA2Cmq+mDRh1SSdm1oAU4CJHvoEituQGp+zVaxqVhuam w==; X-IronPort-AV: E=McAfee;i="6600,9927,10673"; a="323473923" X-IronPort-AV: E=Sophos;i="5.98,328,1673942400"; d="scan'208";a="323473923" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2023 19:26:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10673"; a="690214902" X-IronPort-AV: E=Sophos;i="5.98,328,1673942400"; d="scan'208";a="690214902" Received: from linux.intel.com ([10.54.29.200]) by fmsmga007.fm.intel.com with ESMTP; 07 Apr 2023 19:26:29 -0700 Received: from debox1-desk4.lan (unknown [10.251.23.166]) by linux.intel.com (Postfix) with ESMTP id A8F9558047E; Fri, 7 Apr 2023 19:26:29 -0700 (PDT) From: "David E. Box" <david.e.box@linux.intel.com> To: srinivas.pandruvada@linux.intel.com, irenic.rajneesh@gmail.com, david.e.box@intel.com, hdegoede@redhat.com, markgross@kernel.org, rjw@rjwysocki.net Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3 Date: Fri, 7 Apr 2023 19:26:29 -0700 Message-Id: <20230408022629.727721-1-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762575202743453211?= X-GMAIL-MSGID: =?utf-8?q?1762575202743453211?= |
Series |
platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3
|
|
Commit Message
David E. Box
April 8, 2023, 2:26 a.m. UTC
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(+)
base-commit: 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a
Comments
Hi David, kernel test robot noticed the following build warnings: [auto build test WARNING on 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a] url: https://github.com/intel-lab-lkp/linux/commits/David-E-Box/platform-x86-intel-pmc-mtl-Put-GNA-IPU-VPU-devices-in-D3/20230408-102651 base: 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a patch link: https://lore.kernel.org/r/20230408022629.727721-1-david.e.box%40linux.intel.com patch subject: [PATCH] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3 config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20230408/202304081211.S3RRROve-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/04453d42ee1b0c97f9fa68644c6234f7b9e2d14a git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review David-E-Box/platform-x86-intel-pmc-mtl-Put-GNA-IPU-VPU-devices-in-D3/20230408-102651 git checkout 04453d42ee1b0c97f9fa68644c6234f7b9e2d14a # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 olddefconfig make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202304081211.S3RRROve-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/platform/x86/intel/pmc/mtl.c:52:6: warning: no previous prototype for 'mtl_set_device_d3' [-Wmissing-prototypes] 52 | void mtl_set_device_d3(unsigned int device) | ^~~~~~~~~~~~~~~~~ vim +/mtl_set_device_d3 +52 drivers/platform/x86/intel/pmc/mtl.c 48 49 #define MTL_GNA_PCI_DEV 0x7e4c 50 #define MTL_IPU_PCI_DEV 0x7d19 51 #define MTL_VPU_PCI_DEV 0x7d1d > 52 void mtl_set_device_d3(unsigned int device) 53 { 54 struct pci_dev *pcidev; 55 56 pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL); 57 if (pcidev) { 58 if (!device_trylock(&pcidev->dev)) { 59 pci_dev_put(pcidev); 60 return; 61 } 62 if (!pcidev->dev.driver) { 63 dev_info(&pcidev->dev, "Setting to D3hot\n"); 64 pci_set_power_state(pcidev, PCI_D3hot); 65 } 66 device_unlock(&pcidev->dev); 67 pci_dev_put(pcidev); 68 } 69 } 70
Hi David, kernel test robot noticed the following build warnings: [auto build test WARNING on 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a] url: https://github.com/intel-lab-lkp/linux/commits/David-E-Box/platform-x86-intel-pmc-mtl-Put-GNA-IPU-VPU-devices-in-D3/20230408-102651 base: 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a patch link: https://lore.kernel.org/r/20230408022629.727721-1-david.e.box%40linux.intel.com patch subject: [PATCH] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3 config: i386-randconfig-a003-20230403 (https://download.01.org/0day-ci/archive/20230408/202304081356.jXr7C3fH-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/04453d42ee1b0c97f9fa68644c6234f7b9e2d14a git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review David-E-Box/platform-x86-intel-pmc-mtl-Put-GNA-IPU-VPU-devices-in-D3/20230408-102651 git checkout 04453d42ee1b0c97f9fa68644c6234f7b9e2d14a # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/platform/x86/intel/pmc/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202304081356.jXr7C3fH-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/platform/x86/intel/pmc/mtl.c:52:6: warning: no previous prototype for function 'mtl_set_device_d3' [-Wmissing-prototypes] void mtl_set_device_d3(unsigned int device) ^ drivers/platform/x86/intel/pmc/mtl.c:52:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void mtl_set_device_d3(unsigned int device) ^ static 1 warning generated. vim +/mtl_set_device_d3 +52 drivers/platform/x86/intel/pmc/mtl.c 48 49 #define MTL_GNA_PCI_DEV 0x7e4c 50 #define MTL_IPU_PCI_DEV 0x7d19 51 #define MTL_VPU_PCI_DEV 0x7d1d > 52 void mtl_set_device_d3(unsigned int device) 53 { 54 struct pci_dev *pcidev; 55 56 pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL); 57 if (pcidev) { 58 if (!device_trylock(&pcidev->dev)) { 59 pci_dev_put(pcidev); 60 return; 61 } 62 if (!pcidev->dev.driver) { 63 dev_info(&pcidev->dev, "Setting to D3hot\n"); 64 pci_set_power_state(pcidev, PCI_D3hot); 65 } 66 device_unlock(&pcidev->dev); 67 pci_dev_put(pcidev); 68 } 69 } 70
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
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a]
url: https://github.com/intel-lab-lkp/linux/commits/David-E-Box/platform-x86-intel-pmc-mtl-Put-GNA-IPU-VPU-devices-in-D3/20230408-102651
base: 4f59630a5ed0a4e7d275bd7e5d253a8f5a425c5a
patch link: https://lore.kernel.org/r/20230408022629.727721-1-david.e.box%40linux.intel.com
patch subject: [PATCH] platform/x86/intel/pmc/mtl: Put GNA/IPU/VPU devices in D3
config: x86_64-randconfig-s023-20230403 (https://download.01.org/0day-ci/archive/20230408/202304081931.gFShEdFu-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/04453d42ee1b0c97f9fa68644c6234f7b9e2d14a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review David-E-Box/platform-x86-intel-pmc-mtl-Put-GNA-IPU-VPU-devices-in-D3/20230408-102651
git checkout 04453d42ee1b0c97f9fa68644c6234f7b9e2d14a
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 olddefconfig
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/x86/intel/pmc/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304081931.gFShEdFu-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/platform/x86/intel/pmc/mtl.c:52:6: sparse: sparse: symbol 'mtl_set_device_d3' was not declared. Should it be static?
On Sat, 2023-04-08 at 10:57 +0200, Hans de Goede wrote: > 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 Thanks 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 >
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) +{ + 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); }