* [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. @ 2018-04-05 10:49 Maarten Lankhorst 2018-04-05 11:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork ` (2 more replies) 0 siblings, 3 replies; 13+ messages in thread From: Maarten Lankhorst @ 2018-04-05 10:49 UTC (permalink / raw) To: igt-dev This will fix the PSR tests to fail slightly faster, since they wait indefinitely for a CRC that never comes during open. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> --- lib/igt_debugfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 8adc02e9cc47..094df564b6f4 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -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; } -- 2.16.3 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-05 10:49 [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd Maarten Lankhorst @ 2018-04-05 11:45 ` Patchwork 2018-04-05 21:03 ` [igt-dev] [PATCH i-g-t] " Souza, Jose 2018-04-06 18:17 ` Dhinakaran Pandiyan 2 siblings, 0 replies; 13+ messages in thread From: Patchwork @ 2018-04-05 11:45 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: igt-dev == 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-05 10:49 [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd Maarten Lankhorst 2018-04-05 11:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork @ 2018-04-05 21:03 ` Souza, Jose 2018-04-05 21:15 ` Chris Wilson 2018-04-06 18:17 ` Dhinakaran Pandiyan 2 siblings, 1 reply; 13+ messages in thread From: Souza, Jose @ 2018-04-05 21:03 UTC (permalink / raw) To: igt-dev, maarten.lankhorst On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: > This will fix the PSR tests to fail slightly faster, since they wait > indefinitely for a CRC that never comes during open. > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > --- > lib/igt_debugfs.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > index 8adc02e9cc47..094df564b6f4 100644 > --- a/lib/igt_debugfs.c > +++ b/lib/igt_debugfs.c > @@ -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. > + > igt_assert(pipe_crc->crc_fd != -1); > errno = 0; > } _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-05 21:03 ` [igt-dev] [PATCH i-g-t] " Souza, Jose @ 2018-04-05 21:15 ` Chris Wilson 2018-04-05 22:10 ` Souza, Jose 0 siblings, 1 reply; 13+ messages in thread From: Chris Wilson @ 2018-04-05 21:15 UTC (permalink / raw) To: Souza, Jose, igt-dev, maarten.lankhorst Quoting Souza, Jose (2018-04-05 22:03:46) > On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: > > This will fix the PSR tests to fail slightly faster, since they wait > > indefinitely for a CRC that never comes during open. > > > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > > --- > > lib/igt_debugfs.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > > index 8adc02e9cc47..094df564b6f4 100644 > > --- a/lib/igt_debugfs.c > > +++ b/lib/igt_debugfs.c > > @@ -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. That would be unexpected behaviour for a read() interface. If you want a timeout, implement poll(). -Chris _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-05 21:15 ` Chris Wilson @ 2018-04-05 22:10 ` Souza, Jose 2018-04-05 22:39 ` Dhinakaran Pandiyan 0 siblings, 1 reply; 13+ messages in thread From: Souza, Jose @ 2018-04-05 22:10 UTC (permalink / raw) To: igt-dev, maarten.lankhorst, chris On Thu, 2018-04-05 at 22:15 +0100, Chris Wilson wrote: > Quoting Souza, Jose (2018-04-05 22:03:46) > > On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: > > > This will fix the PSR tests to fail slightly faster, since they > > > wait > > > indefinitely for a CRC that never comes during open. > > > > > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.c > > > om> > > > --- > > > lib/igt_debugfs.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > > > index 8adc02e9cc47..094df564b6f4 100644 > > > --- a/lib/igt_debugfs.c > > > +++ b/lib/igt_debugfs.c > > > @@ -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. > > 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: " diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index 9f8312137cad..223cd45b3aff 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -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) " > -Chris _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-05 22:10 ` Souza, Jose @ 2018-04-05 22:39 ` Dhinakaran Pandiyan 2018-04-06 7:33 ` Maarten Lankhorst 0 siblings, 1 reply; 13+ messages in thread From: Dhinakaran Pandiyan @ 2018-04-05 22:39 UTC (permalink / raw) To: Souza, Jose; +Cc: igt-dev On Thu, 2018-04-05 at 22:10 +0000, Souza, Jose wrote: > On Thu, 2018-04-05 at 22:15 +0100, Chris Wilson wrote: > > Quoting Souza, Jose (2018-04-05 22:03:46) > > > On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: > > > > 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? > > > > > > > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.c > > > > om> > > > > --- > > > > lib/igt_debugfs.c | 3 +++ > > > > 1 file changed, 3 insertions(+) > > > > > > > > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > > > > index 8adc02e9cc47..094df564b6f4 100644 > > > > --- a/lib/igt_debugfs.c > > > > +++ b/lib/igt_debugfs.c > > > > @@ -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. > > > > 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: > > " > diff --git a/drivers/gpu/drm/drm_debugfs_crc.c > b/drivers/gpu/drm/drm_debugfs_crc.c > index 9f8312137cad..223cd45b3aff 100644 > --- a/drivers/gpu/drm/drm_debugfs_crc.c > +++ b/drivers/gpu/drm/drm_debugfs_crc.c > @@ -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) > " > > > > -Chris > _______________________________________________ > igt-dev mailing list > igt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/igt-dev _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-05 22:39 ` Dhinakaran Pandiyan @ 2018-04-06 7:33 ` Maarten Lankhorst 2018-04-06 18:27 ` Dhinakaran Pandiyan 0 siblings, 1 reply; 13+ messages in thread From: Maarten Lankhorst @ 2018-04-06 7:33 UTC (permalink / raw) To: dhinakaran.pandiyan, Souza, Jose; +Cc: igt-dev Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan: > On Thu, 2018-04-05 at 22:10 +0000, Souza, Jose wrote: >> On Thu, 2018-04-05 at 22:15 +0100, Chris Wilson wrote: >>> Quoting Souza, Jose (2018-04-05 22:03:46) >>>> On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: >>>>> 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? > >>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.c >>>>> om> >>>>> --- >>>>> lib/igt_debugfs.c | 3 +++ >>>>> 1 file changed, 3 insertions(+) >>>>> >>>>> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c >>>>> index 8adc02e9cc47..094df564b6f4 100644 >>>>> --- a/lib/igt_debugfs.c >>>>> +++ b/lib/igt_debugfs.c >>>>> @@ -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. >>> 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: >> >> " >> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c >> b/drivers/gpu/drm/drm_debugfs_crc.c >> index 9f8312137cad..223cd45b3aff 100644 >> --- a/drivers/gpu/drm/drm_debugfs_crc.c >> +++ b/drivers/gpu/drm/drm_debugfs_crc.c >> @@ -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) 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-06 7:33 ` Maarten Lankhorst @ 2018-04-06 18:27 ` Dhinakaran Pandiyan 2018-04-10 15:28 ` Maarten Lankhorst 0 siblings, 1 reply; 13+ messages in thread From: Dhinakaran Pandiyan @ 2018-04-06 18:27 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: igt-dev On Fri, 2018-04-06 at 09:33 +0200, Maarten Lankhorst wrote: > Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan: > > On Thu, 2018-04-05 at 22:10 +0000, Souza, Jose wrote: > >> On Thu, 2018-04-05 at 22:15 +0100, Chris Wilson wrote: > >>> Quoting Souza, Jose (2018-04-05 22:03:46) > >>>> On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: > >>>>> 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? > > > >>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.c > >>>>> om> > >>>>> --- > >>>>> lib/igt_debugfs.c | 3 +++ > >>>>> 1 file changed, 3 insertions(+) > >>>>> > >>>>> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > >>>>> index 8adc02e9cc47..094df564b6f4 100644 > >>>>> --- a/lib/igt_debugfs.c > >>>>> +++ b/lib/igt_debugfs.c > >>>>> @@ -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. > >>> 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: > >> > >> " > >> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c > >> b/drivers/gpu/drm/drm_debugfs_crc.c > >> index 9f8312137cad..223cd45b3aff 100644 > >> --- a/drivers/gpu/drm/drm_debugfs_crc.c > >> +++ b/drivers/gpu/drm/drm_debugfs_crc.c > >> @@ -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) > > 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? > 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 > igt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/igt-dev _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-06 18:27 ` Dhinakaran Pandiyan @ 2018-04-10 15:28 ` Maarten Lankhorst 2018-05-24 1:05 ` Dhinakaran Pandiyan 0 siblings, 1 reply; 13+ messages in thread From: Maarten Lankhorst @ 2018-04-10 15:28 UTC (permalink / raw) To: dhinakaran.pandiyan; +Cc: igt-dev Op 06-04-18 om 20:27 schreef Dhinakaran Pandiyan: > > > On Fri, 2018-04-06 at 09:33 +0200, Maarten Lankhorst wrote: >> Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan: >>> On Thu, 2018-04-05 at 22:10 +0000, Souza, Jose wrote: >>>> On Thu, 2018-04-05 at 22:15 +0100, Chris Wilson wrote: >>>>> Quoting Souza, Jose (2018-04-05 22:03:46) >>>>>> On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: >>>>>>> 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? >>> >>>>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.c >>>>>>> om> >>>>>>> --- >>>>>>> lib/igt_debugfs.c | 3 +++ >>>>>>> 1 file changed, 3 insertions(+) >>>>>>> >>>>>>> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c >>>>>>> index 8adc02e9cc47..094df564b6f4 100644 >>>>>>> --- a/lib/igt_debugfs.c >>>>>>> +++ b/lib/igt_debugfs.c >>>>>>> @@ -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. >>>>> 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: >>>> >>>> " >>>> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c >>>> b/drivers/gpu/drm/drm_debugfs_crc.c >>>> index 9f8312137cad..223cd45b3aff 100644 >>>> --- a/drivers/gpu/drm/drm_debugfs_crc.c >>>> +++ b/drivers/gpu/drm/drm_debugfs_crc.c >>>> @@ -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) >> 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-10 15:28 ` Maarten Lankhorst @ 2018-05-24 1:05 ` Dhinakaran Pandiyan 2018-05-24 6:59 ` Maarten Lankhorst 0 siblings, 1 reply; 13+ messages in thread From: Dhinakaran Pandiyan @ 2018-05-24 1:05 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: igt-dev On Tue, 2018-04-10 at 17:28 +0200, Maarten Lankhorst wrote: > Op 06-04-18 om 20:27 schreef Dhinakaran Pandiyan: > > > > > > > > On Fri, 2018-04-06 at 09:33 +0200, Maarten Lankhorst wrote: > > > > > > Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan: > > > > > > > > On Thu, 2018-04-05 at 22:10 +0000, Souza, Jose wrote: > > > > > > > > > > On Thu, 2018-04-05 at 22:15 +0100, Chris Wilson wrote: > > > > > > > > > > > > Quoting Souza, Jose (2018-04-05 22:03:46) > > > > > > > > > > > > > > On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst > > > > > > > wrote: > > > > > > > > > > > > > > > > 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? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@lin > > > > > > > > ux.intel.c > > > > > > > > om> > > > > > > > > --- > > > > > > > > lib/igt_debugfs.c | 3 +++ > > > > > > > > 1 file changed, 3 insertions(+) > > > > > > > > > > > > > > > > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > > > > > > > > index 8adc02e9cc47..094df564b6f4 100644 > > > > > > > > --- a/lib/igt_debugfs.c > > > > > > > > +++ b/lib/igt_debugfs.c > > > > > > > > @@ -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. > > > > > > 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: > > > > > > > > > > " > > > > > diff --git a/drivers/gpu/drm/drm_debugfs_crc.c > > > > > b/drivers/gpu/drm/drm_debugfs_crc.c > > > > > index 9f8312137cad..223cd45b3aff 100644 > > > > > --- a/drivers/gpu/drm/drm_debugfs_crc.c > > > > > +++ b/drivers/gpu/drm/drm_debugfs_crc.c > > > > > @@ -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_dat > > > > > a_count(cr > > > > > c), > > > > > - crc->lock); > > > > > + ret = wait_event_interruptible_lock_irq_timeout(crc- > > > > > >wq, > > > > > + crtc > > > > > _crc_data_ > > > > > count(crc), > > > > > + crc- > > > > > >lock, > > > > > + 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, > > 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-05-24 1:05 ` Dhinakaran Pandiyan @ 2018-05-24 6:59 ` Maarten Lankhorst 0 siblings, 0 replies; 13+ messages in thread From: Maarten Lankhorst @ 2018-05-24 6:59 UTC (permalink / raw) To: dhinakaran.pandiyan; +Cc: igt-dev Op 24-05-18 om 03:05 schreef Dhinakaran Pandiyan: > On Tue, 2018-04-10 at 17:28 +0200, Maarten Lankhorst wrote: >> Op 06-04-18 om 20:27 schreef Dhinakaran Pandiyan: >>> >>> >>> On Fri, 2018-04-06 at 09:33 +0200, Maarten Lankhorst wrote: >>>> Op 06-04-18 om 00:39 schreef Dhinakaran Pandiyan: >>>>> On Thu, 2018-04-05 at 22:10 +0000, Souza, Jose wrote: >>>>>> On Thu, 2018-04-05 at 22:15 +0100, Chris Wilson wrote: >>>>>>> Quoting Souza, Jose (2018-04-05 22:03:46) >>>>>>>> On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst >>>>>>>> wrote: >>>>>>>>> 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? >>>>> >>>>>>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@lin >>>>>>>>> ux.intel.c >>>>>>>>> om> >>>>>>>>> --- >>>>>>>>> lib/igt_debugfs.c | 3 +++ >>>>>>>>> 1 file changed, 3 insertions(+) >>>>>>>>> >>>>>>>>> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c >>>>>>>>> index 8adc02e9cc47..094df564b6f4 100644 >>>>>>>>> --- a/lib/igt_debugfs.c >>>>>>>>> +++ b/lib/igt_debugfs.c >>>>>>>>> @@ -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. >>>>>>> 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: >>>>>> >>>>>> " >>>>>> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c >>>>>> b/drivers/gpu/drm/drm_debugfs_crc.c >>>>>> index 9f8312137cad..223cd45b3aff 100644 >>>>>> --- a/drivers/gpu/drm/drm_debugfs_crc.c >>>>>> +++ b/drivers/gpu/drm/drm_debugfs_crc.c >>>>>> @@ -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_dat >>>>>> a_count(cr >>>>>> c), >>>>>> - crc->lock); >>>>>> + ret = wait_event_interruptible_lock_irq_timeout(crc- >>>>>>> wq, >>>>>> + crtc >>>>>> _crc_data_ >>>>>> count(crc), >>>>>> + crc- >>>>>>> lock, >>>>>> + 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, >>> 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. > > > > +1, sounds good. _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-05 10:49 [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd Maarten Lankhorst 2018-04-05 11:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork 2018-04-05 21:03 ` [igt-dev] [PATCH i-g-t] " Souza, Jose @ 2018-04-06 18:17 ` Dhinakaran Pandiyan 2018-04-11 7:46 ` Maarten Lankhorst 2 siblings, 1 reply; 13+ messages in thread From: Dhinakaran Pandiyan @ 2018-04-06 18:17 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: igt-dev On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: > 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. Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > --- > lib/igt_debugfs.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c > index 8adc02e9cc47..094df564b6f4 100644 > --- a/lib/igt_debugfs.c > +++ b/lib/igt_debugfs.c > @@ -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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd. 2018-04-06 18:17 ` Dhinakaran Pandiyan @ 2018-04-11 7:46 ` Maarten Lankhorst 0 siblings, 0 replies; 13+ messages in thread From: Maarten Lankhorst @ 2018-04-11 7:46 UTC (permalink / raw) To: dhinakaran.pandiyan; +Cc: igt-dev Op 06-04-18 om 20:17 schreef Dhinakaran Pandiyan: > > > On Thu, 2018-04-05 at 12:49 +0200, Maarten Lankhorst wrote: >> 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. > > Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2018-05-24 6:59 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-04-05 10:49 [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Add timeouts to opening pipe CRC fd Maarten Lankhorst 2018-04-05 11:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork 2018-04-05 21:03 ` [igt-dev] [PATCH i-g-t] " Souza, Jose 2018-04-05 21:15 ` Chris Wilson 2018-04-05 22:10 ` Souza, Jose 2018-04-05 22:39 ` Dhinakaran Pandiyan 2018-04-06 7:33 ` Maarten Lankhorst 2018-04-06 18:27 ` Dhinakaran Pandiyan 2018-04-10 15:28 ` Maarten Lankhorst 2018-05-24 1:05 ` Dhinakaran Pandiyan 2018-05-24 6:59 ` Maarten Lankhorst 2018-04-06 18:17 ` Dhinakaran Pandiyan 2018-04-11 7:46 ` Maarten Lankhorst
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.