[Intel-gfx] [PATCH 1/3] pm_rps: Add read back checking on sysfs writes

jeff.mcgee at intel.com jeff.mcgee at intel.com
Fri Jan 17 23:56:04 CET 2014


From: Jeff McGee <jeff.mcgee at intel.com>

Signed-off-by: Jeff McGee <jeff.mcgee at intel.com>
---
 tests/pm_rps.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index 7c739b6..ec07dd2 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -68,15 +68,20 @@ static int readval(FILE *filp)
 
 static int do_writeval(FILE *filp, int val, int lerrno)
 {
-	int ret;
+	int ret, orig;
+
+	orig = readval(filp);
 	rewind(filp);
 	ret = fprintf(filp, "%d", val);
+
 	if (lerrno) {
 		/* Expecting specific error */
 		igt_assert(ret == EOF && errno == lerrno);
+		igt_assert(readval(filp) == orig);
 	} else {
 		/* Expecting no error */
 		igt_assert(ret != EOF);
+		igt_assert(readval(filp) == val);
 	}
 
 	return ret;
-- 
1.8.5.2




More information about the Intel-gfx mailing list