Re: [PATCH i-g-t 2/2] tests/drv_suspend: Add subtests to check that forcewake is kept after resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Ewelina Musial (2017-07-25 16:26:09)
> In some cases we observed that forcewake isn't kept after
> resume and checking RC6 residency is a simple way to verify that.
> If forcewake is kept after resume residency should be constant.
> 
> Cc: Lukasz Fiedorowicz <lukasz.fiedorowicz@xxxxxxxxx>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@xxxxxxxxx>
> Cc: Michal Winiarski <michal.winiarski@xxxxxxxxx>
> Signed-off-by: Ewelina Musial <ewelina.musial@xxxxxxxxx>
> ---
>  tests/drv_suspend.c | 36 ++++++++++++++++++++++++++++++++----
>  1 file changed, 32 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/drv_suspend.c b/tests/drv_suspend.c
> index 2e39f20a..0c576055 100644
> --- a/tests/drv_suspend.c
> +++ b/tests/drv_suspend.c
> @@ -36,6 +36,9 @@
>  #include <errno.h>
>  #include <sys/stat.h>
>  #include <sys/ioctl.h>
> +#include "igt_sysfs.h"
> +#include "igt_aux.h"
> +#include <time.h>
>  
>  #include <drm.h>
>  
> @@ -160,8 +163,9 @@ test_sysfs_reader(bool hibernate)
>         igt_stop_helper(&reader);
>  }
>  
> +#define SLEEP_DURATION 3
>  static void
> -test_forcewake(int fd, bool hibernate)
> +test_forcewake(int fd, bool hibernate, bool residency)
>  {
>         int fw_fd;
>  
> @@ -174,8 +178,26 @@ test_forcewake(int fd, bool hibernate)
>         else
>                 igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
>                                               SUSPEND_TEST_NONE);
> +    if (residency)
> +    {
> +        int sysfs;
> +        uint32_t residency_pre, residency_post;
>  
> -       close (fw_fd);
> +        sysfs = igt_sysfs_open(fd, NULL);
> +        igt_assert_lte(0, sysfs);
> +        sleep(1); // time to fully resume

rc6 is not universal, failing just because it is not supported after
suspending/hibernate does not make for happy users.

You have the power to add additional sanity checks to the kernel and
report the failure via close() without resorting to indirect checks and
fragile assumptions.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux