mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 01:16:18 +00:00
pm_rps: Add read back checking on sysfs writes
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
e07e758004
commit
0102b6bde6
@ -68,15 +68,20 @@ static int readval(FILE *filp)
|
|||||||
|
|
||||||
static int do_writeval(FILE *filp, int val, int lerrno)
|
static int do_writeval(FILE *filp, int val, int lerrno)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret, orig;
|
||||||
|
|
||||||
|
orig = readval(filp);
|
||||||
rewind(filp);
|
rewind(filp);
|
||||||
ret = fprintf(filp, "%d", val);
|
ret = fprintf(filp, "%d", val);
|
||||||
|
|
||||||
if (lerrno) {
|
if (lerrno) {
|
||||||
/* Expecting specific error */
|
/* Expecting specific error */
|
||||||
igt_assert(ret == EOF && errno == lerrno);
|
igt_assert(ret == EOF && errno == lerrno);
|
||||||
|
igt_assert(readval(filp) == orig);
|
||||||
} else {
|
} else {
|
||||||
/* Expecting no error */
|
/* Expecting no error */
|
||||||
igt_assert(ret != EOF);
|
igt_assert(ret != EOF);
|
||||||
|
igt_assert(readval(filp) == val);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user