mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
Protect FFA sync_send_receive with a single mutex
- In sync_send_receive only support access from a single
thread at a time. Add the mutex to protect multi-instance
- This patch is imported from
https://p4sw-swarm.nvidia.com/changes/32944487
Bug 4135491
Change-Id: Icdcce1df570639e580fbe238ee6260fd2178ef20
Signed-off-by: Yang Shi <yashi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2920915
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
@@ -26,6 +26,8 @@ struct mods_ffa_ctx {
|
||||
#endif
|
||||
};
|
||||
|
||||
static DEFINE_MUTEX(mods_ffa_lock);
|
||||
|
||||
static struct mods_ffa_ctx mods_ffa_info;
|
||||
|
||||
static int ffa_probe(struct ffa_device *ffa_dev)
|
||||
@@ -137,7 +139,9 @@ int esc_mods_arm_ffa_cmd(struct mods_client *client,
|
||||
return err;
|
||||
}
|
||||
|
||||
mutex_lock(&mods_ffa_lock);
|
||||
err = mods_ffa_info.ffa_ops->sync_send_receive(mods_ffa_info.ffa_dev, &data);
|
||||
mutex_unlock(&mods_ffa_lock);
|
||||
|
||||
switch (p->cmd) {
|
||||
case MODS_FFA_CMD_READ_REG:
|
||||
|
||||
Reference in New Issue
Block a user