[6/8] lib/igt_pm: turn absence of autosuspend_delay_ms from fail to skip

Submitted by Ulrich Hecht on March 15, 2018, 2:45 p.m.

Details

Message ID 1521125144-28614-7-git-send-email-ulrich.hecht+renesas@gmail.com
State New
Series "Non-Intel test suite fixes"
Headers show

Commit Message

Ulrich Hecht March 15, 2018, 2:45 p.m.
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@gmail.com>
---
 lib/igt_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);
-	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

Comments

Ville Syrjala March 15, 2018, 5:43 p.m.
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@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx