drivers: net: xgene: Fix redundant prefetch buffer cleanup
authorIyappan Subramanian <isubramanian@apm.com>
Wed, 10 May 2017 20:45:10 +0000 (13:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 May 2017 15:41:11 +0000 (11:41 -0400)
Prefetch buffer cleanup code was called twice, causing EDAC to
report errors during reboot.

[ 1130.972475] xgene-edac 78800000.edac: IOB bridge agent (BA) transaction
error
[ 1130.979584] xgene-edac 78800000.edac: IOB BA write response error
[ 1130.985648] xgene-edac 78800000.edac: IOB BA write access at 0x00.00000000
()
[ 1130.993612] xgene-edac 78800000.edac: IOB BA requestor ID 0x00002400
[ 1131.000242] xgene-edac 78800000.edac: IOB bridge agent (BA) transaction
error
...

This patch fixes the errors by,

- removing the redundant prefetch buffer cleanup from port_ops->shutdown()
- moving port_ops->shutdown() after delete_rings()

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
drivers/net/ethernet/apm/xgene/xgene_enet_main.c
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c

index 3235d0cf39428aecaf9b9d98a60a6174e4c185d7..6ac27c7522a74927855ba7c8ae1a2ee40247809e 100644 (file)
@@ -763,27 +763,6 @@ static void xgene_enet_clear(struct xgene_enet_pdata *pdata,
 static void xgene_gport_shutdown(struct xgene_enet_pdata *pdata)
 {
        struct device *dev = &pdata->pdev->dev;
-       struct xgene_enet_desc_ring *ring;
-       u32 pb;
-       int i;
-
-       pb = 0;
-       for (i = 0; i < pdata->rxq_cnt; i++) {
-               ring = pdata->rx_ring[i]->buf_pool;
-               pb |= BIT(xgene_enet_get_fpsel(ring->id));
-               ring = pdata->rx_ring[i]->page_pool;
-               if (ring)
-                       pb |= BIT(xgene_enet_get_fpsel(ring->id));
-
-       }
-       xgene_enet_wr_ring_if(pdata, ENET_CFGSSQMIFPRESET_ADDR, pb);
-
-       pb = 0;
-       for (i = 0; i < pdata->txq_cnt; i++) {
-               ring = pdata->tx_ring[i];
-               pb |= BIT(xgene_enet_ring_bufnum(ring->id));
-       }
-       xgene_enet_wr_ring_if(pdata, ENET_CFGSSQMIWQRESET_ADDR, pb);
 
        if (dev->of_node) {
                if (!IS_ERR(pdata->clk))
index 01e389df3aff151e019dcf2ab7ce9645dae6868e..21cd4ef3e5eb590d2fe1d5846428be543d03ec53 100644 (file)
@@ -2159,8 +2159,8 @@ static int xgene_enet_remove(struct platform_device *pdev)
                xgene_enet_mdio_remove(pdata);
 
        unregister_netdev(ndev);
-       pdata->port_ops->shutdown(pdata);
        xgene_enet_delete_desc_rings(pdata);
+       pdata->port_ops->shutdown(pdata);
        free_netdev(ndev);
 
        return 0;
index 31df8f32c214177e8a6708bfeb6a5e9511bdab6f..b1a83fdbefb8cbd2c47b62b807ca03c3df274f70 100644 (file)
@@ -534,26 +534,6 @@ static void xgene_enet_clear(struct xgene_enet_pdata *pdata,
 static void xgene_enet_shutdown(struct xgene_enet_pdata *p)
 {
        struct device *dev = &p->pdev->dev;
-       struct xgene_enet_desc_ring *ring;
-       u32 pb;
-       int i;
-
-       pb = 0;
-       for (i = 0; i < p->rxq_cnt; i++) {
-               ring = p->rx_ring[i]->buf_pool;
-               pb |= BIT(xgene_enet_get_fpsel(ring->id));
-               ring = p->rx_ring[i]->page_pool;
-               if (ring)
-                       pb |= BIT(xgene_enet_get_fpsel(ring->id));
-       }
-       xgene_enet_wr_ring_if(p, ENET_CFGSSQMIFPRESET_ADDR, pb);
-
-       pb = 0;
-       for (i = 0; i < p->txq_cnt; i++) {
-               ring = p->tx_ring[i];
-               pb |= BIT(xgene_enet_ring_bufnum(ring->id));
-       }
-       xgene_enet_wr_ring_if(p, ENET_CFGSSQMIWQRESET_ADDR, pb);
 
        if (dev->of_node) {
                if (!IS_ERR(p->clk))
index eab6f1c12f1cedcd192b2d72d187bc9668c9f567..b7d75d067c7af3252adb45e6762afefdba9b00ab 100644 (file)
@@ -446,26 +446,6 @@ static void xgene_enet_xgcle_bypass(struct xgene_enet_pdata *pdata,
 static void xgene_enet_shutdown(struct xgene_enet_pdata *pdata)
 {
        struct device *dev = &pdata->pdev->dev;
-       struct xgene_enet_desc_ring *ring;
-       u32 pb;
-       int i;
-
-       pb = 0;
-       for (i = 0; i < pdata->rxq_cnt; i++) {
-               ring = pdata->rx_ring[i]->buf_pool;
-               pb |= BIT(xgene_enet_get_fpsel(ring->id));
-               ring = pdata->rx_ring[i]->page_pool;
-               if (ring)
-                       pb |= BIT(xgene_enet_get_fpsel(ring->id));
-       }
-       xgene_enet_wr_ring_if(pdata, ENET_CFGSSQMIFPRESET_ADDR, pb);
-
-       pb = 0;
-       for (i = 0; i < pdata->txq_cnt; i++) {
-               ring = pdata->tx_ring[i];
-               pb |= BIT(xgene_enet_ring_bufnum(ring->id));
-       }
-       xgene_enet_wr_ring_if(pdata, ENET_CFGSSQMIWQRESET_ADDR, pb);
 
        if (dev->of_node) {
                if (!IS_ERR(pdata->clk))