From patchwork Thu Jun 13 09:12:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huazhong Tan X-Patchwork-Id: 166700 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp837500oca; Thu, 13 Jun 2019 08:49:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMI7yliOewj5b86y10EfdExf85tnVX8rBrfBIxeNz/OeXsdlkCnw7XeMjWr7Ncidlf6Buq X-Received: by 2002:aa7:919a:: with SMTP id x26mr80027139pfa.134.1560440992798; Thu, 13 Jun 2019 08:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560440992; cv=none; d=google.com; s=arc-20160816; b=PaYQz6AhO7XZLZNAZb8k4hpXpJLrc9QcwNlyIf3RrVgoPYjZltBu9HI/mDnWzM+SYw cv1sjbKv7zGBg40Qw615LHkn+5za7+kDMPa2rh/N8oO8E3MYQhUO1bLPNDbqEKt7cb4M CumX5IgVWh0mTYMbKlqZ1kqqE+oriUBA/NumCBqv8dAs/xbtXLaLjFy6mLkDvW1k1PJk MN5dZkCXgLIKRhoodjZUqHP6PPtghYXvwZh6Vgc9KLLYEDSF3JofdUT5nEW4k1HJUa5o 3MUEkE4t4afXN4GYINX0S7WD9XwD4WG9si6phRBMb6g5bPcGOTKV2jp/ZfZAKNFNW297 HcSg== 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=bZjI4r4/QaKRWGVzXpbd1GwLghu2oDC7XU1xG1c1vQA=; b=IJsrmmqN95eN8W78RA9qpuU8AG1ER8IKDsv+MqDqKlQhCwSTiVNC7cDFXsX7EwE9aE mLDOsT1bhEiTqFZ2pvmwcd0iAaOwYWsYkM05BHCoYI14s687NeVikm8CiaB15CLwd3yr Qifdids450T6h1kCVYFFPAD5miSFYDx11m4aZPolxhaqv9ghDHb9h+vNRlBychU4apxK M5DvhcWa/oBuQlads6IYrHGxyvTYgIndXu/ElT/0j9OjsW79/sRgNhWpuf4hS8N6CIM7 iFiqCKpqtWAIfAybNyJ0CnnGXaTLqdet7bmVMTi9vXLPTCDonSFE8F16heQTtg+XZXNg Intw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 v142si117162pgb.459.2019.06.13.08.49.52; Thu, 13 Jun 2019 08:49:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389427AbfFMPtv (ORCPT + 9 others); Thu, 13 Jun 2019 11:49:51 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:18152 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731698AbfFMJOT (ORCPT ); Thu, 13 Jun 2019 05:14:19 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3EA0D12B51684788EC5D; Thu, 13 Jun 2019 17:14:14 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Thu, 13 Jun 2019 17:14:07 +0800 From: Huazhong Tan To: CC: , , , , , Shiju Jose , Peng Li , "Huazhong Tan" Subject: [PATCH net-next 04/12] net: hns3: add recovery for the H/W errors occurred before the HNS dev initialization Date: Thu, 13 Jun 2019 17:12:24 +0800 Message-ID: <1560417152-53050-5-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560417152-53050-1-git-send-email-tanhuazhong@huawei.com> References: <1560417152-53050-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Shiju Jose This patch adds the recovery for the HNS H/W errors which occurred before the driver initialization. Reported-by: Salil Mehta Signed-off-by: Shiju Jose Signed-off-by: Peng Li Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index d9863c30..6761d72 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3236,6 +3236,7 @@ static bool hclge_reset_err_handle(struct hclge_dev *hdev, bool is_timeout) dev_info(&hdev->pdev->dev, "Upgrade reset level\n"); hclge_clear_reset_cause(hdev); + set_bit(HNAE3_GLOBAL_RESET, &hdev->default_reset_request); mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL); @@ -3430,8 +3431,7 @@ static void hclge_reset_timer(struct timer_list *t) struct hclge_dev *hdev = from_timer(hdev, t, reset_timer); dev_info(&hdev->pdev->dev, - "triggering global reset in reset timer\n"); - set_bit(HNAE3_GLOBAL_RESET, &hdev->default_reset_request); + "triggering reset in reset timer\n"); hclge_reset_event(hdev->pdev, NULL); } @@ -8614,6 +8614,18 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) /* Log and clear the hw errors those already occurred */ hclge_handle_all_hns_hw_errors(ae_dev); + /* request delayed reset for the error recovery because an immediate + * global reset on a PF affecting pending initialization of other PFs + */ + if (ae_dev->hw_err_reset_req) { + enum hnae3_reset_type reset_level; + + reset_level = hclge_get_reset_level(ae_dev, + &ae_dev->hw_err_reset_req); + hclge_set_def_reset_request(ae_dev, reset_level); + mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL); + } + /* Enable MISC vector(vector0) */ hclge_enable_vector(&hdev->misc_vector, true);