This patch-set introduces some bug fixes and code improvements.
As [patch 1/2] depends on the patch {5392902 net: hns3: Consistently using
GENMASK in hns3 driver}, which exists in net-next, not exists in net, so
push this serise to nex-next.
Fuyun Liang (2):
{topost} net: hns3: fix a bug when getting phy address from NCL_config
file
{topost} net: hns3: cleanup mac auto-negotiation state query in
hclge_update_speed_duplex
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 +------------
2 files changed, 2 insertions(+), 13 deletions(-)
--
1.9.1
From: Fuyun Liang <redacted>
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 <redacted>
Signed-off-by: Lipeng <redacted>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Fuyun Liang <redacted>
When checking whether auto-negotiation is on, driver only needs to
check the value of mac.autoneg(SW) directly, and does not need to
query it from hardware. Because this value is always synchronized
with the auto-negotiation state of hardware.
This patch removes mac auto-negotiation state query in
hclge_update_speed_duplex().
Fixes: 46a3df9f9718 (net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support)
Signed-off-by: Fuyun Liang <redacted>
Signed-off-by: Lipeng <redacted>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
@@ -2325,18 +2325,7 @@ static int hclge_update_speed_duplex(struct hclge_dev *hdev)/* get the speed and duplex as autoneg'result from mac cmd when phy*doesn'texit.*/-if(mac.phydev)-return0;--/* update mac->antoneg. */-ret=hclge_query_autoneg_result(hdev);-if(ret){-dev_err(&hdev->pdev->dev,-"autoneg result query failed %d\n",ret);-returnret;-}--if(!mac.autoneg)+if(mac.phydev||!mac.autoneg)return0;ret=hclge_query_mac_an_speed_dup(hdev,&speed,&duplex);
please ignore this patch-set.
I should remove "{topost}" from the subject.
sorry for that, I will resend the patch-set.
On 2017/11/8 15:31, Lipeng wrote:
This patch-set introduces some bug fixes and code improvements.
As [patch 1/2] depends on the patch {5392902 net: hns3: Consistently using
GENMASK in hns3 driver}, which exists in net-next, not exists in net, so
push this serise to nex-next.
Fuyun Liang (2):
{topost} net: hns3: fix a bug when getting phy address from NCL_config
file
{topost} net: hns3: cleanup mac auto-negotiation state query in
hclge_update_speed_duplex
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 +------------
2 files changed, 2 insertions(+), 13 deletions(-)