mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
mhi: core: check MHI PM state under pm_lock
MHI PM state for suspended states needs to be checked under pm_lock, otherwise MHI host could miss transition state and result in a data stall. CRs-Fixed: 2279502 Change-Id: I55cdfb1d5ab5fc745a0e06977c89a18e412c6129 Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
This commit is contained in:
parent
058c23fa7c
commit
dc19827181
@ -504,12 +504,6 @@ int mhi_queue_buf(struct mhi_device *mhi_dev,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* we're in M3 or transitioning to M3 */
|
||||
if (MHI_PM_IN_SUSPEND_STATE(mhi_cntrl->pm_state)) {
|
||||
mhi_cntrl->runtime_get(mhi_cntrl, mhi_cntrl->priv_data);
|
||||
mhi_cntrl->runtime_put(mhi_cntrl, mhi_cntrl->priv_data);
|
||||
}
|
||||
|
||||
tre_ring = &mhi_chan->tre_ring;
|
||||
if (mhi_is_ring_full(mhi_cntrl, tre_ring))
|
||||
return -ENOMEM;
|
||||
@ -520,6 +514,12 @@ int mhi_queue_buf(struct mhi_device *mhi_dev,
|
||||
|
||||
read_lock_irqsave(&mhi_cntrl->pm_lock, flags);
|
||||
|
||||
/* we're in M3 or transitioning to M3 */
|
||||
if (MHI_PM_IN_SUSPEND_STATE(mhi_cntrl->pm_state)) {
|
||||
mhi_cntrl->runtime_get(mhi_cntrl, mhi_cntrl->priv_data);
|
||||
mhi_cntrl->runtime_put(mhi_cntrl, mhi_cntrl->priv_data);
|
||||
}
|
||||
|
||||
/*
|
||||
* For UL channels always assert WAKE until work is done,
|
||||
* For DL channels only assert if MHI is in a LPM
|
||||
|
Loading…
x
Reference in New Issue
Block a user