summaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x/channel.h
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2023-09-01 14:15:07 +0300
committerThierry Reding <treding@nvidia.com>2023-10-11 22:52:43 +0200
commit9764723de613d93b72e95923d25d589f539f07e9 (patch)
treee7b9367c749506b05ac520a45c299737bd7413bb /drivers/gpu/host1x/channel.h
parentf170bed50f9bbc4b03673f40c91f84d4d0258409 (diff)
gpu: host1x: Add locking in channel allocation
Add locking around channel allocation to avoid race conditions. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230901111510.663401-1-cyndis@kapsi.fi
Diffstat (limited to 'drivers/gpu/host1x/channel.h')
-rw-r--r--drivers/gpu/host1x/channel.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/channel.h b/drivers/gpu/host1x/channel.h
index 39044ff6c3aa..b23a8071fbd0 100644
--- a/drivers/gpu/host1x/channel.h
+++ b/drivers/gpu/host1x/channel.h
@@ -10,6 +10,7 @@
#include <linux/io.h>
#include <linux/kref.h>
+#include <linux/mutex.h>
#include "cdma.h"
@@ -18,6 +19,8 @@ struct host1x_channel;
struct host1x_channel_list {
struct host1x_channel *channels;
+
+ struct mutex lock;
unsigned long *allocated_channels;
};