<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
please ignore this mail. I'll prepare v3 patch to simplify code logic.<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<span id="x_OutlookSignature">
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
»ρΘ‘ <a href="https://aka.ms/ghei36">Outlook for Android</a></div>
</span><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Cui, Flora<br>
<b>Sent:</b> Tuesday, June 25, 2019 5:43:38 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Cui, Flora<br>
<b>Subject:</b> [PATCH v2] drm/amdgpu: fix scheduler timeout calc</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:11pt;">
<div class="PlainText">scheduler timeout is in jiffies<br>
v2: move timeout check to amdgpu_device_get_job_timeout_settings after<br>
parsing the value & add negative value check<br>
<br>
Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2<br>
Signed-off-by: Flora Cui <flora.cui@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 +++++-<br>
1 file changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 7cf6ab0..7206d0d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -1300,7 +1300,7 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)<br>
* By default timeout for non compute jobs is 10000.<br>
* And there is no timeout enforced on compute jobs.<br>
*/<br>
- adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;<br>
+ adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = msecs_to_jiffies(10000);<br>
adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;<br>
<br>
if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) {<br>
@@ -1314,6 +1314,10 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)<br>
if (timeout <= 0) {<br>
index++;<br>
continue;<br>
+ } else if ((long)msecs_to_jiffies(timeout) < 0) {<br>
+ timeout = MAX_SCHEDULE_TIMEOUT;<br>
+ } else {<br>
+ timeout = msecs_to_jiffies(timeout);<br>
}<br>
<br>
switch (index++) {<br>
-- <br>
2.7.4<br>
<br>
</div>
</span></font>
</body>
</html>