Skip to contentSkip to conversation

drm/amdgpu: fix scheduler timeout calc

PATCH Superseded Cui, Flora 1 participant 2 messages Jun 25, 2019 1 message not in the archive

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Cui, Flora

author
#0 lore raw

PATCH v2 1/1 drm/amdgpu: fix scheduler timeout calc

scheduler timeout is in jiffies
v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value & add negative value check

Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -1
index 7cf6ab0..7206d0d 100644
@@ -1300,7 +1300,7 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 	 * By default timeout for non compute jobs is 10000.
 	 * And there is no timeout enforced on compute jobs.
 	 */
-	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
+	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = msecs_to_jiffies(10000);
 	adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
 	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) {
@@ -1314,6 +1314,10 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 			if (timeout <= 0) {
 				index++;
 				continue;
+			} else if ((long)msecs_to_jiffies(timeout) < 0) {
+				timeout = MAX_SCHEDULE_TIMEOUT;
+			} else {
+				timeout = msecs_to_jiffies(timeout);
 			}
 
 			switch (index++) {
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1561455804-9644-1-git-send-email-flora.cui-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

please ignore this mail. I'll prepare v3 patch to simplify code logic.

获取 Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Cui, Flora
Sent: Tuesday, June 25, 2019 5:43:38 PM
To: [email protected]
Cc: Cui, Flora
Subject: [PATCH v2] drm/amdgpu: fix scheduler timeout calc

scheduler timeout is in jiffies
v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value & add negative value check

Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -1
index 7cf6ab0..7206d0d 100644
@@ -1300,7 +1300,7 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
          * By default timeout for non compute jobs is 10000.
          * And there is no timeout enforced on compute jobs.
          */
-       adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
+       adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = msecs_to_jiffies(10000);
         adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
 
         if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) {
@@ -1314,6 +1314,10 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
                         if (timeout <= 0) {
                                 index++;
                                 continue;
+                       } else if ((long)msecs_to_jiffies(timeout) < 0) {
+                               timeout = MAX_SCHEDULE_TIMEOUT;
+                       } else {
+                               timeout = msecs_to_jiffies(timeout);
                         }
 
                         switch (index++) {

--
2.7.4

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