From 9764723de613d93b72e95923d25d589f539f07e9 Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Fri, 1 Sep 2023 14:15:07 +0300 Subject: gpu: host1x: Add locking in channel allocation Add locking around channel allocation to avoid race conditions. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230901111510.663401-1-cyndis@kapsi.fi --- drivers/gpu/host1x/channel.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/host1x/channel.h') 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 #include +#include #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; }; -- cgit v1.2.3