public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/4] lib/igt_psr: Unset errno when expected
@ 2019-11-13 22:39 José Roberto de Souza
  2019-11-13 22:39 ` [igt-dev] [PATCH i-g-t 2/4] tests/i915_pm_dc: Use psr_sink_support of reimplement it again José Roberto de Souza
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: José Roberto de Souza @ 2019-11-13 22:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Jeevan B

Writing 0xf to i915_edp_psr_debug is expected to have -EINVAL
returned in newer kernels but this error actually comes from errno
not from the return of write()(check writeN()), so unseting the
expected errno so this do not cause tests to skips.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=112257
Cc: Jeevan B <jeevan.b@intel.com>
Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 lib/igt_psr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 6d192689..83ccacdd 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -72,9 +72,10 @@ static int has_psr_debugfs(int debugfs_fd)
 	 * -ENODEV is returned when PSR is unavailable.
 	 */
 	ret = psr_write(debugfs_fd, "0xf");
-	if (ret == -EINVAL)
+	if (ret == -EINVAL) {
+		errno = 0;
 		return 0;
-	else if (ret < 0)
+	} else if (ret < 0)
 		return ret;
 
 	/* legacy debugfs api, we enabled irqs by writing, disable them. */
-- 
2.24.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-14 22:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-13 22:39 [igt-dev] [PATCH i-g-t 1/4] lib/igt_psr: Unset errno when expected José Roberto de Souza
2019-11-13 22:39 ` [igt-dev] [PATCH i-g-t 2/4] tests/i915_pm_dc: Use psr_sink_support of reimplement it again José Roberto de Souza
2019-11-13 22:39 ` [igt-dev] [PATCH i-g-t 3/4] tests/i915_pm_dc: Simplify runtime pm handling José Roberto de Souza
2019-11-14  8:09   ` Arkadiusz Hiler
2019-11-13 22:39 ` [igt-dev] [PATCH i-g-t 4/4] lib/igt_psr: Move "is enabled" implementation to lib José Roberto de Souza
2019-11-14  1:46 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] lib/igt_psr: Unset errno when expected Patchwork
2019-11-14 22:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox