summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
diff options
context:
space:
mode:
authorPeng Li <lipeng321@huawei.com>2018-12-20 11:52:00 +0800
committerDavid S. Miller <davem@davemloft.net>2018-12-19 23:47:58 -0800
commit1b7d7b0581173219b82abbd81c88cf8aa7d402c2 (patch)
treef4efe8a72d8aac9200b766b02942f473a6cfb761 /drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
parenta298797532d9dc244abf349d7c2ed063732c6ba3 (diff)
downloadlinux-stable-1b7d7b0581173219b82abbd81c88cf8aa7d402c2.tar.gz
linux-stable-1b7d7b0581173219b82abbd81c88cf8aa7d402c2.tar.bz2
linux-stable-1b7d7b0581173219b82abbd81c88cf8aa7d402c2.zip
net: hns3: fix a bug caused by udelay
udelay() in driver may always occupancy processor. If there is only one cpu in system, the VF driver may initialize fail when insmod PF and VF driver in the same system. This patch use msleep() to free cpu when VF wait PF message. Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
index ef9c8e6eca28..84653f58b2d1 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c
@@ -26,7 +26,7 @@ static int hclgevf_get_mbx_resp(struct hclgevf_dev *hdev, u16 code0, u16 code1,
u8 *resp_data, u16 resp_len)
{
#define HCLGEVF_MAX_TRY_TIMES 500
-#define HCLGEVF_SLEEP_USCOEND 1000
+#define HCLGEVF_SLEEP_USECOND 1000
struct hclgevf_mbx_resp_status *mbx_resp;
u16 r_code0, r_code1;
int i = 0;
@@ -43,7 +43,7 @@ static int hclgevf_get_mbx_resp(struct hclgevf_dev *hdev, u16 code0, u16 code1,
if (test_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state))
return -EIO;
- udelay(HCLGEVF_SLEEP_USCOEND);
+ usleep_range(HCLGEVF_SLEEP_USECOND, HCLGEVF_SLEEP_USECOND * 2);
i++;
}