aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1250-drm-amd-dal-Avoid-flood-kernel-with-storm-of-work-it.patch
blob: 4ff3f8a19ee6ff8fed8a0b4ce4ff2a86c803e34b (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
46
47
48
49
50
51
From 094cd0d406ff6c93c9c51e68971a2d567d456345 Mon Sep 17 00:00:00 2001
From: Vitaly Prosyak <vitaly.prosyak@amd.com>
Date: Mon, 11 Jan 2016 14:19:10 -0500
Subject: [PATCH 1250/1565] drm/amd/dal: Avoid flood kernel with storm of work
 items

Add work item to system only when handler is  available.
The change decrease the boot time and improve system
performance by not overload the system thread pool with
thousands of empty work items.

Change-Id: I17669f9f92d2bd058c372a6c814db14d999d3c40
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
---
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c
index ab6df66..7cfb754 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c
@@ -558,15 +558,21 @@ static void amdgpu_dm_irq_schedule_work(
 	enum dc_irq_source irq_source)
 {
 	unsigned long irq_table_flags;
+	struct work_struct *work = NULL;
 
 	DM_IRQ_TABLE_LOCK(adev, irq_table_flags);
 
-	/* Since the caller is interested in 'work_struct' then
-	 * the irq will be post-processed at "INTERRUPT_LOW_IRQ_CONTEXT". */
-
-	schedule_work(&adev->dm.irq_handler_list_low_tab[irq_source].work);
+	if (!list_empty(&adev->dm.irq_handler_list_low_tab[irq_source].head))
+		work = &adev->dm.irq_handler_list_low_tab[irq_source].work;
 
 	DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
+
+	if (work) {
+		if (!schedule_work(work))
+			DRM_INFO("amdgpu_dm_irq_schedule_work FAILED src %d\n",
+						irq_source);
+	}
+
 }
 
 /** amdgpu_dm_irq_immediate_work
-- 
1.9.1