Merge "msm: ipa: Fix to protect odl pipe operations"

This commit is contained in:
qctecmdr
2023-12-14 13:24:39 -08:00
committed by Gerrit - the friendly Code Review server
3 changed files with 20 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/* /*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#include "ipa_i.h" #include "ipa_i.h"
@@ -470,6 +470,20 @@ static int ipa_adpl_release(struct inode *inode, struct file *filp)
return ret; return ret;
} }
void ipa3_odl_pipe_open_from_ssr(void)
{
mutex_lock(&ipa3_odl_ctx->pipe_lock);
ipa3_odl_pipe_open();
mutex_unlock(&ipa3_odl_ctx->pipe_lock);
}
void ipa3_odl_pipe_cleanup_from_ssr(void)
{
mutex_lock(&ipa3_odl_ctx->pipe_lock);
ipa3_odl_pipe_cleanup(true);
mutex_unlock(&ipa3_odl_ctx->pipe_lock);
}
void ipa3_odl_pipe_cleanup(bool is_ssr) void ipa3_odl_pipe_cleanup(bool is_ssr)
{ {
bool ipa_odl_opened = false; bool ipa_odl_opened = false;

View File

@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/ */
#ifndef _IPA3_ODL_H_ #ifndef _IPA3_ODL_H_
@@ -73,5 +74,6 @@ int ipa_odl_init(void);
void ipa_odl_cleanup(void); void ipa_odl_cleanup(void);
void ipa3_odl_pipe_cleanup(bool is_ssr); void ipa3_odl_pipe_cleanup(bool is_ssr);
int ipa3_odl_pipe_open(void); int ipa3_odl_pipe_open(void);
void ipa3_odl_pipe_open_from_ssr(void);
void ipa3_odl_pipe_cleanup_from_ssr(void);
#endif /* _IPA3_ODL_H_ */ #endif /* _IPA3_ODL_H_ */

View File

@@ -3991,7 +3991,7 @@ static int ipa3_lcl_mdm_ssr_notifier_cb(struct notifier_block *this,
if (atomic_read(&rmnet_ipa3_ctx->is_ssr) && if (atomic_read(&rmnet_ipa3_ctx->is_ssr) &&
ipa3_ctx_get_type(IPA_HW_TYPE) >= IPA_HW_v4_0) ipa3_ctx_get_type(IPA_HW_TYPE) >= IPA_HW_v4_0)
ipa3_q6_post_shutdown_cleanup(); ipa3_q6_post_shutdown_cleanup();
ipa3_odl_pipe_cleanup(true); ipa3_odl_pipe_cleanup_from_ssr();
IPAWANINFO("IPA BEFORE_SHUTDOWN handling is complete\n"); IPAWANINFO("IPA BEFORE_SHUTDOWN handling is complete\n");
break; break;
#if IS_ENABLED(CONFIG_DEEPSLEEP) #if IS_ENABLED(CONFIG_DEEPSLEEP)
@@ -4074,7 +4074,7 @@ static int ipa3_lcl_mdm_ssr_notifier_cb(struct notifier_block *this,
if (!atomic_read(&rmnet_ipa3_ctx->is_initialized) && if (!atomic_read(&rmnet_ipa3_ctx->is_initialized) &&
atomic_read(&rmnet_ipa3_ctx->is_ssr)) atomic_read(&rmnet_ipa3_ctx->is_ssr))
platform_driver_register(&rmnet_ipa_driver); platform_driver_register(&rmnet_ipa_driver);
ipa3_odl_pipe_open(); ipa3_odl_pipe_open_from_ssr();
IPAWANINFO("IPA AFTER_POWERUP handling is complete\n"); IPAWANINFO("IPA AFTER_POWERUP handling is complete\n");
break; break;
default: default: