Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1017400imm; Wed, 19 Sep 2018 10:33:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbJwwyvV3KAxvI24bwKJwTpWs+5PWBLrZk2OKWepOs4hjR8LqIjaWCPTfQUz1de4CGm5gFx X-Received: by 2002:a17:902:848d:: with SMTP id c13-v6mr29287243plo.194.1537378417125; Wed, 19 Sep 2018 10:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537378417; cv=none; d=google.com; s=arc-20160816; b=youHzDAJvveW2i41yIk2obbmq/+V0+FCN+pNSQt3Xor1oUPq5kUCKiyJ+m2eTfDaLe +/nnoqPp1DR7GF8dr4crgTOypbt2PlobjaBs/BeeQndLbAcwgB8zf+WhWvFGkxUEvgh0 nl5hK3VzjoXCdl15Mb25SOPbj3CiJfpHb38SfiyvPky3Ecx3YfwyOFs8Tex7z9v3v1UO /oYd6kzHshPsey4S/HkxlMMVAvmQoV0Wb8iGoyV0jNU7FHnoratrYm1MeQLDixwvjUK8 77CUVRs2m3GyAlTNwqaJb2trkBFRjLZocFFSbP5u8dbCqfgXDi4mi7iLnOdtOXphrGjr JwsQ== 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 k6-v6si21529865pla.473.2018.09.19.10.33.22; Wed, 19 Sep 2018 10:33:37 -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 S1733252AbeISXKY (ORCPT + 99 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 Content-Type: text/plain 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(-) 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; } -- 2.7.4