summaryrefslogtreecommitdiffstats
path: root/meta-agl-lxc/dynamic-layers/meta-rcar-gen3/recipes-kernel/kernel-module-gles/kernel-module-gles/0001-Fix-fw-download-issue.patch
blob: a44e8effa764d02584b413f39295608a58a72579 (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
52
53
54
55
56
57
58
59
60
From d7a7ad476dee136e21fc7de112003528f7675007 Mon Sep 17 00:00:00 2001
From: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Date: Wed, 1 Dec 2021 08:16:24 +0900
Subject: [PATCH] Fix fw download issue

---
 services/server/env/linux/module_common.c | 26 ++++++++++++++++-------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/services/server/env/linux/module_common.c b/services/server/env/linux/module_common.c
index 5822dab..3c97b28 100644
--- a/services/server/env/linux/module_common.c
+++ b/services/server/env/linux/module_common.c
@@ -416,6 +416,10 @@ int PVRSRVDeviceResume(PVRSRV_DEVICE_NODE *psDeviceNode)
 	return 0;
 }
 
+//HACK
+static DEFINE_MUTEX(rgx_initialize_mutex);
+//HACK
+
 /**************************************************************************/ /*!
 @Function     PVRSRVDeviceOpen
 @Description  Common device open.
@@ -455,18 +459,24 @@ int PVRSRVDeviceOpen(PVRSRV_DEVICE_NODE *psDeviceNode,
 
 	if (psDeviceNode->eDevState == PVRSRV_DEVICE_STATE_INIT)
 	{
-		eError = PVRSRVCommonDeviceInitialise(psDeviceNode);
-		if (eError != PVRSRV_OK)
+		mutex_lock(&rgx_initialize_mutex);
+		if (psDeviceNode->eDevState == PVRSRV_DEVICE_STATE_INIT)
 		{
-			PVR_DPF((PVR_DBG_ERROR, "%s: Failed to initialise device (%s)",
-					 __func__, PVRSRVGetErrorString(eError)));
-			iErr = -ENODEV;
-			goto out;
-		}
+			eError = PVRSRVCommonDeviceInitialise(psDeviceNode);
+			if (eError != PVRSRV_OK)
+			{
+				PVR_DPF((PVR_DBG_ERROR, "%s: Failed to initialise device (%s)",
+						 __func__, PVRSRVGetErrorString(eError)));
+				iErr = -ENODEV;
+				mutex_unlock(&rgx_initialize_mutex);
+				goto out;
+			}
 
 #if defined(SUPPORT_RGX)
-		PVRGpuTraceInitIfEnabled(psDeviceNode);
+			PVRGpuTraceInitIfEnabled(psDeviceNode);
 #endif
+		}
+		mutex_unlock(&rgx_initialize_mutex);
 	}
 
 	sPrivData.psDevNode = psDeviceNode;
-- 
2.25.1