[Intel-gfx] [PATCH igt 6/8] lib/igt_pm: turn absence of autosuspend_delay_ms from fail to skip

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Mar 15 17:43:23 UTC 2018


On Thu, Mar 15, 2018 at 03:45:42PM +0100, Ulrich Hecht wrote:
> Fixes false negatives on everything that doesn't happen to be at a
> specific hard-coded sysfs path...
> 
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas at gmail.com>
> ---
>  lib/igt_pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> index 5bf5b2e..641157b 100644
> --- a/lib/igt_pm.c
> +++ b/lib/igt_pm.c
> @@ -262,7 +262,7 @@ bool igt_setup_runtime_pm(void)
>  	 * suite goes faster and we have a higher probability of triggering race
>  	 * conditions. */
>  	fd = open(POWER_DIR "/autosuspend_delay_ms", O_WRONLY);

The hardocded path should probably go then.

igt_sysfs_path() + "/device/power" looks like it should dtrt.
Would need to plumb the fd down though. Hopefully every caller
has it handy.

> -	igt_assert_f(fd >= 0,
> +	igt_require_f(fd >= 0,
>  		     "Can't open " POWER_DIR "/autosuspend_delay_ms\n");
>  
>  	/* If we fail to write to the file, it means this system doesn't support
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list