Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] test/i915_pm_rpm: Verify bridge binds with pcieport driver
@ 2022-10-31 13:56 Anshuman Gupta
  2022-10-31 17:04 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
  2022-11-01 16:25 ` [igt-dev] [PATCH i-g-t] " Rodrigo Vivi
  0 siblings, 2 replies; 3+ messages in thread
From: Anshuman Gupta @ 2022-10-31 13:56 UTC (permalink / raw)
  To: igt-dev; +Cc: badal.nilawar, rodrigo.vivi

It has been observed that on some Intel x86 host PCI core
does not bind the Intel dgfx catds's pci bridge
devices(virtual switch port) to the pcieport driver.
This leaves the pci bridge devices to D0 state and
burns power on dgfx card.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/i915/i915_pm_rpm.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index 1ff69a060a..92c30ae791 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -1545,12 +1545,12 @@ static void reg_read_ioctl_subtest(void)
 	igt_assert(wait_for_suspended());
 }
 
-static bool device_in_pci_d3(void)
+static bool device_in_pci_d3(struct pci_device *pci_dev)
 {
 	uint16_t val;
 	int rc;
 
-	rc = pci_device_cfg_read_u16(igt_device_get_pci_device(drm_fd), &val, 0xd4);
+	rc = pci_device_cfg_read_u16(pci_dev, &val, 0xd4);
 	igt_assert_eq(rc, 0);
 
 	igt_debug("%s: PCI D3 state=%d\n", __func__, val & 0x3);
@@ -1559,10 +1559,18 @@ static bool device_in_pci_d3(void)
 
 static void pci_d3_state_subtest(void)
 {
+	struct pci_device *pci_dev, *bridge_pci_dev;
+
 	igt_require(has_runtime_pm);
 
+	pci_dev = igt_device_get_pci_device(drm_fd);
+	bridge_pci_dev = pci_device_get_parent_bridge(pci_dev);
+
 	disable_all_screens_and_wait(&ms_data);
-	igt_assert(igt_wait(device_in_pci_d3(), 2000, 100));
+	igt_assert(igt_wait(device_in_pci_d3(pci_dev), 2000, 100));
+
+	if (gem_has_lmem(drm_fd))
+		igt_require((pci_device_has_kernel_driver(bridge_pci_dev));
 
 	enable_one_screen_or_forcewake_get_and_wait(&ms_data);
 	igt_assert(!device_in_pci_d3());
-- 
2.38.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-01 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-31 13:56 [igt-dev] [PATCH i-g-t] test/i915_pm_rpm: Verify bridge binds with pcieport driver Anshuman Gupta
2022-10-31 17:04 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
2022-11-01 16:25 ` [igt-dev] [PATCH i-g-t] " Rodrigo Vivi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox