public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] lib/pm: Fail gracefully if CONFIG_PM is not built into the kernel
Date: Wed, 5 Sep 2018 16:01:04 +0100	[thread overview]
Message-ID: <764be659-3d3c-6f8b-da8d-ace2b49526f1@linux.intel.com> (raw)
In-Reply-To: <20180905090705.12829-1-chris@chris-wilson.co.uk>


On 05/09/2018 10:07, Chris Wilson wrote:
> We report the failure from igt_setup_runtime_pm() so that the caller can
> decide how they may proceed, so replace the hard assert with the error
> propagation.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Imre Deak <imre.deak@intel.com>
> ---
>   lib/igt_pm.c | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> index 615463a08..49027238b 100644
> --- a/lib/igt_pm.c
> +++ b/lib/igt_pm.c
> @@ -511,12 +511,16 @@ bool igt_setup_runtime_pm(void)
>   
>   	igt_pm_enable_audio_runtime_pm();
>   
> -	/* Our implementation uses autosuspend. Try to set it to 0ms so the test
> -	 * suite goes faster and we have a higher probability of triggering race
> -	 * conditions. */
> +	/*
> +	 * Our implementation uses autosuspend. Try to set it to 0ms so the
> +	 * test suite goes faster and we have a higher probability of
> +	 * triggering race conditions.
> +	 */
>   	fd = open(POWER_DIR "/autosuspend_delay_ms", O_RDWR);
> -	igt_assert_f(fd >= 0,
> -		     "Can't open " POWER_DIR "/autosuspend_delay_ms\n");
> +	if (fd < 0) {
> +		igt_pm_audio_restore_runtime_pm();
> +		return false;

Worth robustifying with an igt_assert_eq(errno, ENOENT) ?

Anyway a stretched concern:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

> +	}
>   
>   	/*
>   	 * Save previous values to be able to  install exit handler to restore
> @@ -531,6 +535,7 @@ bool igt_setup_runtime_pm(void)
>   	 */
>   	if (size <= 0) {
>   		close(fd);
> +		igt_pm_audio_restore_runtime_pm();
>   		return false;
>   	}
>   
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2018-09-05 15:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05  9:07 [igt-dev] [PATCH i-g-t] lib/pm: Fail gracefully if CONFIG_PM is not built into the kernel Chris Wilson
2018-09-05 12:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-09-05 15:01 ` Tvrtko Ursulin [this message]
2018-09-05 15:13   ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2018-09-06  8:51     ` Tvrtko Ursulin
2018-09-06  9:02       ` Chris Wilson
2018-09-05 15:39 ` [igt-dev] ✓ Fi.CI.IGT: success 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=764be659-3d3c-6f8b-da8d-ace2b49526f1@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@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