Merge "msm: ipa3: Fix to release IPA clock during ap suspend"

This commit is contained in:
Linux Build Service Account 2017-01-03 17:56:45 -08:00 committed by Gerrit - the friendly Code Review server
commit f20f3e51d4
2 changed files with 6 additions and 0 deletions

View file

@ -3616,6 +3616,7 @@ static int ipa3_apps_cons_request_resource(void)
static void ipa3_sps_release_resource(struct work_struct *work)
{
mutex_lock(&ipa3_ctx->transport_pm.transport_pm_mutex);
/* check whether still need to decrease client usage */
if (atomic_read(&ipa3_ctx->transport_pm.dec_clients)) {
if (atomic_read(&ipa3_ctx->transport_pm.eot_activity)) {
@ -3627,6 +3628,7 @@ static void ipa3_sps_release_resource(struct work_struct *work)
}
}
atomic_set(&ipa3_ctx->transport_pm.eot_activity, 0);
mutex_unlock(&ipa3_ctx->transport_pm.transport_pm_mutex);
}
int ipa3_create_apps_resource(void)
@ -4406,6 +4408,8 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
goto fail_create_transport_wq;
}
/* Initialize the SPS PM lock. */
mutex_init(&ipa3_ctx->transport_pm.transport_pm_mutex);
spin_lock_init(&ipa3_ctx->transport_pm.lock);
ipa3_ctx->transport_pm.res_granted = false;
ipa3_ctx->transport_pm.res_rel_in_prog = false;

View file

@ -974,6 +974,7 @@ struct ipa3_uc_wdi_ctx {
* @lock: lock for ensuring atomic operations
* @res_granted: true if SPS requested IPA resource and IPA granted it
* @res_rel_in_prog: true if releasing IPA resource is in progress
* @transport_pm_mutex: Mutex to protect the transport_pm functionality.
*/
struct ipa3_transport_pm {
spinlock_t lock;
@ -981,6 +982,7 @@ struct ipa3_transport_pm {
bool res_rel_in_prog;
atomic_t dec_clients;
atomic_t eot_activity;
struct mutex transport_pm_mutex;
};
/**