]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: hns3: code optimization for command queue' spin lock
authorPeng Li <lipeng321@huawei.com>
Sun, 14 Apr 2019 01:47:46 +0000 (09:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 14 Apr 2019 20:47:35 +0000 (13:47 -0700)
This patch removes some redundant BH disable when initializing
and uninitializing command queue.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c

index cf7ff4ad2c3d15f662e0e72b6d80517eaa713df7..fbd904e3077cf6219b270df37a0058140a946784 100644 (file)
@@ -355,7 +355,7 @@ int hclge_cmd_init(struct hclge_dev *hdev)
        int ret;
 
        spin_lock_bh(&hdev->hw.cmq.csq.lock);
-       spin_lock_bh(&hdev->hw.cmq.crq.lock);
+       spin_lock(&hdev->hw.cmq.crq.lock);
 
        hdev->hw.cmq.csq.next_to_clean = 0;
        hdev->hw.cmq.csq.next_to_use = 0;
@@ -364,7 +364,7 @@ int hclge_cmd_init(struct hclge_dev *hdev)
 
        hclge_cmd_init_regs(&hdev->hw);
 
-       spin_unlock_bh(&hdev->hw.cmq.crq.lock);
+       spin_unlock(&hdev->hw.cmq.crq.lock);
        spin_unlock_bh(&hdev->hw.cmq.csq.lock);
 
        clear_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state);
index 054556eb0d70b86e4ad2ab4801e342fbb6ee65fc..1b428d4a1132b22f7f40f2cc9037fd95185522c4 100644 (file)
@@ -334,7 +334,7 @@ int hclgevf_cmd_init(struct hclgevf_dev *hdev)
        int ret;
 
        spin_lock_bh(&hdev->hw.cmq.csq.lock);
-       spin_lock_bh(&hdev->hw.cmq.crq.lock);
+       spin_lock(&hdev->hw.cmq.crq.lock);
 
        /* initialize the pointers of async rx queue of mailbox */
        hdev->arq.hdev = hdev;
@@ -348,7 +348,7 @@ int hclgevf_cmd_init(struct hclgevf_dev *hdev)
 
        hclgevf_cmd_init_regs(&hdev->hw);
 
-       spin_unlock_bh(&hdev->hw.cmq.crq.lock);
+       spin_unlock(&hdev->hw.cmq.crq.lock);
        spin_unlock_bh(&hdev->hw.cmq.csq.lock);
 
        clear_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state);