From c0e7627fca461d9badad115178f97d2b8f21bf85 Mon Sep 17 00:00:00 2001 From: Jay Jayanna Date: Wed, 24 Jul 2019 22:39:59 -0700 Subject: [PATCH] net: qrtr: mhi: Use spin_lock_bh in qcom_mhi_qrtr_send Use spin_lock_bh in qcom_mhi_qrtr_send as this is sufficient to avoid recursive spin lock issue. Change-Id: I214c056f66831837b7589940fe1789d0e9edc00c Signed-off-by: Jay Jayanna --- net/qrtr/mhi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/qrtr/mhi.c b/net/qrtr/mhi.c index 17a7677e8e40..90dc2e917f5b 100644 --- a/net/qrtr/mhi.c +++ b/net/qrtr/mhi.c @@ -103,7 +103,6 @@ static int qcom_mhi_qrtr_send(struct qrtr_endpoint *ep, struct sk_buff *skb) { struct qrtr_mhi_dev *qdev = container_of(ep, struct qrtr_mhi_dev, ep); struct qrtr_mhi_pkt *pkt; - unsigned long flags; int rc; rc = skb_linearize(skb); @@ -123,7 +122,7 @@ static int qcom_mhi_qrtr_send(struct qrtr_endpoint *ep, struct sk_buff *skb) kref_get(&pkt->refcount); pkt->skb = skb; - spin_lock_irqsave(&qdev->ul_lock, flags); + spin_lock_bh(&qdev->ul_lock); list_add_tail(&pkt->node, &qdev->ul_pkts); rc = mhi_queue_transfer(qdev->mhi_dev, DMA_TO_DEVICE, skb, skb->len, MHI_EOT); @@ -131,10 +130,10 @@ static int qcom_mhi_qrtr_send(struct qrtr_endpoint *ep, struct sk_buff *skb) list_del(&pkt->node); kfree_skb(skb); kfree(pkt); - spin_unlock_irqrestore(&qdev->ul_lock, flags); + spin_unlock_bh(&qdev->ul_lock); return rc; } - spin_unlock_irqrestore(&qdev->ul_lock, flags); + spin_unlock_bh(&qdev->ul_lock); if (skb->sk) sock_hold(skb->sk);