2022-12-28 09:11:26

by Xiao, Jiguang

[permalink] [raw]
Subject: [PATCH] net: amd-xgbe: add missed tasklet_kill

From: Jiguang Xiao <[email protected]>

The driver does not call tasklet_kill in several places.
Add the calls to fix it.

Fixes: 85b85c853401 (amd-xgbe: Re-issue interrupt if interrupt status
not cleared)
Signed-off-by: Jiguang Xiao <[email protected]>
---
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +++
drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 4 +++-
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 4 +++-
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 7b666106feee..614c0278419b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -1064,6 +1064,9 @@ static void xgbe_free_irqs(struct xgbe_prv_data *pdata)

devm_free_irq(pdata->dev, pdata->dev_irq, pdata);

+ tasklet_kill(&pdata->tasklet_dev);
+ tasklet_kill(&pdata->tasklet_ecc);
+
if (pdata->vdata->ecc_support && (pdata->dev_irq != pdata->ecc_irq))
devm_free_irq(pdata->dev, pdata->ecc_irq, pdata);

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c b/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
index 22d4fc547a0a..a9ccc4258ee5 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
@@ -447,8 +447,10 @@ static void xgbe_i2c_stop(struct xgbe_prv_data *pdata)
xgbe_i2c_disable(pdata);
xgbe_i2c_clear_all_interrupts(pdata);

- if (pdata->dev_irq != pdata->i2c_irq)
+ if (pdata->dev_irq != pdata->i2c_irq) {
devm_free_irq(pdata->dev, pdata->i2c_irq, pdata);
+ tasklet_kill(&pdata->tasklet_i2c);
+ }
}

static int xgbe_i2c_start(struct xgbe_prv_data *pdata)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
index 4e97b4869522..0c5c1b155683 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
@@ -1390,8 +1390,10 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata)
/* Disable auto-negotiation */
xgbe_an_disable_all(pdata);

- if (pdata->dev_irq != pdata->an_irq)
+ if (pdata->dev_irq != pdata->an_irq) {
devm_free_irq(pdata->dev, pdata->an_irq, pdata);
+ tasklet_kill(&pdata->tasklet_an);
+ }

pdata->phy_if.phy_impl.stop(pdata);

--
2.37.3


2022-12-30 07:52:43

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: amd-xgbe: add missed tasklet_kill

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

On Wed, 28 Dec 2022 16:14:47 +0800 you wrote:
> From: Jiguang Xiao <[email protected]>
>
> The driver does not call tasklet_kill in several places.
> Add the calls to fix it.
>
> Fixes: 85b85c853401 (amd-xgbe: Re-issue interrupt if interrupt status
> not cleared)
> Signed-off-by: Jiguang Xiao <[email protected]>
>
> [...]

Here is the summary with links:
- net: amd-xgbe: add missed tasklet_kill
https://git.kernel.org/netdev/net/c/d530ece70f16

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html


2023-01-03 17:47:56

by Tom Lendacky

[permalink] [raw]
Subject: Re: [PATCH] net: amd-xgbe: add missed tasklet_kill

On 12/28/22 02:14, [email protected] wrote:
> From: Jiguang Xiao <[email protected]>
>
> The driver does not call tasklet_kill in several places.
> Add the calls to fix it.
>
> Fixes: 85b85c853401 (amd-xgbe: Re-issue interrupt if interrupt status
> not cleared)
> Signed-off-by: Jiguang Xiao <[email protected]>
> ---
> drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +++
> drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 4 +++-
> drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 4 +++-
> 3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> index 7b666106feee..614c0278419b 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> @@ -1064,6 +1064,9 @@ static void xgbe_free_irqs(struct xgbe_prv_data *pdata)
>
> devm_free_irq(pdata->dev, pdata->dev_irq, pdata);
>
> + tasklet_kill(&pdata->tasklet_dev);
> + tasklet_kill(&pdata->tasklet_ecc);

Should this tasklet_kill() have been put after the devm_free_irq() for the
ecc_irq?

Maybe both tasklet_kill() calls could have been moved down a few lines.

Thanks,
Tom

> +
> if (pdata->vdata->ecc_support && (pdata->dev_irq != pdata->ecc_irq))
> devm_free_irq(pdata->dev, pdata->ecc_irq, pdata);
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c b/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
> index 22d4fc547a0a..a9ccc4258ee5 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-i2c.c
> @@ -447,8 +447,10 @@ static void xgbe_i2c_stop(struct xgbe_prv_data *pdata)
> xgbe_i2c_disable(pdata);
> xgbe_i2c_clear_all_interrupts(pdata);
>
> - if (pdata->dev_irq != pdata->i2c_irq)
> + if (pdata->dev_irq != pdata->i2c_irq) {
> devm_free_irq(pdata->dev, pdata->i2c_irq, pdata);
> + tasklet_kill(&pdata->tasklet_i2c);
> + }
> }
>
> static int xgbe_i2c_start(struct xgbe_prv_data *pdata)
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> index 4e97b4869522..0c5c1b155683 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> @@ -1390,8 +1390,10 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata)
> /* Disable auto-negotiation */
> xgbe_an_disable_all(pdata);
>
> - if (pdata->dev_irq != pdata->an_irq)
> + if (pdata->dev_irq != pdata->an_irq) {
> devm_free_irq(pdata->dev, pdata->an_irq, pdata);
> + tasklet_kill(&pdata->tasklet_an);
> + }
>
> pdata->phy_if.phy_impl.stop(pdata);
>