All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver
  2017-11-08  7:31 [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver Lipeng
@ 2017-11-08  7:17 ` lipeng (Y)
  2017-11-08  7:31 ` [PATCH net-next 1/2] {topost} net: hns3: fix a bug when getting phy address from NCL_config file Lipeng
  2017-11-08  7:31 ` [PATCH net-next 2/2] {topost} net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex Lipeng
  2 siblings, 0 replies; 4+ messages in thread
From: lipeng (Y) @ 2017-11-08  7:17 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta

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(-)
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver
@ 2017-11-08  7:31 Lipeng
  2017-11-08  7:17 ` lipeng (Y)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lipeng @ 2017-11-08  7:31 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta, lipeng321

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] {topost} net: hns3: fix a bug when getting phy address from NCL_config file
  2017-11-08  7:31 [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver Lipeng
  2017-11-08  7:17 ` lipeng (Y)
@ 2017-11-08  7:31 ` Lipeng
  2017-11-08  7:31 ` [PATCH net-next 2/2] {topost} net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex Lipeng
  2 siblings, 0 replies; 4+ messages in thread
From: Lipeng @ 2017-11-08  7:31 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta, lipeng321

From: Fuyun Liang <liangfuyun1@huawei.com>

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 <liangfuyun1@huawei.com>
Signed-off-by: Lipeng <lipeng321@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] {topost} net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex
  2017-11-08  7:31 [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver Lipeng
  2017-11-08  7:17 ` lipeng (Y)
  2017-11-08  7:31 ` [PATCH net-next 1/2] {topost} net: hns3: fix a bug when getting phy address from NCL_config file Lipeng
@ 2017-11-08  7:31 ` Lipeng
  2 siblings, 0 replies; 4+ messages in thread
From: Lipeng @ 2017-11-08  7:31 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta, lipeng321

From: Fuyun Liang <liangfuyun1@huawei.com>

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 <liangfuyun1@huawei.com>
Signed-off-by: Lipeng <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index c6ba890..781d5a8 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -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't exit.
 	 */
-	if (mac.phydev)
-		return 0;
-
-	/* update mac->antoneg. */
-	ret = hclge_query_autoneg_result(hdev);
-	if (ret) {
-		dev_err(&hdev->pdev->dev,
-			"autoneg result query failed %d\n", ret);
-		return ret;
-	}
-
-	if (!mac.autoneg)
+	if (mac.phydev || !mac.autoneg)
 		return 0;
 
 	ret = hclge_query_mac_an_speed_dup(hdev, &speed, &duplex);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-08  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08  7:31 [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver Lipeng
2017-11-08  7:17 ` lipeng (Y)
2017-11-08  7:31 ` [PATCH net-next 1/2] {topost} net: hns3: fix a bug when getting phy address from NCL_config file Lipeng
2017-11-08  7:31 ` [PATCH net-next 2/2] {topost} net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex Lipeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.