@@ -538,6 +538,11 @@ static int parse_xfer_event(struct mhi_controller *mhi_cntrl,
* from dropping the packet
*/
if (mhi_chan->pre_alloc) {
+ /*
+ * mhi_queue_buf() will grab the mhi_chan->lock
+ * so let's drop it here and grab it later
+ */
+ read_unlock_bh(&mhi_chan->lock);
if (mhi_queue_buf(mhi_chan->mhi_dev,
mhi_chan->dir,
buf_info->cb_buf,
@@ -547,6 +552,7 @@ static int parse_xfer_event(struct mhi_controller *mhi_cntrl,
mhi_chan->chan);
kfree(buf_info->cb_buf);
}
+ read_lock_bh(&mhi_chan->lock);
}
}
break;
mhi_queue_buf() will grab the 'mhi_chan->lock' for doing the doorbell access. Hence the lock needs to be dropped before the call. Fixes: 189ff97cca53 ("bus: mhi: core: Add support for data transfer") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> --- drivers/bus/mhi/core/main.c | 6 ++++++ 1 file changed, 6 insertions(+)