1 From d7a7ad476dee136e21fc7de112003528f7675007 Mon Sep 17 00:00:00 2001
2 From: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
3 Date: Wed, 1 Dec 2021 08:16:24 +0900
4 Subject: [PATCH] Fix fw download issue
7 services/server/env/linux/module_common.c | 26 ++++++++++++++++-------
8 1 file changed, 18 insertions(+), 8 deletions(-)
10 diff --git a/services/server/env/linux/module_common.c b/services/server/env/linux/module_common.c
11 index 5822dab..3c97b28 100644
12 --- a/services/server/env/linux/module_common.c
13 +++ b/services/server/env/linux/module_common.c
14 @@ -416,6 +416,10 @@ int PVRSRVDeviceResume(PVRSRV_DEVICE_NODE *psDeviceNode)
19 +static DEFINE_MUTEX(rgx_initialize_mutex);
22 /**************************************************************************/ /*!
23 @Function PVRSRVDeviceOpen
24 @Description Common device open.
25 @@ -455,18 +459,24 @@ int PVRSRVDeviceOpen(PVRSRV_DEVICE_NODE *psDeviceNode,
27 if (psDeviceNode->eDevState == PVRSRV_DEVICE_STATE_INIT)
29 - eError = PVRSRVCommonDeviceInitialise(psDeviceNode);
30 - if (eError != PVRSRV_OK)
31 + mutex_lock(&rgx_initialize_mutex);
32 + if (psDeviceNode->eDevState == PVRSRV_DEVICE_STATE_INIT)
34 - PVR_DPF((PVR_DBG_ERROR, "%s: Failed to initialise device (%s)",
35 - __func__, PVRSRVGetErrorString(eError)));
39 + eError = PVRSRVCommonDeviceInitialise(psDeviceNode);
40 + if (eError != PVRSRV_OK)
42 + PVR_DPF((PVR_DBG_ERROR, "%s: Failed to initialise device (%s)",
43 + __func__, PVRSRVGetErrorString(eError)));
45 + mutex_unlock(&rgx_initialize_mutex);
49 #if defined(SUPPORT_RGX)
50 - PVRGpuTraceInitIfEnabled(psDeviceNode);
51 + PVRGpuTraceInitIfEnabled(psDeviceNode);
54 + mutex_unlock(&rgx_initialize_mutex);
57 sPrivData.psDevNode = psDeviceNode;