Received: by 10.223.164.202 with SMTP id h10csp1195345wrb; Tue, 7 Nov 2017 23:54:07 -0800 (PST) X-Google-Smtp-Source: ABhQp+T/KBgLw3+1LCVutTB9rCAYqJgQmlJJjj5XOPBHaNRGmwSp+hyfnD0kbf+qdkIh/T1CTruj X-Received: by 10.159.229.130 with SMTP id az2mr1464754plb.113.1510127647125; Tue, 07 Nov 2017 23:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127647; cv=none; d=google.com; s=arc-20160816; b=tpjxJDcNLL5alPuEgWtC0QAK5HQfzIM/NB7RfsVibbHbJ4my4fkMKZsDLbmIo2zCJz ovOfiIJ33kMH6Wy/5TRgNYqQ5f4WMk7ASpwABBbkOT25HL+wtKsHbd7lUsaVoX8G6s1/ jNfh8fe0Un3E+GwtE/C6CTnV6msrwPYnkquaUDY5SvcTuPkrOC+PDpt+XLRw0lie0Rj3 6hwi4/UpZkQCVZAzHbJvwYSDyGuux/rN+sS2poGl6C02zRVcv9ZRwKsJ315/R/rFxoYv Da8NV8jiKz5A8FuvRmOOE1ljdSY8VgmWmxoQIpPevGTOnT/PfGZ6duWdY3vWPMVPOnoE VWtA== 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=M2m8wvwAQdTmsElMxLt0Q8q+ixxbKAOr+LjEkDMqwmXZI028N/N14vvExURkoEIflI p48eN+It/xdHrhuS92ScJEn81x5ZDig8urair7EgG5Sok3ZSyNMJOolwLSX0otnlhv7u TxWv6EMFLO6zCz8Jti4QA6pOwTAbtMTbq4fdsU8FtvxPal17DxZ+OEK/sbVLxmfqggcV Zc/wt8u9dQADzlrDLw3k1TRTX0t7IX+TfXdO3q33SFnIgnfMexRmsxopd2KekCXB9mSD wZTBEoCRNpTGXL030lEKghnWIg2dIxiaE/nwNxhrVfbvB7aIkv3/QqHLhHy4elKGLMd0 g2Rw== 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 x8si3069130plv.620.2017.11.07.23.53.54; Tue, 07 Nov 2017 23:54:07 -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 S932467AbdKHHXX (ORCPT + 91 others); Wed, 8 Nov 2017 02:23:23 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:39124 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932381AbdKHHXW (ORCPT ); Wed, 8 Nov 2017 02:23:22 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6EC01B7A7816E; Wed, 8 Nov 2017 15:23:08 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Wed, 8 Nov 2017 15:23:01 +0800 From: Lipeng To: CC: , , , , , Subject: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file Date: Wed, 8 Nov 2017 15:52:22 +0800 Message-ID: <1510127543-34158-2-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510127543-34158-1-git-send-email-lipeng321@huawei.com> References: <1510127543-34158-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 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 1583708817137942320@xxx Fri Nov 10 19:33:43 +0000 2017 X-GM-THRID: 1583708817137942320 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread