This series includes typo fixes which review by Andy, adding
the hns maintainer to MAINTAINERS,
> adds the maintainer for hns driver from Daode;
> from Daode: fix the typo of hns reviewed by Andy Shevchenko;
> from Kejian: one remove redundant function and two fix to get
configuration from DT.
Daode Huang (6):
MAINTAINERS: add maintainers for hns driver
net: hns: fix code style about hns driver
net: hns: change code style from a = a + x to a += x
net: hns: delete redundant parens
net: hns: add a space before "*/"
net: hns: normalize two different loop
Kejian Yan (3):
net: hns: remove redundant hns_mac_dev_to_enet_if()
net: hns: add media-type property for hns
net: hns: get reset registers from DT
MAINTAINERS | 9 +++
drivers/net/ethernet/hisilicon/hns/hnae.h | 9 +++
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 1 +
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 41 +++++++----
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h | 1 +
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 52 +++++++-------
drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c | 16 ++---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 4 +-
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 14 +++-
drivers/net/ethernet/hisilicon/hns_mdio.c | 80 ++++++++++++++++++----
10 files changed, 158 insertions(+), 69 deletions(-)
--
1.9.1
From: Daode Huang <redacted>
According to the previous review comments from Andy, this patch
deletes the redundant parens in the patch.
Signed-off-by: Daode Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Daode Huang <redacted>
In comment line, some time miss a space before */, so this
patch adds a space before */.
Signed-off-by: Daode Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -762,13 +762,13 @@ static int hns_nic_rx_poll_one(struct hns_nic_ring_data *ring_data,recv_pkts=0,recv_bds=0,clean_count=0;recv:while(recv_pkts<budget&&recv_bds<num){-/* reuse or realloc buffers*/+/* reuse or realloc buffers */if(clean_count>=RCB_NOF_ALLOC_RX_BUFF_ONCE){hns_nic_alloc_rx_buffers(ring_data,clean_count);clean_count=0;}-/* poll one pkt*/+/* poll one pkt */err=hns_nic_poll_rx_skb(ring_data,&skb,&bnum);if(unlikely(!skb))/* this fault cannot be repaired */gotoout;
From: Daode Huang <redacted>
There are two approaches to assign data, one does 2 loops, another
does 1 loop. This patch normalize the different methods to 1 loop.
Signed-off-by: Daode Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
From: Kejian Yan <redacted>
It is PORT_TP type if the service port is GE mode. It is wrong to
judge the port type by using if it is service port. Adding the media
type to know port type.
Reported-by: Jinchuan Tian <redacted>
Signed-off-by: Kejian Yan <redacted>
---
drivers/net/ethernet/hisilicon/hns/hnae.h | 9 ++++++++
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 1 +
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 26 +++++++++++++++++++++++
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.h | 1 +
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 14 +++++++++---
5 files changed, 48 insertions(+), 3 deletions(-)
@@ -363,6 +363,14 @@ enum hnae_port_type {HNAE_PORT_DEBUG};+/* mac media type */+enumhnae_media_type{+HNAE_MEDIA_TYPE_UNKNOWN=0,+HNAE_MEDIA_TYPE_FIBER,+HNAE_MEDIA_TYPE_COPPER,+HNAE_MEDIA_TYPE_BACKPLANE,+};+/* This struct defines the operation on the handle.**get_handle():(mandatory)
@@ -525,6 +533,7 @@ struct hnae_handle {u32eport_id;u32dport_id;/* v2 tx bd should fill the dport_id */enumhnae_port_typeport_type;+enumhnae_media_typemedia_type;structlist_headnode;/* list to hnae_ae_dev->handle_list */structhnae_buf_ops*bops;/* operation for the buffer */structhnae_queue**qs;/* array base of all queues */
@@ -253,10 +253,9 @@ static void hns_dsaf_ge_srst_by_port(struct dsaf_device *dsaf_dev, u32 port,reg_val_1=0x1<<port;port_rst_off=dsaf_dev->mac_cb[port]->port_rst_off;/* there is difference between V1 and V2 in register.*/-if(AE_IS_VER1(dsaf_dev->dsaf_ver))-reg_val_2=0x1041041<<port_rst_off;-else-reg_val_2=0x2082082<<port_rst_off;+reg_val_2=AE_IS_VER1(dsaf_dev->dsaf_ver)?+0x1041041:0x2082082;+reg_val_2<<=port_rst_off;if(!dereset){dsaf_write_sub(dsaf_dev,DSAF_SUB_SC_GE_RESET_REQ1_REG,
From: Kejian Yan <redacted>
Since the registers of subctrl may be different, it is better to
mv the registers from hns mdio driver routine to device tree node.
Signed-off-by: Kejian Yan <redacted>
---
drivers/net/ethernet/hisilicon/hns_mdio.c | 80 +++++++++++++++++++++++++------
1 file changed, 66 insertions(+), 14 deletions(-)
@@ -353,6 +362,7 @@ static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum)staticinthns_mdio_reset(structmii_bus*bus){structhns_mdio_device*mdio_dev=(structhns_mdio_device*)bus->priv;+conststructhns_mdio_sc_reg*sc_reg;intret;if(dev_of_node(bus->parent)){
@@ -361,9 +371,10 @@ static int hns_mdio_reset(struct mii_bus *bus)return-ENODEV;}+sc_reg=&mdio_dev->sc_reg;/* 1. reset req, and read reset st check */-ret=mdio_sc_cfg_reg_write(mdio_dev,MDIO_SC_RESET_REQ,0x1,-MDIO_SC_RESET_ST,0x1,+ret=mdio_sc_cfg_reg_write(mdio_dev,sc_reg->mdio_reset_req,0x1,+sc_reg->mdio_reset_st,0x1,MDIO_CHECK_SET_ST);if(ret){dev_err(&bus->dev,"MDIO reset fail\n");
@@ -371,8 +382,8 @@ static int hns_mdio_reset(struct mii_bus *bus)}/* 2. dis clk, and read clk st check */-ret=mdio_sc_cfg_reg_write(mdio_dev,MDIO_SC_CLK_DIS,-0x1,MDIO_SC_CLK_ST,0x1,+ret=mdio_sc_cfg_reg_write(mdio_dev,sc_reg->mdio_clk_dis,+0x1,sc_reg->mdio_clk_st,0x1,MDIO_CHECK_CLR_ST);if(ret){dev_err(&bus->dev,"MDIO dis clk fail\n");
@@ -380,8 +391,8 @@ static int hns_mdio_reset(struct mii_bus *bus)}/* 3. reset dreq, and read reset st check */-ret=mdio_sc_cfg_reg_write(mdio_dev,MDIO_SC_RESET_DREQ,0x1,-MDIO_SC_RESET_ST,0x1,+ret=mdio_sc_cfg_reg_write(mdio_dev,sc_reg->mdio_reset_dreq,0x1,+sc_reg->mdio_reset_st,0x1,MDIO_CHECK_CLR_ST);if(ret){dev_err(&bus->dev,"MDIO dis clk fail\n");
@@ -389,8 +400,8 @@ static int hns_mdio_reset(struct mii_bus *bus)}/* 4. en clk, and read clk st check */-ret=mdio_sc_cfg_reg_write(mdio_dev,MDIO_SC_CLK_EN,-0x1,MDIO_SC_CLK_ST,0x1,+ret=mdio_sc_cfg_reg_write(mdio_dev,sc_reg->mdio_clk_en,+0x1,sc_reg->mdio_clk_st,0x1,MDIO_CHECK_SET_ST);if(ret)dev_err(&bus->dev,"MDIO en clk fail\n");
@@ -458,13 +469,54 @@ static int hns_mdio_probe(struct platform_device *pdev)snprintf(new_bus->id,MII_BUS_ID_SIZE,"%s-%s","Mii",dev_name(&pdev->dev));if(dev_of_node(&pdev->dev)){-mdio_dev->subctrl_vbase=syscon_node_to_regmap(-of_parse_phandle(pdev->dev.of_node,-"subctrl-vbase",0));-if(IS_ERR(mdio_dev->subctrl_vbase)){-dev_warn(&pdev->dev,"no syscon hisilicon,peri-c-subctrl\n");+structof_phandle_argsreg_args;++ret=of_parse_phandle_with_fixed_args(pdev->dev.of_node,+"subctrl-vbase",+4,+0,+®_args);+if(!ret){+mdio_dev->subctrl_vbase=+syscon_node_to_regmap(reg_args.np);+if(IS_ERR(mdio_dev->subctrl_vbase)){+dev_warn(&pdev->dev,"syscon_node_to_regmap error\n");+mdio_dev->subctrl_vbase=NULL;+}else{+if(reg_args.args_count==4){+mdio_dev->sc_reg.mdio_clk_en=+(u16)reg_args.args[0];+mdio_dev->sc_reg.mdio_clk_dis=+(u16)reg_args.args[0]+4;+mdio_dev->sc_reg.mdio_reset_req=+(u16)reg_args.args[1];+mdio_dev->sc_reg.mdio_reset_dreq=+(u16)reg_args.args[1]+4;+mdio_dev->sc_reg.mdio_clk_st=+(u16)reg_args.args[2];+mdio_dev->sc_reg.mdio_reset_st=+(u16)reg_args.args[3];+}else{+/* for compatible */+mdio_dev->sc_reg.mdio_clk_en=+MDIO_SC_CLK_EN;+mdio_dev->sc_reg.mdio_clk_dis=+MDIO_SC_CLK_DIS;+mdio_dev->sc_reg.mdio_reset_req=+MDIO_SC_RESET_REQ;+mdio_dev->sc_reg.mdio_reset_dreq=+MDIO_SC_RESET_DREQ;+mdio_dev->sc_reg.mdio_clk_st=+MDIO_SC_CLK_ST;+mdio_dev->sc_reg.mdio_reset_st=+MDIO_SC_RESET_ST;+}+}+}else{+dev_warn(&pdev->dev,"find syscon ret = %#x\n",ret);mdio_dev->subctrl_vbase=NULL;}+ret=of_mdiobus_register(new_bus,pdev->dev.of_node);}elseif(is_acpi_node(pdev->dev.fwnode)){/* Clear all the IRQ properties */
From: Kejian Yan <redacted>
The sequence of hns_mac_dev_to_enet_if() is the same as
hns_get_enet_interface(), and hns_get_enet_interface() is called
by initialization to get the mac mode. And the mode is not changed
anywhere. Thus add hns_mac_dev_to_enet_if() function to get the mac
mode is obviously redundant.
Reported-by: Jinchuan Tian <redacted>
Signed-off-by: Kejian Yan <redacted>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 15 ---------------
1 file changed, 15 deletions(-)
From: Joe Perches <joe@perches.com> Date: 2016-06-27 11:49:29
On Mon, 2016-06-27 at 17:54 +0800, Yisen Zhuang wrote:
From: Daode Huang <redacted>
There are two approaches to assign data, one does 2 loops, another
does 1 loop. This patch normalize the different methods to 1 loop.
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Date: 2016-06-27 12:00:49
On Mon, 2016-06-27 at 04:49 -0700, Joe Perches wrote:
On Mon, 2016-06-27 at 17:54 +0800, Yisen Zhuang wrote:
quoted
From: Daode Huang <redacted>
There are two approaches to assign data, one does 2 loops, another
does 1 loop. This patch normalize the different methods to 1 loop.
From: Joe Perches <joe@perches.com> Date: 2016-06-27 12:09:08
On Mon, 2016-06-27 at 15:00 +0300, Andy Shevchenko wrote:
On Mon, 2016-06-27 at 04:49 -0700, Joe Perches wrote:
quoted
On Mon, 2016-06-27 at 17:54 +0800, Yisen Zhuang wrote:
quoted
From: Daode Huang <redacted>
There are two approaches to assign data, one does 2 loops, another
does 1 loop. This patch normalize the different methods to 1 loop.
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Date: 2016-06-27 12:13:16
On Mon, 2016-06-27 at 05:08 -0700, Joe Perches wrote:
On Mon, 2016-06-27 at 15:00 +0300, Andy Shevchenko wrote:
quoted
On Mon, 2016-06-27 at 04:49 -0700, Joe Perches wrote:
quoted
On Mon, 2016-06-27 at 17:54 +0800, Yisen Zhuang wrote:
quoted
From: Daode Huang <redacted>
There are two approaches to assign data, one does 2 loops,
another
does 1 loop. This patch normalize the different methods to 1
loop.
On Mon, 2016-06-27 at 05:08 -0700, Joe Perches wrote:
quoted
On Mon, 2016-06-27 at 15:00 +0300, Andy Shevchenko wrote:
quoted
On Mon, 2016-06-27 at 04:49 -0700, Joe Perches wrote:
quoted
On Mon, 2016-06-27 at 17:54 +0800, Yisen Zhuang wrote:
quoted
From: Daode Huang <redacted>
There are two approaches to assign data, one does 2 loops,
another
does 1 loop. This patch normalize the different methods to 1
loop.
Why? the idea is to print stats for Rx and Tx at once.
I hope it was tested.
It changes the order of the strings in buff.
I don't see how.
Hi Andy,
The patch has been tested when sent out.
quoted
Is a bug fix or a style fix?
If it's a bug fix, then it should likely be added
to the stable trees.
I doubt it's a bug fix.
Because the previous patch is accepted in net-next, and this set is
an appendix to the series, in order to avoid merge conflict, we also
send this bug fix to net-next.
thanks.
@@ -361,9 +371,10 @@ static int hns_mdio_reset(struct mii_bus *bus) return -ENODEV; }+ sc_reg = &mdio_dev->sc_reg; /* 1. reset req, and read reset st check */- ret = mdio_sc_cfg_reg_write(mdio_dev, MDIO_SC_RESET_REQ, 0x1,- MDIO_SC_RESET_ST, 0x1,+ ret = mdio_sc_cfg_reg_write(mdio_dev, sc_reg->mdio_reset_req, 0x1,+ sc_reg->mdio_reset_st, 0x1, MDIO_CHECK_SET_ST); if (ret) { dev_err(&bus->dev, "MDIO reset fail\n");
What in the world are you doing to the indentation here?
Please read your patches before actually sending them, such things
will be quite obvious by simple visual inspection.
@@ -361,9 +371,10 @@ static int hns_mdio_reset(struct mii_bus *bus) return -ENODEV; }+ sc_reg = &mdio_dev->sc_reg; /* 1. reset req, and read reset st check */- ret = mdio_sc_cfg_reg_write(mdio_dev, MDIO_SC_RESET_REQ, 0x1,- MDIO_SC_RESET_ST, 0x1,+ ret = mdio_sc_cfg_reg_write(mdio_dev, sc_reg->mdio_reset_req, 0x1,+ sc_reg->mdio_reset_st, 0x1, MDIO_CHECK_SET_ST); if (ret) { dev_err(&bus->dev, "MDIO reset fail\n");
What in the world are you doing to the indentation here?
Please read your patches before actually sending them, such things
will be quite obvious by simple visual inspection.
.
Hi David,
i am sorry for my carelessness. i will pay more attention next time.
Thanks for pointing it our
--
MBR,
Yankejian (Hackim Yim)