[PATCH net 7/9] hv_netvsc: don't need full irqsave for request_lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since the driver incoming handling is done with NAPI.
This path is run in softirq (not hardirq) therefore don't
need to do full local irq save/restore.

Signed-off-by: Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>
---
 drivers/net/hyperv/rndis_filter.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 1cba767c6453..3ce11361634f 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -92,7 +92,6 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
 	struct rndis_request *request;
 	struct rndis_message *rndis_msg;
 	struct rndis_set_request *set;
-	unsigned long flags;
 
 	request = kzalloc(sizeof(struct rndis_request), GFP_KERNEL);
 	if (!request)
@@ -115,9 +114,9 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
 	set->req_id = atomic_inc_return(&dev->new_req_id);
 
 	/* Add to the request list */
-	spin_lock_irqsave(&dev->request_lock, flags);
+	spin_lock_bh(&dev->request_lock);
 	list_add_tail(&request->list_ent, &dev->req_list);
-	spin_unlock_irqrestore(&dev->request_lock, flags);
+	spin_unlock_bh(&dev->request_lock);
 
 	return request;
 }
@@ -125,11 +124,9 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
 static void put_rndis_request(struct rndis_device *dev,
 			    struct rndis_request *req)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(&dev->request_lock, flags);
+	spin_lock_bh(&dev->request_lock);
 	list_del(&req->list_ent);
-	spin_unlock_irqrestore(&dev->request_lock, flags);
+	spin_unlock_bh(&dev->request_lock);
 
 	kfree(req);
 }
@@ -269,10 +266,9 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
 {
 	struct rndis_request *request = NULL;
 	bool found = false;
-	unsigned long flags;
 	struct net_device *ndev = dev->ndev;
 
-	spin_lock_irqsave(&dev->request_lock, flags);
+	spin_lock_bh(&dev->request_lock);
 	list_for_each_entry(request, &dev->req_list, list_ent) {
 		/*
 		 * All request/response message contains RequestId as the 1st
@@ -284,7 +280,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
 			break;
 		}
 	}
-	spin_unlock_irqrestore(&dev->request_lock, flags);
+	spin_unlock_bh(&dev->request_lock);
 
 	if (found) {
 		if (resp->msg_len <=
-- 
2.16.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux