All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver
@ 2017-11-08  7:52 Lipeng
  2017-11-08  7:52 ` [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file Lipeng
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Lipeng @ 2017-11-08  7:52 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] 8+ messages in thread

* [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file
  2017-11-08  7:52 [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver Lipeng
@ 2017-11-08  7:52 ` Lipeng
  2017-11-08 14:30   ` Andrew Lunn
  2017-11-08  7:52 ` [PATCH net-next 2/2] net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex Lipeng
  2017-11-11  6:20 ` [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver David Miller
  2 siblings, 1 reply; 8+ messages in thread
From: Lipeng @ 2017-11-08  7:52 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] 8+ messages in thread

* [PATCH net-next 2/2] net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex
  2017-11-08  7:52 [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver Lipeng
  2017-11-08  7:52 ` [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file Lipeng
@ 2017-11-08  7:52 ` Lipeng
  2017-11-11  6:20 ` [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Lipeng @ 2017-11-08  7:52 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] 8+ messages in thread

* Re: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file
  2017-11-08  7:52 ` [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file Lipeng
@ 2017-11-08 14:30   ` Andrew Lunn
  2017-11-08 14:40     ` Salil Mehta
  2017-11-09  2:02     ` lipeng (Y)
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Lunn @ 2017-11-08 14:30 UTC (permalink / raw)
  To: Lipeng; +Cc: davem, netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta

On Wed, Nov 08, 2017 at 03:52:22PM +0800, Lipeng wrote:
> 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.

Hi Lipeng

Any plans for C45? The PHY address is still 5 bits, but do you need to
get the device type from your configuration file?

    Andrew

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

* RE: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file
  2017-11-08 14:30   ` Andrew Lunn
@ 2017-11-08 14:40     ` Salil Mehta
  2017-11-09  2:02     ` lipeng (Y)
  1 sibling, 0 replies; 8+ messages in thread
From: Salil Mehta @ 2017-11-08 14:40 UTC (permalink / raw)
  To: Andrew Lunn, lipeng (Y)
  Cc: davem, netdev, linux-kernel, Linuxarm, Zhuangyuzeng (Yisen)

Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Wednesday, November 08, 2017 2:31 PM
> To: lipeng (Y)
> Cc: davem@davemloft.net; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; Linuxarm; Zhuangyuzeng (Yisen); Salil Mehta
> Subject: Re: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy
> address from NCL_config file
> 
> On Wed, Nov 08, 2017 at 03:52:22PM +0800, Lipeng wrote:
> > 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.
> 
> Hi Lipeng
> 
> Any plans for C45? 
Still remember the kernel change required to support C45 discussed with
you some time back :). Will try to push that change as soon as possible.
And yes, we would be pushing the support of the C45 for HNS3 driver as
well after that.

Thanks
Salil

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

* Re: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file
  2017-11-08 14:30   ` Andrew Lunn
  2017-11-08 14:40     ` Salil Mehta
@ 2017-11-09  2:02     ` lipeng (Y)
  2017-11-09  3:28       ` Andrew Lunn
  1 sibling, 1 reply; 8+ messages in thread
From: lipeng (Y) @ 2017-11-09  2:02 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: davem, netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta



On 2017/11/8 22:30, Andrew Lunn wrote:
> On Wed, Nov 08, 2017 at 03:52:22PM +0800, Lipeng wrote:
>> 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.
> Hi Lipeng
>
> Any plans for C45? The PHY address is still 5 bits, but do you need to
> get the device type from your configuration file?
>
>      Andrew
Hi Andrew

  C45 support is in Plan,   now only support C22.
  This bugfix patch is valid for C22 and C45.

  As plan , will get the device type(NULL, C22, C45) from configuration 
file after support C45.
  Do you think we must do it now? or can add it along with C45 support?

     Lipeng
> .
>

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

* Re: [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file
  2017-11-09  2:02     ` lipeng (Y)
@ 2017-11-09  3:28       ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2017-11-09  3:28 UTC (permalink / raw)
  To: lipeng (Y)
  Cc: davem, netdev, linux-kernel, linuxarm, yisen.zhuang, salil.mehta

On Thu, Nov 09, 2017 at 10:02:37AM +0800, lipeng (Y) wrote:
> 
> 
> On 2017/11/8 22:30, Andrew Lunn wrote:
> >On Wed, Nov 08, 2017 at 03:52:22PM +0800, Lipeng wrote:
> >>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.
> >Hi Lipeng
> >
> >Any plans for C45? The PHY address is still 5 bits, but do you need to
> >get the device type from your configuration file?
> >
> >     Andrew
> Hi Andrew
> 
>  C45 support is in Plan,   now only support C22.
>  This bugfix patch is valid for C22 and C45.

Great. That is all i wanted to know.

       Thanks

	  Andrew

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

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

From: Lipeng <lipeng321@huawei.com>
Date: Wed, 8 Nov 2017 15:52:21 +0800

> 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.

Series applied.

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

end of thread, other threads:[~2017-11-11  6:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08  7:52 [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver Lipeng
2017-11-08  7:52 ` [PATCH net-next 1/2] net: hns3: fix a bug when getting phy address from NCL_config file Lipeng
2017-11-08 14:30   ` Andrew Lunn
2017-11-08 14:40     ` Salil Mehta
2017-11-09  2:02     ` lipeng (Y)
2017-11-09  3:28       ` Andrew Lunn
2017-11-08  7:52 ` [PATCH net-next 2/2] net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex Lipeng
2017-11-11  6:20 ` [PATCH net-next 0/2] net: hns3: Bug fixes & Code improvements in HNS3 driver David Miller

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.