From ffa9b7ab8395e95e8545c0050245e9c2b8396827 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Singh Date: Fri, 3 Sep 2021 11:54:32 +0530 Subject: [PATCH] net: qrtr: mhi_dev: unblock any tx on mhi disconnect If host is not using qrtr channel, Tx on device may block for availabilty of tre. If we try to unregister qrtr endpoint at the same time it will block for endpoint lock held in Tx path. Unblock any Tx before calling qrtr endpoint unregister. Change-Id: I59b1a68fd2279ba6bc472a3a532102e82f094175 Signed-off-by: Deepak Kumar Singh --- net/qrtr/mhi_dev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/qrtr/mhi_dev.c b/net/qrtr/mhi_dev.c index 3f6091c1656b..f93600092745 100644 --- a/net/qrtr/mhi_dev.c +++ b/net/qrtr/mhi_dev.c @@ -189,6 +189,10 @@ static void qrtr_mhi_dev_state_cb(struct mhi_dev_client_cb_data *cb_data) } break; case MHI_STATE_DISCONNECTED: + mutex_lock(&qep->out_lock); + complete_all(&qep->out_tre); + mutex_unlock(&qep->out_lock); + qrtr_endpoint_unregister(&qep->ep); qrtr_mhi_dev_close_channels(qep); break;