summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2017-09-19 11:21:41 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-12-12 07:32:41 (GMT)
commit7cc6c448560470e33f93f27261e354746220ec88 (patch)
tree403f2000e1be57685722be349b2b22a11619d74c
parent0f10e8de08e3a60fd9ecee149dfd6aecc6e973bc (diff)
downloadlinux-7cc6c448560470e33f93f27261e354746220ec88.tar.xz
staging: fsl-dpaa2/eth: Fix NAPI initialization
Make sure the NAPI instances are enabled only after all other device initialization is done, to avoid accessing uninit vars. Mirror that change on device remove routine. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
-rw-r--r--drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index 9d759c8..1b1a720 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -3336,10 +3336,6 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
if (err)
goto err_bind;
- /* Add a NAPI context for each channel */
- add_ch_napi(priv);
- enable_ch_napi(priv);
-
/* Percpu statistics */
priv->percpu_stats = alloc_percpu(*priv->percpu_stats);
if (!priv->percpu_stats) {
@@ -3387,6 +3383,10 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
priv->dcbx_mode = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
#endif
+ /* Add a NAPI context for each channel */
+ add_ch_napi(priv);
+ enable_ch_napi(priv);
+
err = setup_irqs(dpni_dev);
if (err) {
netdev_warn(net_dev, "Failed to set link interrupt, fall back to polling\n");
@@ -3449,6 +3449,9 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev)
#endif
dpaa2_eth_sysfs_remove(&net_dev->dev);
+ disable_ch_napi(priv);
+ del_ch_napi(priv);
+
unregister_netdev(net_dev);
dev_info(net_dev->dev.parent, "Removed interface %s\n", net_dev->name);
@@ -3460,9 +3463,6 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev)
free_rings(priv);
free_percpu(priv->percpu_stats);
free_percpu(priv->percpu_extras);
-
- disable_ch_napi(priv);
- del_ch_napi(priv);
free_dpbp(priv);
free_dpio(priv);
free_dpni(priv);