<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I reread the documentation for wait_event_timeout, my bad, all
this time i assumed it returns</p>
<p>amount of jiffies he spent in waiting while actually it returns
"the remaining jiffies (at least 1) <br>
</p>
<p>if the @condition evaluated<br>
* to %true before the @timeout elapsed."</p>
<p>Will fix that, please take a look also at the second patch.<br>
</p>
<p>Andrey<br>
</p>
<br>
<div class="moz-cite-prefix">On 06/04/2018 01:53 PM, Christian König
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:e765149d-99a7-10ce-0669-e978acf7044a@amd.com">
<blockquote type="cite" style="color: #000000;">+ ret =
wait_event_timeout(
<br>
+ sched->job_scheduled,
<br>
+ drm_sched_entity_is_idle(entity),
<br>
+ timeout);
<br>
+
<br>
+ ret = ret ? timeout - ret : ret;
<br>
</blockquote>
<br>
Ok we still seem to have a misunderstanding here what
wait_event_timeout() returns.
<br>
<br>
As far as I know that line shouldn't be necessary and is actually
quite harmful.
<br>
<br>
Apart from that this patch looks fine to me now,
<br>
Christian.</blockquote>
<br>
</body>
</html>