Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp437196imu; Wed, 19 Dec 2018 22:35:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wj7AWgdxPw7GKENxMoQONcFw2D+4hbuiDitX15MD+h+oru75PI62IhPrjYonburWPvgsjf X-Received: by 2002:a63:960a:: with SMTP id c10mr21774790pge.106.1545287716635; Wed, 19 Dec 2018 22:35:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545287716; cv=none; d=google.com; s=arc-20160816; b=RHYVV+1ZFSpQQt9Uc80TlX/24NsLqe7avxAjdTQYNajq1lEjO8f/aOA2IJB3SrrwbP MhXENuJqEoRTjHvdgLlG19R6BJMeqjyK0N0tz1N123gI377mzFOyAYOjnfQDWXc2XOIG i9QplzgFvkJg7xccwVTuK9iUE0q3yY1tL9ZaRr1Gn/GvE3Yn3vNooKeYgBW5c+m6nENv bAHIh+Eo1B4f+BVgHUTuWYmG0sMf/uZH1IYSqKTaa/OE5vEe3KSa+JP1vO9f4n8FwlL7 kTGeNv1WAWQvXCbdmuuM4LVnuptqhcnuIFK0l6D4bZfAo5LUnLsUueuxJhqWGUHoqq7n VFgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=2YrEH+4G4FFgYFbpVUHWXv+MMoWC8Xu3RVgMisc+2YI=; b=KkB9S66bVmRBGD1jlcYEXl/JyaBpA3P/T0TzLwaeYVK7DGbAT//CBnYWW6EGIeHAZA 9OCIiK5YTchwDmsCu9W+ogdNx8qCfpCYbkVy8XgPvTELjZV9V59vHv9gyQuy1ob0vLxP Da00lKD5aE2SkfHxpeV0VTFej2GUG0ItTgXQQRqnTUm9+5gH/hC/+lNQfrBgFMunOghl Xe6ESkfO/XSbUjtJVzzWkmhffKLgp7ovQxdSjKZf+cel5B1SEDWYcei5KLS7JvIXDWlI f3HRWv50YpCqRIlXR75dHSvsaacvdqeXiOR8j2cTk/TiJWk5eO0nQQuFUDB8xnNX971I KnHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f81si19936938pfh.33.2018.12.19.22.35.01; Wed, 19 Dec 2018 22:35:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730197AbeLTDRV (ORCPT + 99 others); Wed, 19 Dec 2018 22:17:21 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:59714 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729523AbeLTDQZ (ORCPT ); Wed, 19 Dec 2018 22:16:25 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EE04136128727; Thu, 20 Dec 2018 11:16:19 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.408.0; Thu, 20 Dec 2018 11:16:15 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 3/9] net: hns3: fix a bug caused by udelay Date: Thu, 20 Dec 2018 11:52:00 +0800 Message-ID: <1545277926-66432-4-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1545277926-66432-1-git-send-email-lipeng321@huawei.com> References: <1545277926-66432-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 4 ++-- 1 file 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 ef9c8e6..84653f5 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++; } -- 1.9.1