[PATCH V2 net 0/4] net: hns: bugs fix about hns driver

STALE3835d

Revision v2 of 2 in this series.

8 messages, 3 authors, 2016-03-15 · open the first message on its own page

[PATCH V2 net 0/4] net: hns: bugs fix about hns driver

From: Lisheng <hidden>
Date: 2016-03-11 10:10:25

From: Qianqian Xie <redacted>

There is some inappropriate application of values in hns driver,
such as cycle index, returned value, format string, useless citation.
This patch set will solve it.

---
change log:
PATCH v2:
 - This patchset fixes the comments provided by Andy Shevchenko <Andy Shevchenko>

PATCH v1:
 - first submit

Qianqian Xie (4):
  net: hns: fix a bug for cycle index
  net: hns: bug fix for format string
  net: hns: bug fix for return values
  net: hns: remove useless head=ring->next_to_clean

 drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c |  3 ++-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 12 ++++++------
 drivers/net/ethernet/hisilicon/hns/hns_enet.c      |  5 +----
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c   |  4 ++--
 4 files changed, 11 insertions(+), 13 deletions(-)

-- 
1.9.1

[PATCH V2 net 3/4] net: hns: bug fix for return values

From: Lisheng <hidden>
Date: 2016-03-11 10:10:26

From: Qianqian Xie <redacted>

The return values in the first two functions mdiobus_write()
are ignored. The patch will fix it.

Signed-off-by: Qianqian Xie <redacted>
---
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index 3df2284..cc5c545 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -1000,8 +1000,8 @@ int hns_phy_led_set(struct net_device *netdev, int value)
 	struct phy_device *phy_dev = priv->phy;
 
 	retval = phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_LED);
-	retval = phy_write(phy_dev, HNS_LED_FC_REG, value);
-	retval = phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_COPPER);
+	retval |= phy_write(phy_dev, HNS_LED_FC_REG, value);
+	retval |= phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_COPPER);
 	if (retval) {
 		netdev_err(netdev, "mdiobus_write fail !\n");
 		return retval;
-- 
1.9.1

[PATCH V2 net 2/4] net: hns: bug fix for format string

From: Lisheng <hidden>
Date: 2016-03-11 10:10:28

From: Qianqian Xie <redacted>

There is not a format string in function snprinf().
This patch will fix it.

Signed-off-by: Qianqian Xie <redacted>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
index b8517b0..d0591d9 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
@@ -641,7 +641,8 @@ static void hns_gmac_get_strings(u32 stringset, u8 *data)
 		return;
 
 	for (i = 0; i < ARRAY_SIZE(g_gmac_stats_string); i++) {
-		snprintf(buff, ETH_GSTRING_LEN, g_gmac_stats_string[i].desc);
+		snprintf(buff, ETH_GSTRING_LEN, "%s",
+			g_gmac_stats_string[i].desc);
 		buff = buff + ETH_GSTRING_LEN;
 	}
 }
-- 
1.9.1

[PATCH V2 net 1/4] net: hns: fix a bug for cycle index

From: Lisheng <hidden>
Date: 2016-03-11 10:10:28

From: Qianqian Xie <redacted>

The cycle index should be varied while the variable j is a fixed value.
The patch will fix this bug.

Signed-off-by: Qianqian Xie <redacted>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
index 7fe1c1c..ef4f154 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
@@ -2182,17 +2182,17 @@ void hns_dsaf_get_regs(struct dsaf_device *ddev, u32 port, void *data)
 	/* dsaf onode registers */
 	for (i = 0; i < DSAF_XOD_NUM; i++) {
 		p[311 + i] = dsaf_read_dev(ddev,
-				DSAF_XOD_ETS_TSA_TC0_TC3_CFG_0_REG + j * 0x90);
+				DSAF_XOD_ETS_TSA_TC0_TC3_CFG_0_REG + i * 0x90);
 		p[319 + i] = dsaf_read_dev(ddev,
-				DSAF_XOD_ETS_TSA_TC4_TC7_CFG_0_REG + j * 0x90);
+				DSAF_XOD_ETS_TSA_TC4_TC7_CFG_0_REG + i * 0x90);
 		p[327 + i] = dsaf_read_dev(ddev,
-				DSAF_XOD_ETS_BW_TC0_TC3_CFG_0_REG + j * 0x90);
+				DSAF_XOD_ETS_BW_TC0_TC3_CFG_0_REG + i * 0x90);
 		p[335 + i] = dsaf_read_dev(ddev,
-				DSAF_XOD_ETS_BW_TC4_TC7_CFG_0_REG + j * 0x90);
+				DSAF_XOD_ETS_BW_TC4_TC7_CFG_0_REG + i * 0x90);
 		p[343 + i] = dsaf_read_dev(ddev,
-				DSAF_XOD_ETS_BW_OFFSET_CFG_0_REG + j * 0x90);
+				DSAF_XOD_ETS_BW_OFFSET_CFG_0_REG + i * 0x90);
 		p[351 + i] = dsaf_read_dev(ddev,
-				DSAF_XOD_ETS_TOKEN_CFG_0_REG + j * 0x90);
+				DSAF_XOD_ETS_TOKEN_CFG_0_REG + i * 0x90);
 	}
 
 	p[359] = dsaf_read_dev(ddev, DSAF_XOD_PFS_CFG_0_0_REG + port * 0x90);
-- 
1.9.1

[PATCH V2 net 4/4] net: hns: remove useless head=ring->next_to_clean

From: Lisheng <hidden>
Date: 2016-03-11 10:10:28

From: Qianqian Xie <redacted>

The variable head in hns_nic_tx_fini_pro has read a value,
but the value is not used. The patch will solve it.
The bug-fixed comment is for the function pointer
ring_data->fini_process,that is called in function
hns_nic_common_poll.The comment should not be there, so remove it.

Signed-off-by: Qianqian Xie <redacted>
---
change log:
PATCH v2:
 - This patchset fixes the comments provided by Andy Shevchenko <Andy Shevchenko>

PATCH v1:
 - first submit
---
 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 3f77ff7..5456531 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -901,10 +901,7 @@ static int hns_nic_tx_poll_one(struct hns_nic_ring_data *ring_data,
 static void hns_nic_tx_fini_pro(struct hns_nic_ring_data *ring_data)
 {
 	struct hnae_ring *ring = ring_data->ring;
-	int head = ring->next_to_clean;
-
-	/* for hardware bug fixed */
-	head = readl_relaxed(ring->io_base + RCB_REG_HEAD);
+	int head = readl_relaxed(ring->io_base + RCB_REG_HEAD);
 
 	if (head != ring->next_to_clean) {
 		ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
-- 
1.9.1

Re: [PATCH V2 net 0/4] net: hns: bugs fix about hns driver

From: David Miller <davem@davemloft.net>
Date: 2016-03-11 16:56:42

This does not work.

I will not allow two sets of people sending me patches in parallel to the
same driver at the same time.

Have one person manage the maintainence of this driver and consolidate the
patch submissions to me.

Thanks.

Re: [PATCH V2 net 0/4] net: hns: bugs fix about hns driver

From: Lisheng011 <hidden>
Date: 2016-03-14 06:26:11


We will appoint Daode Huang [off-list ref] to send these patchs.

Thanks.


在 2016/3/12 0:56, David Miller 写道:
This does not work.

I will not allow two sets of people sending me patches in parallel to the
same driver at the same time.

Have one person manage the maintainence of this driver and consolidate the
patch submissions to me.

Thanks.

.

Re: [PATCH V2 net 0/4] net: hns: bugs fix about hns driver

From: Yankejian (Hackim Yim) <hidden>
Date: 2016-03-15 03:14:26

On 2016/3/12 0:56, David Miller wrote:
This does not work.

I will not allow two sets of people sending me patches in parallel to the
same driver at the same time.

Have one person manage the maintainence of this driver and consolidate the
patch submissions to me.

Thanks.

.
Hi David,
 
Thanks for your reply. we will upstream the patches one by one. And we will ask Daode Huang to help us
to upsream.

MBR, Kejian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help