aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1495-drm-amdkfd-fix-IH-always-printing-error-message-on-e.patch
blob: 7eb9aa20e47b2ea3b947d5b01093cb319f4e14d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 556d06575e8d37ce590393bea1a279e6cbc55fb0 Mon Sep 17 00:00:00 2001
From: Andres Rodriguez <andres.rodriguez@amd.com>
Date: Thu, 25 Aug 2016 16:24:08 -0400
Subject: [PATCH 1495/4131] drm/amdkfd: fix IH always printing error message on
 exit

dequeue_ih_ring_entry was always printing an error message when no
entries were found on the ring. This is a normal scenario that occurs
once the IH is done processing all entries in the ring.

Change the code to only produce errors if the count is an actual
unexpected number, i.e. not 0 (empty ring) or ih_ring_entry_size (entry
found).

Change-Id: If5fb392399e495a096695b7f827a33e42c21118e
Signed-off-by: Andres Rodriguez <andres.rodriguez@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
index c939856..4d1639f 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
@@ -129,14 +129,10 @@ static bool dequeue_ih_ring_entry(struct kfd_dev *kfd, void *ih_ring_entry)
 
 	count = kfifo_out(&kfd->ih_fifo, ih_ring_entry,
 				kfd->device_info->ih_ring_entry_size);
-	if (count != kfd->device_info->ih_ring_entry_size) {
-		dev_err_ratelimited(kfd_chardev(),
-				"IH dequeued unexpected number of entries %d\n",
-				count);
-		return false;
-	}
 
-	return true;
+	WARN_ON(count && count != kfd->device_info->ih_ring_entry_size);
+
+	return count == kfd->device_info->ih_ring_entry_size;
 }
 
 static void interrupt_wq(struct work_struct *work)
-- 
2.7.4