Received: by 10.223.164.202 with SMTP id h10csp1194642wrb; Tue, 7 Nov 2017 23:53:14 -0800 (PST) X-Google-Smtp-Source: ABhQp+Qw6nRdOPlAQpspYFFbJ78ouPnnhekPNhN4TqgW1bgRzUsvUV6qIjtjq3jD3M4iUgjpVHvM X-Received: by 10.84.192.37 with SMTP id b34mr1416013pld.451.1510127594126; Tue, 07 Nov 2017 23:53:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127594; cv=none; d=google.com; s=arc-20160816; b=AiTOE1Vcps5fUNj9o0f/gHq1H9DtNuiVS5JA3+NLOQ1cqEcJ8tjXGKO+RiMqZWebCS giUW9VFAagZe5nBZ/E6akz7M+VUChs3RpLQXaEJHp6wlyI32e/bTRErZx6L9FCtc/olk DMFQ9+Bq4fInkV0Wek1yzlVpJ6Ipu/sebtHUkhQ9om08n4VcReONx8bxXu5jhmkn+xVA PAT64VLnOukimiKOtxfcDGMnm8Rm5eXvhQRA9zhTcCydJwzkMvmT2q4tQtHRiqixBj9i +npcDWMg6sFL2oyMZ4HP0bkOX+hZFQsrqbWMB8Xnvv4NsbteSNHL6W5AxTK7uyfiN6sL hksw== 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=qFQ87O3ARB8w0grSrfP0rLP/e+eWJLKGLoiuy2mN7ao=; b=EgjdWH6EELe2WVC7gWyvYsrastuoXoG1kVvdGGk0KQZ/oPDU8bFZBilBLR29Z4paY2 3KTneWh8v1tkLOlb6GCSxiZoKPx31vNBHzeZ9F/lkJzVl5jz1WJfwLDb9C66oH9O1ese H/nAH+49mDlImGurTkja37XGwdh67wUGed2o5pn9Y37GE/ROe+ivXEWMQlI9Wi44RjYP Pzb8D0YQfTmRm4oVR2gFQE2yynF0+66gBllUBcb4bn6GS9G/6tIMj+FcNQ952bvSFQsJ RlNWP8Bn8/BP3N2DybhXmxqU2GnqVRIb25rD5terfbs/Srh7Lk+Ha84C1PZC1p9wleYw MzJg== 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 60si3115175plc.104.2017.11.07.23.53.01; Tue, 07 Nov 2017 23:53:14 -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 S1755860AbdKHHCd (ORCPT + 91 others); Wed, 8 Nov 2017 02:02:33 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10030 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753162AbdKHHCc (ORCPT ); Wed, 8 Nov 2017 02:02:32 -0500 Received: from 172.30.72.60 (EHLO DGGEMS405-HUB.china.huawei.com) ([172.30.72.60]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKN96207; Wed, 08 Nov 2017 15:02:28 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Wed, 8 Nov 2017 15:01:59 +0800 From: Lipeng To: CC: , , , , , Subject: [PATCH net-next 1/2] {topost} net: hns3: fix a bug when getting phy address from NCL_config file Date: Wed, 8 Nov 2017 15:31:18 +0800 Message-ID: <1510126279-31751-2-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510126279-31751-1-git-send-email-lipeng321@huawei.com> References: <1510126279-31751-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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.5A02AC04.0376,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: f96acf8589d10f5fe0f679610c5de724 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang Driver gets phy address from NCL_config file and uses the phy address to initialize phydev. There are 5 bits for phy address. And C22 phy address has 5 bits. So 0-31 are all valid address for phy. If there is no phy, it will crash. Because driver always get a valid phy address. This patch fixes the phy address to 8 bits, and use 0xff to indicate invalid phy address. Fixes: 46a3df9f9718 (net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support) Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index 844c83e..ce5ed88 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -390,7 +390,7 @@ struct hclge_pf_res_cmd { #define HCLGE_CFG_TQP_DESC_N_S 16 #define HCLGE_CFG_TQP_DESC_N_M GENMASK(31, 16) #define HCLGE_CFG_PHY_ADDR_S 0 -#define HCLGE_CFG_PHY_ADDR_M GENMASK(4, 0) +#define HCLGE_CFG_PHY_ADDR_M GENMASK(7, 0) #define HCLGE_CFG_MEDIA_TP_S 8 #define HCLGE_CFG_MEDIA_TP_M GENMASK(15, 8) #define HCLGE_CFG_RX_BUF_LEN_S 16 -- 1.9.1 From 1583516130240962570@xxx Wed Nov 08 16:31:03 +0000 2017 X-GM-THRID: 1583516130240962570 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread