|
@@ -1,6 +1,6 @@
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
/*
|
|
|
- * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
|
|
*/
|
|
|
|
|
|
#include "ipa_i.h"
|
|
@@ -418,6 +418,7 @@ static int ipa_adpl_open(struct inode *inode, struct file *filp)
|
|
|
int ret = 0;
|
|
|
|
|
|
IPADBG("Called the function :\n");
|
|
|
+ mutex_lock(&ipa3_odl_ctx->pipe_lock);
|
|
|
if (ipa3_odl_ctx->odl_state.odl_init &&
|
|
|
!ipa3_odl_ctx->odl_state.adpl_open) {
|
|
|
/* Activate ipa_pm*/
|
|
@@ -431,6 +432,7 @@ static int ipa_adpl_open(struct inode *inode, struct file *filp)
|
|
|
print_ipa_odl_state_bit_mask();
|
|
|
ret = -ENODEV;
|
|
|
}
|
|
|
+ mutex_unlock(&ipa3_odl_ctx->pipe_lock);
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
@@ -439,6 +441,7 @@ static int ipa_adpl_release(struct inode *inode, struct file *filp)
|
|
|
{
|
|
|
int ret = 0;
|
|
|
/* Deactivate ipa_pm */
|
|
|
+ mutex_lock(&ipa3_odl_ctx->pipe_lock);
|
|
|
ret = ipa_pm_deactivate_sync(ipa3_odl_ctx->odl_pm_hdl);
|
|
|
if (ret)
|
|
|
IPAERR("failed to activate pm\n");
|
|
@@ -451,6 +454,7 @@ static int ipa_adpl_release(struct inode *inode, struct file *filp)
|
|
|
IPAERR("mpm failed to disable ADPL over ODL\n");
|
|
|
|
|
|
}
|
|
|
+ mutex_unlock(&ipa3_odl_ctx->pipe_lock);
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
@@ -667,6 +671,7 @@ int ipa_odl_init(void)
|
|
|
odl_cdev = ipa3_odl_ctx->odl_cdev;
|
|
|
INIT_LIST_HEAD(&ipa3_odl_ctx->adpl_msg_list);
|
|
|
mutex_init(&ipa3_odl_ctx->adpl_msg_lock);
|
|
|
+ mutex_init(&ipa3_odl_ctx->pipe_lock);
|
|
|
|
|
|
odl_cdev[loop].class = class_create(THIS_MODULE, "ipa_adpl");
|
|
|
|