From patchwork Sat May 19 15:53:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 136402 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2547205lji; Sat, 19 May 2018 08:56:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpMXgN7sLJ+epnuCwxeNWbW2kUwfvv7SwiFlu1kyb8ENr0frWnBcvIPy8PL41hMAVVL6BU9 X-Received: by 2002:a17:902:5709:: with SMTP id k9-v6mr13654289pli.165.1526745404893; Sat, 19 May 2018 08:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526745404; cv=none; d=google.com; s=arc-20160816; b=qCpdAzZMmbaeujMz6u3AqXJ6P2G2Z7KDbg/1R4AigcbchRm1BaMQLbMfb7eE7cxjr9 I0on7isfgEX+2qBRlSZK2R+NbT3L/t+Gx8Ll7EYRNmSMoNlcV3411KqUCd2wGzckd4el TSLkLRCh241VXbQU5gEtb0ZD2x0OcsStoTdHM6LH/dL9BOojqMWyb0iE68V93C/DIb2v cVvkgMCzaF6L7Isbiy34ZRubVoJHjvAiTQDnxEtxPTwcD2dHkrbFu9e4Q87Px2/Uutho +7cH/zheyKtweBKV2Tlpqvri3OOocwfB+194MxCdW/TjphuyUS5WzyeRI7rSFf/5zZFt JB+A== 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:arc-authentication-results; bh=XN/0xCFqmsf92t5w+o5rZl6QR1FQ+BIZ+zzJ7Tk7Xno=; b=Ro8KT+4cizcVHY7sYaeD91tQd9+hk+LHMf4UJMW3oZfUxUon+u/k3MD8CPKQaTWZ8l 8uW2H+36vNLDWusdXQ/LU0Aa4PiS8gsSc/Vl2fKRqfvKyglQPkXROcBFNChj+214S4kW s1MebUCT4Cejj+esWufn0P9nzTd53yIP/a8Eq/xqZMHxQ2UcIYmSpMKmApkjv6aDOYV7 TL2461TvK1KtRjF+xndZT2O3Op85UW1RRP4nopEJF1Iy4TeYAZdvA8Nz5uXBsxl0sMnW jY91i+aDNmaPdaH2QvqI4mlINYXwiw8PFJYmWnG3/cr7gDhYb5VBrv757+8fhhNPnyQK Xa4Q== 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 o12-v6si10100931pfd.199.2018.05.19.08.56.44; Sat, 19 May 2018 08:56:44 -0700 (PDT) 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 S1752721AbeESP4m (ORCPT + 29 others); Sat, 19 May 2018 11:56:42 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:39243 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752584AbeESPyz (ORCPT ); Sat, 19 May 2018 11:54:55 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 50AF7E2462413; Sat, 19 May 2018 23:54:48 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.382.0; Sat, 19 May 2018 23:54:40 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 9/9] net: hns3: Fix for CMDQ and Misc. interrupt init order problem Date: Sat, 19 May 2018 16:53:23 +0100 Message-ID: <20180519155323.68960-10-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180519155323.68960-1-salil.mehta@huawei.com> References: <20180519155323.68960-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin When vf module is loading, the cmd queue initialization should happen before misc interrupt initialization, otherwise the misc interrupt handle will cause using uninitialized cmd queue problem. There is also the same issue when vf module is unloading. This patch fixes it by adjusting the location of some function. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index f1f4a17..2b0e329 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1634,6 +1634,10 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev) hclgevf_state_init(hdev); + ret = hclgevf_cmd_init(hdev); + if (ret) + goto err_cmd_init; + ret = hclgevf_misc_irq_init(hdev); if (ret) { dev_err(&pdev->dev, "failed(%d) to init Misc IRQ(vector0)\n", @@ -1641,10 +1645,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev) goto err_misc_irq_init; } - ret = hclgevf_cmd_init(hdev); - if (ret) - goto err_cmd_init; - ret = hclgevf_configure(hdev); if (ret) { dev_err(&pdev->dev, "failed(%d) to fetch configuration\n", ret); @@ -1692,10 +1692,10 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev) return 0; err_config: - hclgevf_cmd_uninit(hdev); -err_cmd_init: hclgevf_misc_irq_uninit(hdev); err_misc_irq_init: + hclgevf_cmd_uninit(hdev); +err_cmd_init: hclgevf_state_uninit(hdev); hclgevf_uninit_msi(hdev); err_irq_init: @@ -1705,9 +1705,9 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev) static void hclgevf_uninit_hdev(struct hclgevf_dev *hdev) { - hclgevf_cmd_uninit(hdev); - hclgevf_misc_irq_uninit(hdev); hclgevf_state_uninit(hdev); + hclgevf_misc_irq_uninit(hdev); + hclgevf_cmd_uninit(hdev); hclgevf_uninit_msi(hdev); hclgevf_pci_uninit(hdev); }