2022-12-07 15:07:18

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH v2 0/4] libertas/libertas_tf: don't call kfree_skb() under spin_lock_irqsave()

It is not allowed to call kfree_skb() from hardware interrupt
context or with interrupts being disabled. As the comment of
dev_kfree_skb_irq() says, kfree_skb() can be replaced with
dev_kfree_skb_irq().

v1 -> v2:
Update commit messages.

Yang Yingliang (4):
libertas_tf: don't call kfree_skb() under spin_lock_irqsave()
libertas/if_usb: don't call kfree_skb() under spin_lock_irqsave()
libertas/main: don't call kfree_skb() under spin_lock_irqsave()
libertas/cmdresp: don't call kfree_skb() under spin_lock_irqsave()

drivers/net/wireless/marvell/libertas/cmdresp.c | 2 +-
drivers/net/wireless/marvell/libertas/if_usb.c | 2 +-
drivers/net/wireless/marvell/libertas/main.c | 2 +-
drivers/net/wireless/marvell/libertas_tf/if_usb.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

--
2.25.1


2022-12-07 15:07:26

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH v2 3/4] libertas/main: don't call kfree_skb() under spin_lock_irqsave()

It is not allowed to call kfree_skb() from hardware interrupt
context or with interrupts being disabled. So replace kfree_skb()
with dev_kfree_skb_irq() under spin_lock_irqsave(). Compile
tested only.

Fixes: d2e7b3425c47 ("libertas: disable functionality when interface is down")
Signed-off-by: Yang Yingliang <[email protected]>
---
drivers/net/wireless/marvell/libertas/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/main.c b/drivers/net/wireless/marvell/libertas/main.c
index 8f5220cee112..f42d28d99763 100644
--- a/drivers/net/wireless/marvell/libertas/main.c
+++ b/drivers/net/wireless/marvell/libertas/main.c
@@ -216,7 +216,7 @@ int lbs_stop_iface(struct lbs_private *priv)

spin_lock_irqsave(&priv->driver_lock, flags);
priv->iface_running = false;
- kfree_skb(priv->currenttxskb);
+ dev_kfree_skb_irq(priv->currenttxskb);
priv->currenttxskb = NULL;
priv->tx_pending_len = 0;
spin_unlock_irqrestore(&priv->driver_lock, flags);
--
2.25.1

2022-12-07 15:07:30

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH v2 1/4] libertas_tf: don't call kfree_skb() under spin_lock_irqsave()

It is not allowed to call kfree_skb() from hardware interrupt
context or with interrupts being disabled. So replace kfree_skb()
with dev_kfree_skb_irq() under spin_lock_irqsave(). Compile
tested only.

Fixes: fc75122fabb5 ("libertas_tf: use irqsave() in USB's complete callback")
Signed-off-by: Yang Yingliang <[email protected]>
---
drivers/net/wireless/marvell/libertas_tf/if_usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
index 75b5319d033f..1750f5e93de2 100644
--- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
@@ -613,7 +613,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
spin_lock_irqsave(&priv->driver_lock, flags);
memcpy(priv->cmd_resp_buff, recvbuff + MESSAGE_HEADER_LEN,
recvlength - MESSAGE_HEADER_LEN);
- kfree_skb(skb);
+ dev_kfree_skb_irq(skb);
lbtf_cmd_response_rx(priv);
spin_unlock_irqrestore(&priv->driver_lock, flags);
}
--
2.25.1

2022-12-22 16:26:04

by Kalle Valo

[permalink] [raw]
Subject: Re: [v2,1/4] wifi: libertas_tf: don't call kfree_skb() under spin_lock_irqsave()

Yang Yingliang <[email protected]> wrote:

> It is not allowed to call kfree_skb() from hardware interrupt
> context or with interrupts being disabled. So replace kfree_skb()
> with dev_kfree_skb_irq() under spin_lock_irqsave(). Compile
> tested only.
>
> Fixes: fc75122fabb5 ("libertas_tf: use irqsave() in USB's complete callback")
> Signed-off-by: Yang Yingliang <[email protected]>

4 patches applied to wireless-next.git, thanks.

9388ce97b982 wifi: libertas_tf: don't call kfree_skb() under spin_lock_irqsave()
3968e81ba644 wifi: libertas: if_usb: don't call kfree_skb() under spin_lock_irqsave()
f393df151540 wifi: libertas: main: don't call kfree_skb() under spin_lock_irqsave()
708a49a64237 wifi: libertas: cmdresp: don't call kfree_skb() under spin_lock_irqsave()

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2023-04-06 15:03:06

by Info Skymem

[permalink] [raw]
Subject: Re: [v2,1/4] wifi: libertas_tf: don't call kfree_skb() under spin_lock_irqsave()

Dear Kalle Valo, Yang Yingliang, and Libertas-dev team,

Thank you for your hard work on the recent patches. I'd like to
introduce you to our website, https://www.skymem.info, an email
finding tool that can help you expand your network and connect with
potential collaborators. You can use it like Google for emails.

Here are the advantages of using Skymem for your networking needs:
1. Endless search of emails and domains.
2. Creation of an email list using an advanced filter.
3. Price per email over 10 times lower than that of competitors.

We believe Skymem could be a valuable resource for you in building
connections within the wireless and kernel development communities.

Best regards,

Robert
Skymem Team
https://www.skymem.info

On Thu, Dec 22, 2022 at 5:28 PM Kalle Valo <[email protected]> wrote:
>
> Yang Yingliang <[email protected]> wrote:
>
> > It is not allowed to call kfree_skb() from hardware interrupt
> > context or with interrupts being disabled. So replace kfree_skb()
> > with dev_kfree_skb_irq() under spin_lock_irqsave(). Compile
> > tested only.
> >
> > Fixes: fc75122fabb5 ("libertas_tf: use irqsave() in USB's complete callback")
> > Signed-off-by: Yang Yingliang <[email protected]>
>
> 4 patches applied to wireless-next.git, thanks.
>
> 9388ce97b982 wifi: libertas_tf: don't call kfree_skb() under spin_lock_irqsave()
> 3968e81ba644 wifi: libertas: if_usb: don't call kfree_skb() under spin_lock_irqsave()
> f393df151540 wifi: libertas: main: don't call kfree_skb() under spin_lock_irqsave()
> 708a49a64237 wifi: libertas: cmdresp: don't call kfree_skb() under spin_lock_irqsave()
>
> --
> https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
>
>
> _______________________________________________
> libertas-dev mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/libertas-dev