All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gupta, Anshuman" <anshuman.gupta@intel.com>
To: "Tauro, Riana" <riana.tauro@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] tests/i915/i915_suspend: Disable d3cold_allowed for basic-s2idle-without-i915
Date: Thu, 8 Sep 2022 15:28:56 +0000	[thread overview]
Message-ID: <CY5PR11MB6211D2F2EE0EABBD5C76FE0195409@CY5PR11MB6211.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220908144609.2878575-3-riana.tauro@intel.com>



> -----Original Message-----
> From: Tauro, Riana <riana.tauro@intel.com>
> Sent: Thursday, September 8, 2022 8:16 PM
> To: igt-dev@lists.freedesktop.org
> Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman
> <anshuman.gupta@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>
> Subject: [PATCH i-g-t 2/2] tests/i915/i915_suspend: Disable d3cold_allowed for
> basic-s2idle-without-i915
> 
> When module is unloaded and s2idle is triggered, PCI core leaves the endpoint in
> D0 and the bridge in D3 state causing PCIE spec violation. The config space is
> read as 0xFF
> 
> Keep the bridge in D0 before module unload to prevent this issue
> 
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
>  tests/i915/i915_suspend.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/tests/i915/i915_suspend.c b/tests/i915/i915_suspend.c index
> 94935595..a6769d64 100644
> --- a/tests/i915/i915_suspend.c
> +++ b/tests/i915/i915_suspend.c
> @@ -43,6 +43,7 @@
>  #include "igt.h"
>  #include "igt_kmod.h"
>  #include "igt_device.h"
> +#include "igt_device_scan.h"
> 
>  #define OBJECT_SIZE (16*1024*1024)
> 
> @@ -206,13 +207,40 @@ test_forcewake(int fd, bool hibernate)  static void
> test_suspend_without_i915(int state)  {
> +	struct igt_device_card card;
> +	char d3cold_allowed[2];
> +	int fd;
Why do we need fd ?
> +
> +	fd = __drm_open_driver(DRIVER_INTEL);
> +	igt_devices_scan(false);
> +
> +	/*
> +	 * When module is unloaded and s2idle is triggered,
> +	 * PCI core leaves the endpoint in D0 and the bridge in
> +	 * D3 state causing PCIE spec violation.
> +	 *
> +	 * Keep the bridge in D0 before module unload to prevent
> +	 * this issue
> +	 **/
Comment style need to change.
Anshuman.
> +	if (state == SUSPEND_STATE_FREEZE &&
> +	    igt_device_find_first_i915_discrete_card(&card)) {
> +		igt_pm_get_d3cold_allowed(&card, d3cold_allowed);
> +		igt_pm_set_d3cold_allowed(&card, "0\n");
> +	}
> +	close(fd);
> +
>  	igt_kmsg(KMSG_INFO "Unloading i915\n");
>  	igt_assert_eq(igt_i915_driver_unload(),0);
> 
>  	igt_system_suspend_autoresume(state, SUSPEND_TEST_NONE);
> 
> +	if (state == SUSPEND_STATE_FREEZE && strlen(card.card))
> +		igt_pm_set_d3cold_allowed(&card, d3cold_allowed);
> +
>  	igt_kmsg(KMSG_INFO "Re-loading i915 \n");
>  	igt_assert_eq(igt_i915_driver_load(NULL), 0);
> +
> +	igt_devices_free();
>  }
> 
>  int fd;
> --
> 2.25.1

  reply	other threads:[~2022-09-08 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 14:46 [igt-dev] [PATCH i-g-t 0/2] Disable d3cold_allowed for basic-s2idle-without-i915 Riana Tauro
2022-09-08 14:46 ` [igt-dev] [PATCH i-g-t 1/2] lib/igt_pm : Add pm functions for d3cold_allowed Riana Tauro
2022-09-08 15:09   ` Gupta, Anshuman
2022-09-08 16:41     ` Tauro, Riana
2022-09-08 14:46 ` [igt-dev] [PATCH i-g-t 2/2] tests/i915/i915_suspend: Disable d3cold_allowed for basic-s2idle-without-i915 Riana Tauro
2022-09-08 15:28   ` Gupta, Anshuman [this message]
2022-09-08 16:39     ` Tauro, Riana
2022-09-08 15:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

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=CY5PR11MB6211D2F2EE0EABBD5C76FE0195409@CY5PR11MB6211.namprd11.prod.outlook.com \
    --to=anshuman.gupta@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.