Commit 807eaf99 authored by Sven Auhagen's avatar Sven Auhagen Committed by David S. Miller

mvpp2: remove module bugfix

The remove function does not destroy all
BM Pools when per cpu pool is active.

When reloading the mvpp2 as a module the BM Pools
are still active in hardware and due to the bug
have twice the size now old + new.

This eventually leads to a kernel crash.

v2:
* add Fixes tag

Fixes: 7d04b0b1 ("mvpp2: percpu buffers")
Signed-off-by: default avatarSven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 66205121
...@@ -5983,8 +5983,8 @@ static int mvpp2_remove(struct platform_device *pdev) ...@@ -5983,8 +5983,8 @@ static int mvpp2_remove(struct platform_device *pdev)
{ {
struct mvpp2 *priv = platform_get_drvdata(pdev); struct mvpp2 *priv = platform_get_drvdata(pdev);
struct fwnode_handle *fwnode = pdev->dev.fwnode; struct fwnode_handle *fwnode = pdev->dev.fwnode;
int i = 0, poolnum = MVPP2_BM_POOLS_NUM;
struct fwnode_handle *port_fwnode; struct fwnode_handle *port_fwnode;
int i = 0;
mvpp2_dbgfs_cleanup(priv); mvpp2_dbgfs_cleanup(priv);
...@@ -5998,7 +5998,10 @@ static int mvpp2_remove(struct platform_device *pdev) ...@@ -5998,7 +5998,10 @@ static int mvpp2_remove(struct platform_device *pdev)
destroy_workqueue(priv->stats_queue); destroy_workqueue(priv->stats_queue);
for (i = 0; i < MVPP2_BM_POOLS_NUM; i++) { if (priv->percpu_pools)
poolnum = mvpp2_get_nrxqs(priv) * 2;
for (i = 0; i < poolnum; i++) {
struct mvpp2_bm_pool *bm_pool = &priv->bm_pools[i]; struct mvpp2_bm_pool *bm_pool = &priv->bm_pools[i];
mvpp2_bm_pool_destroy(&pdev->dev, priv, bm_pool); mvpp2_bm_pool_destroy(&pdev->dev, priv, bm_pool);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment