From patchwork Wed Sep 19 17:29:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 147039 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp987089ljw; Wed, 19 Sep 2018 10:31:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYcwzbmMVODl7Z7an630VQxtZyG8CSrcJjs+YJszGCtQyki7o57VmjE+1OWb6QPW20+7tGV X-Received: by 2002:a62:e813:: with SMTP id c19-v6mr37333045pfi.124.1537378291167; Wed, 19 Sep 2018 10:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537378291; cv=none; d=google.com; s=arc-20160816; b=L6hsyyXzmPSPigvLJUg6lqJNj1B+tsqRkBGDSIpkcFpbqkrY9AtErNk4eM39nP+yuS 2khMOxWiqQubFgsooNzZKGO2oj4sX1kF9Ve8ByK/WTpwV0W9Vu6crvnHUyivGFZYKN4+ Zg663jMp/w19Hvkz2dyWIxmGvLkGCwQ5l88C0UqOK5Wy++TdjFz6VUZpdEaHdXKKPV6s SDFoaDnm9dKiV5rAbpKnoWYbyLmYTaKBX+vb4KCCJ8eR6V6fVdWr0k4T4dh/L859aD19 5Ty4UVf68x3Y8vAXY9u6x2aIPn1SjwfRIwjUcPBe85/+rX6nnlbas+2aOOmWgNLvzWr1 ALEg== 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=ZwjOKIhIOeQkbIl13C2nyCZ/rXIa/HgY0oHe6S40fbk=; b=iiZDtT+aEYSRq81Md87iW9atDBL3N75Anw099QOf7iHkANRiTqsKWo1cpYCddRJDgr jqQZtgQutzIImk4XqjoiifazMjXahanQjOXbqFkW4P7XHEHOZ3SbvzTlR9sZAZEvCEaV seHgTDqS73JIcuX7Nr/gySjuKxztDWWpcKzFV7Qj90WT+t96q/1CSsJIq3ntDE8hc/FX RutNkV9hNsU0CfN7E1LP6TvYJy91u13UhQHerbZdhwU48COrKP1FU9s4E/ldm/UWOdHU lE4IR+v72d+WOWVV1Rk8gfY4fsk+nLtfSBhGQ3R0UbJJ+aQSvwrbnLRCEjHbZv7/Zelm SHAA== 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 r194-v6si24302417pfr.100.2018.09.19.10.31.30; Wed, 19 Sep 2018 10:31:31 -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 S1733256AbeISXKY (ORCPT + 32 others); Wed, 19 Sep 2018 19:10:24 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12210 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1733238AbeISXKX (ORCPT ); Wed, 19 Sep 2018 19:10:23 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 55B66F5954B78; Thu, 20 Sep 2018 01:31:23 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Thu, 20 Sep 2018 01:31:17 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 09/12] net: hns3: Fix cmdq registers initialization issue for vf Date: Wed, 19 Sep 2018 18:29:55 +0100 Message-ID: <20180919172958.12992-10-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180919172958.12992-1-salil.mehta@huawei.com> References: <20180919172958.12992-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen According to hardware's description, the head pointer register should be written before the tail pointer register while initializing the vf command queue. Otherwise, it may trigger an interrupt even though there is no command received. Fixes: fedd0c15d288 ("net: hns3: Add HNS3 VF IMP(Integrated Management Proc) cmd interface") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c index fb471fe..d8c0cc8 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c @@ -132,8 +132,8 @@ static int hclgevf_init_cmd_queue(struct hclgevf_dev *hdev, reg_val |= HCLGEVF_NIC_CMQ_ENABLE; hclgevf_write_dev(hw, HCLGEVF_NIC_CSQ_DEPTH_REG, reg_val); - hclgevf_write_dev(hw, HCLGEVF_NIC_CSQ_TAIL_REG, 0); hclgevf_write_dev(hw, HCLGEVF_NIC_CSQ_HEAD_REG, 0); + hclgevf_write_dev(hw, HCLGEVF_NIC_CSQ_TAIL_REG, 0); break; case HCLGEVF_TYPE_CRQ: reg_val = (u32)ring->desc_dma_addr; @@ -145,8 +145,8 @@ static int hclgevf_init_cmd_queue(struct hclgevf_dev *hdev, reg_val |= HCLGEVF_NIC_CMQ_ENABLE; hclgevf_write_dev(hw, HCLGEVF_NIC_CRQ_DEPTH_REG, reg_val); - hclgevf_write_dev(hw, HCLGEVF_NIC_CRQ_TAIL_REG, 0); hclgevf_write_dev(hw, HCLGEVF_NIC_CRQ_HEAD_REG, 0); + hclgevf_write_dev(hw, HCLGEVF_NIC_CRQ_TAIL_REG, 0); break; }