From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: Jakub Kolakowski <jakub1.kolakowski@intel.com>,
igt-dev@lists.freedesktop.org
Cc: Adam Miszczak <adam.miszczak@linux.intel.com>,
Lukasz Laguna <lukasz.laguna@intel.com>
Subject: Re: [PATCH i-g-t] tests/intel/xe_pm: Add a check for power management capability
Date: Mon, 10 Mar 2025 09:19:02 +0100 [thread overview]
Message-ID: <97374906-44cb-4535-a736-10788938f02e@linux.intel.com> (raw)
In-Reply-To: <20250306190621.260153-1-jakub1.kolakowski@intel.com>
On 3/6/2025 8:06 PM, Jakub Kolakowski wrote:
> Add a check for power management capability of device tested. Currently
> if test is started on configuration that does not support the PM
> capability it doesn't skip, instead depending on test it may fail, abort
> or timeout.
> With this change test will skip with a clear message why it did.
>
> Cc: Adam Miszczak <adam.miszczak@linux.intel.com>
> Cc: Lukasz Laguna <lukasz.laguna@intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> Signed-off-by: Jakub Kolakowski <jakub1.kolakowski@intel.com>
> ---
> tests/intel/xe_pm.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c
> index c2026474d..049596ebc 100644
> --- a/tests/intel/xe_pm.c
> +++ b/tests/intel/xe_pm.c
> @@ -17,6 +17,7 @@
>
> #include "igt.h"
> #include "lib/igt_device.h"
> +#include "lib/igt_pci.h"
> #include "lib/igt_pm.h"
> #include "lib/igt_sysfs.h"
> #include "lib/igt_syncobj.h"
> @@ -38,6 +39,8 @@
> #define PREFETCH (0x1 << 1)
> #define UNBIND_ALL (0x1 << 2)
>
> +#define PCI_PM_CAP_ID 0x01
> +
> enum mem_op {
> READ,
> WRITE,
> @@ -779,6 +782,7 @@ igt_main
> device_t device;
> uint32_t d3cold_allowed;
> int sysfs_fd;
> + int offset;
>
> const struct s_state {
> const char *name;
> @@ -812,6 +816,11 @@ igt_main
> device.fd_xe = drm_open_driver(DRIVER_XE);
> device.pci_xe = igt_device_get_pci_device(device.fd_xe);
> device.pci_root = igt_device_get_pci_root_port(device.fd_xe);
> +
> + /* Make sure power management capability is present for device being tested */
> + offset = find_pci_cap_offset(device.pci_root, PCI_PM_CAP_ID);
> + igt_require_f(offset > 0, "PCI power management capability not found\n");
> +
Shouldn't this requirement apply only to D-states?
> igt_device_get_pci_slot_name(device.fd_xe, device.pci_slot_name);
>
> /* Always perform initial once-basic exec checking for health */
prev parent reply other threads:[~2025-03-10 8:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 19:06 [PATCH i-g-t] tests/intel/xe_pm: Add a check for power management capability Jakub Kolakowski
2025-03-07 5:44 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-03-07 6:03 ` ✓ i915.CI.BAT: " Patchwork
2025-03-07 7:45 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-07 18:23 ` ✗ Xe.CI.Full: " Patchwork
2025-03-10 8:19 ` Bernatowicz, Marcin [this message]
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=97374906-44cb-4535-a736-10788938f02e@linux.intel.com \
--to=marcin.bernatowicz@linux.intel.com \
--cc=adam.miszczak@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jakub1.kolakowski@intel.com \
--cc=lukasz.laguna@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