lqe_write_unlock(lqe);
out_nolock:
- qti_lqes_restore_fini(env);
- if (th != NULL && !IS_ERR(th))
- dt_trans_stop(env, qmt->qmt_child, th);
+ if (!is_updated) {
+ if (th != NULL && !IS_ERR(th))
+ dt_trans_stop(env, qmt->qmt_child, th);
+ qti_lqes_restore_fini(env);
+ }
if (rc == 0 && dirtied) {
qmt_glb_lock_notify(env, lqe, ver);
* values(see qmt_id_lock_cb for details).*/
need_id_notify = true;
}
- if (need_id_notify)
+ /* qti_lqes_inited > 0 means we came here from another
+ * qmt_pool_lqes_lookup(qmt_dqacq, intent_policy ...). Thus
+ * we can't init and add new lqes to don't overwrite already
+ * added.
+ */
+ if (!qti_lqes_inited(env) && need_id_notify)
qmt_set_id_notify(env, qmt, lqe);
}