Skip to contentSkip to conversation

lib/igt_debugfs: Add timeouts to opening pipe CRC fd.

PATCH In review Maarten Lankhorst 5 participants 13 messages Apr 5, 2018 – May 24, 2018

Subsystems (3)
lore
Share & tools
lore

Maarten Lankhorst

author maintainer
#0 lore raw

PATCH 1/1 lib/igt_debugfs: Add timeouts to opening pipe CRC fd.

This will fix the PSR tests to fail slightly faster, since they wait indefinitely for a CRC that never comes during open.

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +3 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
 
 	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+	igt_set_timeout(5, "Opening crc fd, which waits for first CRC.");
 	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
+	igt_reset_timeout();
+
 	igt_assert(pipe_crc->crc_fd != -1);
 	errno = 0;
 }
Signature · 6 lines
2.16.3

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_debugfs: Add timeouts to opening pipe CRC fd.

== Series Details ==

== Series Details ==

Series: lib/igt_debugfs: Add timeouts to opening pipe CRC fd.
URL : https://patchwork.freedesktop.org/series/41200/
State : failure

== Summary ==

IGT patchset tested on top of latest successful build 164b4a3ab34bd7d18d34181c62bfaedb906a76e3 blacklist: Don't run tests on pipe-d, pipe-e or pipe-f

with latest DRM-Tip kernel build CI_DRM_4025
0eddede73765 drm-tip: 2018y-04m-05d-09h-51m-03s UTC integration manifest

No testlist changes.

---- Possible new issues:

Test kms_pipe_crc_basic:

        Subgroup nonblocking-crc-pipe-b:
                pass       -> FAIL       (fi-cfl-s3)

---- Known issues:

Test gem_mmap_gtt:

        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                dmesg-warn -> PASS       (fi-glk-j4005) fdo#105644
Test prime_vgem:
        Subgroup basic-fence-flip:
                fail       -> PASS       (fi-ilk-650) fdo#104008

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#105644 https://bugs.freedesktop.org/show_bug.cgi?id=105644
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:431s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:444s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:388s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:539s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:297s
fi-bxt-dsi       total:285  pass:255  dwarn:0   dfail:0   fail:0   skip:30  time:515s
fi-bxt-j4205     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:516s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:522s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:510s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:412s
fi-cfl-s3        total:285  pass:258  dwarn:0   dfail:0   fail:1   skip:26  time:561s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:514s
fi-cnl-y3        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:587s
fi-elk-e7500     total:285  pass:226  dwarn:0   dfail:0   fail:0   skip:59  time:427s
fi-gdg-551       total:285  pass:177  dwarn:0   dfail:0   fail:0   skip:108 time:316s
fi-glk-1         total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:539s
fi-glk-j4005     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:496s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:404s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:423s
fi-ivb-3520m     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:462s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:430s
fi-kbl-7500u     total:285  pass:260  dwarn:1   dfail:0   fail:0   skip:24  time:474s
fi-kbl-7567u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:462s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:510s
fi-pnv-d510      total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:665s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:440s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:535s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:507s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:504s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:429s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:452s
fi-snb-2520m     total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:583s
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:401s

Blacklisted hosts:
fi-cnl-psr total:285 pass:256 dwarn:3 dfail:0 fail:0 skip:26 time:533s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1226/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw
In reply to Maarten Lankhorst
Quoted 13 lines · Maarten Lankhorst

This will fix the PSR tests to fail slightly faster, since they wait indefinitely for a CRC that never comes during open.

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +0 -0
index 8adc02e9cc47..094df564b6f4 100644

lib/igt_debugfs.c void igt_pipe_crc_start(igt_pipe_crc_t · line 765

Quoted 9 lines
lib/igt_debugfs.c +2 -0
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
 *pipe_crc)
 
 	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+	igt_set_timeout(5, "Opening crc fd, which waits for first
 CRC.");
 	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
 >flags);
+	igt_reset_timeout();

Hum I was able to reproduce this one too in a KBL, I was thinking in add a timeout in the kernel side, if it don't get the CRC buffer filled it would return a error.

lib/igt_debugfs.c void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc) · line 766

Quoted 4 lines
lib/igt_debugfs.c +1 -0
+
lib/igt_debugfs.c +0 -0
 	igt_assert(pipe_crc->crc_fd != -1);
 	errno = 0;
 }

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 21 lines · Maarten Lankhorst
Quoted 20 lines

This will fix the PSR tests to fail slightly faster, since they wait indefinitely for a CRC that never comes during open.

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +1 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
 *pipe_crc)
 
      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+     igt_set_timeout(5, "Opening crc fd, which waits for first
 CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
Quoted 6 lines

lib/igt_debugfs.c void igt_pipe_crc_start(igt_pipe_crc_t · line 765

Quoted 2 lines
lib/igt_debugfs.c +1 -0
 >flags);
+     igt_reset_timeout();

Hum I was able to reproduce this one too in a KBL, I was thinking in add a timeout in the kernel side, if it don't get the CRC buffer filled it would return a error.

That would be unexpected behaviour for a read() interface. If you want a timeout, implement poll().
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw
Quoted 34 lines · Chris Wilson

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 25 lines · Maarten Lankhorst
Quoted 24 lines

This will fix the PSR tests to fail slightly faster, since they wait
indefinitely for a CRC that never comes during open.

om>

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +1 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
 *pipe_crc)
 
      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+     igt_set_timeout(5, "Opening crc fd, which waits for first
 CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
 > flags);
Quoted 7 lines

lib/igt_debugfs.c void igt_pipe_crc_start(igt_pipe_crc_t · line 765

Quoted 1 line
lib/igt_debugfs.c +1 -0
+     igt_reset_timeout();

Hum I was able to reproduce this one too in a KBL, I was thinking in
add a timeout in the kernel side, if it don't get the CRC buffer filled
it would return a error.

Quoted 3 lines

That would be unexpected behaviour for a read() interface. If you want a
timeout, implement poll().

Not change the read() but return a error in open() when timeout happens:

"

(quoted diff) +0 -0

b/drivers/gpu/drm/drm_debugfs_crc.c
index 9f8312137cad..223cd45b3aff 100644

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
@@ -206,9 +206,10 @@ static int crtc_crc_open(struct inode *inode,

struct file *filep)
* guess when this particular piece of HW will be ready to
start
* generating CRCs.
*/
- ret = wait_event_interruptible_lock_irq(crc->wq,
- crtc_crc_data_count(cr
c),
- crc->lock);
+ ret = wait_event_interruptible_lock_irq_timeout(crc->wq,
+ crtc_crc_data_
count(crc),
+ crc->lock,
+ msecs_to_jiffi
es(2500));
spin_unlock_irq(&crc->lock);

if (ret)
"

Quoted 1 line

-Chris

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#5 lore raw
Quoted 6 lines · Jose
Quoted 5 lines · Chris Wilson

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 4 lines · Maarten Lankhorst
Quoted 3 lines

This will fix the PSR tests to fail slightly faster, since they wait
indefinitely for a CRC that never comes during open.

Because the pipe is not active and hence doesn't generate crc's any more? The timeouts are needed but any idea how we should deal with the lack of CRCs?

Quoted 64 lines
Quoted 29 lines
Quoted 21 lines
Quoted 21 lines

om>

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +1 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
 *pipe_crc)
 
      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+     igt_set_timeout(5, "Opening crc fd, which waits for first
 CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
 > flags);
Quoted 7 lines

lib/igt_debugfs.c void igt_pipe_crc_start(igt_pipe_crc_t · line 765

Quoted 1 line
lib/igt_debugfs.c +1 -0
+     igt_reset_timeout();

Hum I was able to reproduce this one too in a KBL, I was thinking in
add a timeout in the kernel side, if it don't get the CRC buffer filled
it would return a error.

Quoted 3 lines

That would be unexpected behaviour for a read() interface. If you want a
timeout, implement poll().

Not change the read() but return a error in open() when timeout happens:

"

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
index 9f8312137cad..223cd45b3aff 100644
@@ -206,9 +206,10 @@ static int crtc_crc_open(struct inode *inode,
 struct file *filep)
 	 * guess when this particular piece of HW will be ready to

start

drivers/gpu/drm/drm_debugfs_crc.c +0 -2
 	 * generating CRCs.
 	 */
-	ret = wait_event_interruptible_lock_irq(crc->wq,
-						crtc_crc_data_count(cr

c),

drivers/gpu/drm/drm_debugfs_crc.c +2 -1
-						crc->lock);
+	ret = wait_event_interruptible_lock_irq_timeout(crc->wq,
+							crtc_crc_data_

count(crc),

drivers/gpu/drm/drm_debugfs_crc.c +2 -0
+							crc->lock,
+							msecs_to_jiffi

es(2500));

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
 	spin_unlock_irq(&crc->lock);
 
 	if (ret)

"

Quoted 5 lines
Quoted 1 line

-Chris

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

author maintainer
#6 lore raw

Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan:

Quoted 66 lines · Jose
Quoted 6 lines · Chris Wilson
Quoted 5 lines

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 4 lines · Maarten Lankhorst
Quoted 3 lines

This will fix the PSR tests to fail slightly faster, since they wait
indefinitely for a CRC that never comes during open.

Because the pipe is not active and hence doesn't generate crc's any more? The timeouts are needed but any idea how we should deal with the lack of CRCs?

Quoted 55 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines

om>

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +2 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
 *pipe_crc)
 
      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+     igt_set_timeout(5, "Opening crc fd, which waits for first
 CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
 > flags);
+     igt_reset_timeout();
Quoted 8 lines
Quoted 5 lines

Hum I was able to reproduce this one too in a KBL, I was thinking in
add a timeout in the kernel side, if it don't get the CRC buffer filled
it would return a error.

That would be unexpected behaviour for a read() interface. If you want a
timeout, implement poll().

Not change the read() but return a error in open() when timeout happens:

"

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
index 9f8312137cad..223cd45b3aff 100644
@@ -206,9 +206,10 @@ static int crtc_crc_open(struct inode *inode,
 struct file *filep)
 	 * guess when this particular piece of HW will be ready to

start

drivers/gpu/drm/drm_debugfs_crc.c +0 -2
 	 * generating CRCs.
 	 */
-	ret = wait_event_interruptible_lock_irq(crc->wq,
-						crtc_crc_data_count(cr

c),

drivers/gpu/drm/drm_debugfs_crc.c +2 -1
-						crc->lock);
+	ret = wait_event_interruptible_lock_irq_timeout(crc->wq,
+							crtc_crc_data_

count(crc),

drivers/gpu/drm/drm_debugfs_crc.c +2 -0
+							crc->lock,
+							msecs_to_jiffi

es(2500));
spin_unlock_irq(&crc->lock);

Quoted 1 line
Quoted 1 line

if (ret)

I think this should be fixed in userspace, and the fix of doing a timeout in igt_pipe_crc_start should work. The kernel side is correct to block forever, and this helped us caught bugs when igt/debugfs_test was reading /sys/kernel/debug/dri/0/crtc-0/crc/data and being blocked until the test hit its internal timeout (10s), we would lose that check if kernel times out sooner.

On your patch itself, I think the _timeout function returns a long with the remainder of the timeout, and 0 for timed out, the if (ret) below wouldn't work any more in that case.

~Maarten
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v1 1/1
#11 lore raw
In reply to Maarten Lankhorst
Quoted 3 lines · Maarten Lankhorst

This will fix the PSR tests to fail slightly faster, since they wait indefinitely for a CRC that never comes during open.

While we need to figure out how to run these tests without CRC, timing out the tests makes sense.

Quoted 10 lines
---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +0 -0
index 8adc02e9cc47..094df564b6f4 100644

lib/igt_debugfs.c void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc) · line 766

Quoted 10 lines
lib/igt_debugfs.c +3 -0
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
 
 	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+	igt_set_timeout(5, "Opening crc fd, which waits for first CRC.");
 	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
+	igt_reset_timeout();
+
 	igt_assert(pipe_crc->crc_fd != -1);
 	errno = 0;
 }

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#7 lore raw
In reply to Maarten Lankhorst
Quoted 67 lines · Maarten Lankhorst

Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan:

Quoted 66 lines · Jose
Quoted 6 lines · Chris Wilson
Quoted 5 lines

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 4 lines · Maarten Lankhorst
Quoted 3 lines

This will fix the PSR tests to fail slightly faster, since they wait
indefinitely for a CRC that never comes during open.

Because the pipe is not active and hence doesn't generate crc's any more? The timeouts are needed but any idea how we should deal with the lack of CRCs?

Quoted 55 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines

om>

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +2 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
 *pipe_crc)
 
      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+     igt_set_timeout(5, "Opening crc fd, which waits for first
 CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
 > flags);
+     igt_reset_timeout();
Quoted 8 lines
Quoted 5 lines

Hum I was able to reproduce this one too in a KBL, I was thinking in
add a timeout in the kernel side, if it don't get the CRC buffer filled
it would return a error.

That would be unexpected behaviour for a read() interface. If you want a
timeout, implement poll().

Not change the read() but return a error in open() when timeout happens:

"

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
index 9f8312137cad..223cd45b3aff 100644
@@ -206,9 +206,10 @@ static int crtc_crc_open(struct inode *inode,
 struct file *filep)
 	 * guess when this particular piece of HW will be ready to

start

drivers/gpu/drm/drm_debugfs_crc.c +0 -2
 	 * generating CRCs.
 	 */
-	ret = wait_event_interruptible_lock_irq(crc->wq,
-						crtc_crc_data_count(cr

c),

drivers/gpu/drm/drm_debugfs_crc.c +2 -1
-						crc->lock);
+	ret = wait_event_interruptible_lock_irq_timeout(crc->wq,
+							crtc_crc_data_

count(crc),

drivers/gpu/drm/drm_debugfs_crc.c +2 -0
+							crc->lock,
+							msecs_to_jiffi

es(2500));
spin_unlock_irq(&crc->lock);

Quoted 5 lines
Quoted 1 line
Quoted 1 line

if (ret)

I think this should be fixed in userspace, and the fix of doing a timeout in igt_pipe_crc_start should work. The kernel side is correct to block forever,

Even if the kernel knows the hardware will not generate CRCs? That seems to be the case here, isn't it?

Quoted 10 lines

and this helped us caught bugs when igt/debugfs_test
was reading /sys/kernel/debug/dri/0/crtc-0/crc/data and being blocked until the test hit its internal timeout (10s), we would lose that check if kernel times out sooner.

On your patch itself, I think the _timeout function returns a long with the remainder of the timeout, and 0 for timed out, the if (ret) below wouldn't work any more in that case.

Quoted 5 lines

~Maarten
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

author maintainer
#8 lore raw

Op 06-04-18 om 20:27 schreef Dhinakaran Pandiyan:

Quoted 70 lines · Maarten Lankhorst
Quoted 67 lines

Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan:

Quoted 66 lines · Jose
Quoted 6 lines · Chris Wilson
Quoted 5 lines

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 4 lines · Maarten Lankhorst
Quoted 3 lines

This will fix the PSR tests to fail slightly faster, since they wait
indefinitely for a CRC that never comes during open.

Because the pipe is not active and hence doesn't generate crc's any more? The timeouts are needed but any idea how we should deal with the lack of CRCs?

Quoted 55 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines

om>

---
 lib/igt_debugfs.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +2 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void igt_pipe_crc_start(igt_pipe_crc_t
 *pipe_crc)
 
      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
 
+     igt_set_timeout(5, "Opening crc fd, which waits for first
 CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-
 > flags);
+     igt_reset_timeout();
Quoted 8 lines
Quoted 5 lines

Hum I was able to reproduce this one too in a KBL, I was thinking in
add a timeout in the kernel side, if it don't get the CRC buffer filled
it would return a error.

That would be unexpected behaviour for a read() interface. If you want a
timeout, implement poll().

Not change the read() but return a error in open() when timeout happens:

"

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
index 9f8312137cad..223cd45b3aff 100644
@@ -206,9 +206,10 @@ static int crtc_crc_open(struct inode *inode,
 struct file *filep)
 	 * guess when this particular piece of HW will be ready to

start

drivers/gpu/drm/drm_debugfs_crc.c +0 -2
 	 * generating CRCs.
 	 */
-	ret = wait_event_interruptible_lock_irq(crc->wq,
-						crtc_crc_data_count(cr

c),

drivers/gpu/drm/drm_debugfs_crc.c +2 -1
-						crc->lock);
+	ret = wait_event_interruptible_lock_irq_timeout(crc->wq,
+							crtc_crc_data_

count(crc),

drivers/gpu/drm/drm_debugfs_crc.c +2 -0
+							crc->lock,
+							msecs_to_jiffi

es(2500));
spin_unlock_irq(&crc->lock);

Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

if (ret)

I think this should be fixed in userspace, and the fix of doing a timeout in igt_pipe_crc_start should work. The kernel side is correct to block forever,

Even if the kernel knows the hardware will not generate CRCs? That seems to be the case here, isn't it?

Hm, if kernel knew the hardware doesn't generate CRC's, then this should be fixed in the kernel, currently we have no way to skip tests based on that. But presumably if we ask for CRC's, we should definitely try to generate CRC's...

Is it ok if I increase the timeout to 10s? It seems 5s is not enough on a haswell laptop, which has to enable the panel fitter as a workaround for CRC generation..

~Maarten
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

author maintainer
#12 lore raw
In reply to Dhinakaran Pandiyan

Op 06-04-18 om 20:17 schreef Dhinakaran Pandiyan:

Quoted 10 lines · Maarten Lankhorst
Quoted 3 lines

This will fix the PSR tests to fail slightly faster, since they wait indefinitely for a CRC that never comes during open.

While we need to figure out how to run these tests without CRC, timing out the tests makes sense.

5s was too short for the modeset with haswell's pipe workaround. I've increased it to 10s and pushed. :)

Thanks for review,
Maarten
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#9 lore raw
In reply to Maarten Lankhorst
Quoted 107 lines · Maarten Lankhorst

Op 06-04-18 om 20:27 schreef Dhinakaran Pandiyan:

Quoted 106 lines · Maarten Lankhorst
Quoted 102 lines

Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan:

Quoted 89 lines · Jose
Quoted 12 lines · Chris Wilson
Quoted 10 lines

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 8 lines
Quoted 5 lines · Maarten Lankhorst

This will fix the PSR tests to fail slightly faster, since they
wait
indefinitely for a CRC that never comes during open.

Because the pipe is not active and hence doesn't generate crc's any
more? The timeouts are needed but any idea how we should deal with the
lack of CRCs?

Quoted 69 lines
Quoted 36 lines
Quoted 28 lines
Quoted 28 lines

ux.intel.c
om>
---
 lib/igt_debugfs.c | 3 +++

 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +0 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void

igt_pipe_crc_start(igt_pipe_crc_t
*pipe_crc)

      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
+     igt_set_timeout(5, "Opening crc fd, which waits for first
CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-

Quoted 2 lines

flags);

Quoted 8 lines
Quoted 1 line

+     igt_reset_timeout();

Hum I was able to reproduce this one too in a KBL, I was thinking
in
add a timeout in the kernel side, if it don't get the CRC buffer
filled
it would return a error.

Quoted 4 lines

That would be unexpected behaviour for a read() interface. If you
want a
timeout, implement poll().

Not change the read() but return a error in open() when timeout
happens:

"

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
index 9f8312137cad..223cd45b3aff 100644
@@ -206,9 +206,10 @@ static int crtc_crc_open(struct inode
 *inode,
 struct file *filep)
  	 * guess when this particular piece of HW will be

ready to
start
   * generating CRCs.
   */

drivers/gpu/drm/drm_debugfs_crc.c +0 -2
-	ret = wait_event_interruptible_lock_irq(crc->wq,
-						crtc_crc_dat

a_count(cr
c),

drivers/gpu/drm/drm_debugfs_crc.c +1 -1
-						crc->lock);
+	ret = wait_event_interruptible_lock_irq_timeout(crc-
Quoted 1 line

wq,

drivers/gpu/drm/drm_debugfs_crc.c +1 -0
+							crtc

_crc_data_
count(crc),

drivers/gpu/drm/drm_debugfs_crc.c +1 -0
+							crc-
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

lock,

drivers/gpu/drm/drm_debugfs_crc.c +1 -0
+							msec

s_to_jiffi
es(2500));
  spin_unlock_irq(&crc->lock);

  if (ret)

I think this should be fixed in userspace, and the fix of doing a timeout in igt_pipe_crc_start should work. The kernel side is correct
to block forever,

Quoted 8 lines
Quoted 3 lines

Even if the kernel knows the hardware will not generate CRCs? That seems
to be the case here, isn't it?

Hm, if kernel knew the hardware doesn't generate CRC's, then this should be fixed in the kernel, currently we have no way to skip tests based on that.
But presumably if we ask for CRC's, we should definitely try to generate CRC's...

We still have to fix this to enable PSR.

The kernel has to disable PSR for hardware to generate pipe CRC's but doing so changes the purpose of the tests, for e.g., kms_frontbuffer_tracking:basic aims to check CRC's with default features.

I am thinking we should return error from the kernel instead of blocking when we know that the HW cannot generate CRC. Secondly, we should add DDI_CRC_RES_SRD_[A, B, ...] sources for CRC generation and make the tests select them if needed.

Let me know what you think.

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

author maintainer
#10 lore raw

Op 24-05-18 om 03:05 schreef Dhinakaran Pandiyan:

Quoted 111 lines · Maarten Lankhorst
Quoted 95 lines

Op 06-04-18 om 20:27 schreef Dhinakaran Pandiyan:

Quoted 94 lines · Maarten Lankhorst
Quoted 91 lines

Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan:

Quoted 79 lines · Jose
Quoted 8 lines · Chris Wilson
Quoted 7 lines

Quoting Souza, Jose (2018-04-05 22:03:46)

Quoted 6 lines
Quoted 4 lines · Maarten Lankhorst

This will fix the PSR tests to fail slightly faster, since they
wait
indefinitely for a CRC that never comes during open.

Because the pipe is not active and hence doesn't generate crc's any
more? The timeouts are needed but any idea how we should deal with the
lack of CRCs?

Quoted 64 lines
Quoted 31 lines
Quoted 23 lines
Quoted 23 lines

ux.intel.c
om>
---
 lib/igt_debugfs.c | 3 +++

 1 file changed, 3 insertions(+)
lib/igt_debugfs.c +0 -0
index 8adc02e9cc47..094df564b6f4 100644
@@ -757,7 +757,10 @@ void

igt_pipe_crc_start(igt_pipe_crc_t
*pipe_crc)

      sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
+     igt_set_timeout(5, "Opening crc fd, which waits for first
CRC.");
      pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc-

Quoted 1 line

flags);

Quoted 8 lines
Quoted 1 line

+     igt_reset_timeout();

Hum I was able to reproduce this one too in a KBL, I was thinking
in
add a timeout in the kernel side, if it don't get the CRC buffer
filled
it would return a error.

Quoted 4 lines

That would be unexpected behaviour for a read() interface. If you
want a
timeout, implement poll().

Not change the read() but return a error in open() when timeout
happens:

"

drivers/gpu/drm/drm_debugfs_crc.c +0 -0
index 9f8312137cad..223cd45b3aff 100644
@@ -206,9 +206,10 @@ static int crtc_crc_open(struct inode
 *inode,
 struct file *filep)
  	 * guess when this particular piece of HW will be

ready to
start
   * generating CRCs.
   */

drivers/gpu/drm/drm_debugfs_crc.c +0 -2
-	ret = wait_event_interruptible_lock_irq(crc->wq,
-						crtc_crc_dat

a_count(cr
c),

drivers/gpu/drm/drm_debugfs_crc.c +1 -1
-						crc->lock);
+	ret = wait_event_interruptible_lock_irq_timeout(crc-
Quoted 1 line

wq,

drivers/gpu/drm/drm_debugfs_crc.c +1 -0
+							crtc

_crc_data_
count(crc),

drivers/gpu/drm/drm_debugfs_crc.c +1 -0
+							crc-
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

lock,

drivers/gpu/drm/drm_debugfs_crc.c +1 -0
+							msec

s_to_jiffi
es(2500));
  spin_unlock_irq(&crc->lock);

  if (ret)

I think this should be fixed in userspace, and the fix of doing a timeout in igt_pipe_crc_start should work. The kernel side is correct
to block forever,

Quoted 8 lines
Quoted 3 lines

Even if the kernel knows the hardware will not generate CRCs? That seems
to be the case here, isn't it?

Hm, if kernel knew the hardware doesn't generate CRC's, then this should be fixed in the kernel, currently we have no way to skip tests based on that.
But presumably if we ask for CRC's, we should definitely try to generate CRC's...

We still have to fix this to enable PSR.

The kernel has to disable PSR for hardware to generate pipe CRC's but doing so changes the purpose of the tests, for e.g., kms_frontbuffer_tracking:basic aims to check CRC's with default features.

Quoted 10 lines

I am thinking we should return error from the kernel instead of blocking when we know that the HW cannot generate CRC. Secondly, we should add DDI_CRC_RES_SRD_[A, B, ...] sources for CRC generation and make the tests select them if needed.

Let me know what you think.

+1, sounds good.

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev