All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] libertas/libertas_tf: don't call kfree_skb() under spin_lock_irqsave()
@ 2022-12-06 11:46 Yang Yingliang
  2022-12-06 11:46 ` [PATCH 1/4] libertas_tf: " Yang Yingliang
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Yang Yingliang @ 2022-12-06 11:46 UTC (permalink / raw)
  To: kvalo, libertas-dev, linux-wireless; +Cc: yangyingliang

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() under spin_lock_irqsave().

Yang Yingliang (4):
  libertas_tf: don't call kfree_skb() under spin_lock_irqsave()
  libertas: don't call kfree_skb() under spin_lock_irqsave() in
    process_cmdrequest()
  libertas: don't call kfree_skb() under spin_lock_irqsave() in
    lbs_stop_iface()
  libertas: don't call kfree_skb() under spin_lock_irqsave() in
    lbs_mac_event_disconnected()

 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] libertas_tf: don't call kfree_skb() under spin_lock_irqsave()
  2022-12-06 11:46 [PATCH 0/4] libertas/libertas_tf: don't call kfree_skb() under spin_lock_irqsave() Yang Yingliang
@ 2022-12-06 11:46 ` Yang Yingliang
  2022-12-06 11:46 ` [PATCH 2/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in process_cmdrequest() Yang Yingliang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Yang Yingliang @ 2022-12-06 11:46 UTC (permalink / raw)
  To: kvalo, libertas-dev, linux-wireless; +Cc: yangyingliang

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().

Fixes: fc75122fabb5 ("libertas_tf: use irqsave() in USB's complete callback")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in process_cmdrequest()
  2022-12-06 11:46 [PATCH 0/4] libertas/libertas_tf: don't call kfree_skb() under spin_lock_irqsave() Yang Yingliang
  2022-12-06 11:46 ` [PATCH 1/4] libertas_tf: " Yang Yingliang
@ 2022-12-06 11:46 ` Yang Yingliang
  2022-12-06 11:46 ` [PATCH 3/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_stop_iface() Yang Yingliang
  2022-12-06 11:46 ` [PATCH 4/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_mac_event_disconnected() Yang Yingliang
  3 siblings, 0 replies; 7+ messages in thread
From: Yang Yingliang @ 2022-12-06 11:46 UTC (permalink / raw)
  To: kvalo, libertas-dev, linux-wireless; +Cc: yangyingliang

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().

Fixes: a3128feef6d5 ("libertas: use irqsave() in USB's complete callback")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/wireless/marvell/libertas/if_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
index 32fdc4150b60..2240b4db8c03 100644
--- a/drivers/net/wireless/marvell/libertas/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -637,7 +637,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff,
 	priv->resp_len[i] = (recvlength - MESSAGE_HEADER_LEN);
 	memcpy(priv->resp_buf[i], recvbuff + MESSAGE_HEADER_LEN,
 		priv->resp_len[i]);
-	kfree_skb(skb);
+	dev_kfree_skb_irq(skb);
 	lbs_notify_command_response(priv, i);
 
 	spin_unlock_irqrestore(&priv->driver_lock, flags);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_stop_iface()
  2022-12-06 11:46 [PATCH 0/4] libertas/libertas_tf: don't call kfree_skb() under spin_lock_irqsave() Yang Yingliang
  2022-12-06 11:46 ` [PATCH 1/4] libertas_tf: " Yang Yingliang
  2022-12-06 11:46 ` [PATCH 2/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in process_cmdrequest() Yang Yingliang
@ 2022-12-06 11:46 ` Yang Yingliang
  2022-12-29  3:18   ` Info Skymem
  2022-12-06 11:46 ` [PATCH 4/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_mac_event_disconnected() Yang Yingliang
  3 siblings, 1 reply; 7+ messages in thread
From: Yang Yingliang @ 2022-12-06 11:46 UTC (permalink / raw)
  To: kvalo, libertas-dev, linux-wireless; +Cc: yangyingliang

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().

Fixes: d2e7b3425c47 ("libertas: disable functionality when interface is down")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_mac_event_disconnected()
  2022-12-06 11:46 [PATCH 0/4] libertas/libertas_tf: don't call kfree_skb() under spin_lock_irqsave() Yang Yingliang
                   ` (2 preceding siblings ...)
  2022-12-06 11:46 ` [PATCH 3/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_stop_iface() Yang Yingliang
@ 2022-12-06 11:46 ` Yang Yingliang
  2022-12-29  3:18   ` Info Skymem
  3 siblings, 1 reply; 7+ messages in thread
From: Yang Yingliang @ 2022-12-06 11:46 UTC (permalink / raw)
  To: kvalo, libertas-dev, linux-wireless; +Cc: yangyingliang

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().

Fixes: f52b041aed77 ("libertas: Add spinlock to avoid race condition")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/wireless/marvell/libertas/cmdresp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/cmdresp.c b/drivers/net/wireless/marvell/libertas/cmdresp.c
index cb515c5584c1..74cb7551f427 100644
--- a/drivers/net/wireless/marvell/libertas/cmdresp.c
+++ b/drivers/net/wireless/marvell/libertas/cmdresp.c
@@ -48,7 +48,7 @@ void lbs_mac_event_disconnected(struct lbs_private *priv,
 
 	/* Free Tx and Rx packets */
 	spin_lock_irqsave(&priv->driver_lock, flags);
-	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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_mac_event_disconnected()
  2022-12-06 11:46 ` [PATCH 4/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_mac_event_disconnected() Yang Yingliang
@ 2022-12-29  3:18   ` Info Skymem
  0 siblings, 0 replies; 7+ messages in thread
From: Info Skymem @ 2022-12-29  3:18 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: kvalo, libertas-dev, linux-wireless

Hi,
thank you for your information.

On our website you can find email addresses of companies and people.
https://www.skymem.info

In short, it’s like Google for emails.

Best regards,
Robert,
Skymem team

On Tue, Dec 6, 2022 at 12:49 PM Yang Yingliang <yangyingliang@huawei.com> 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().
>
> Fixes: f52b041aed77 ("libertas: Add spinlock to avoid race condition")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/wireless/marvell/libertas/cmdresp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/marvell/libertas/cmdresp.c b/drivers/net/wireless/marvell/libertas/cmdresp.c
> index cb515c5584c1..74cb7551f427 100644
> --- a/drivers/net/wireless/marvell/libertas/cmdresp.c
> +++ b/drivers/net/wireless/marvell/libertas/cmdresp.c
> @@ -48,7 +48,7 @@ void lbs_mac_event_disconnected(struct lbs_private *priv,
>
>         /* Free Tx and Rx packets */
>         spin_lock_irqsave(&priv->driver_lock, flags);
> -       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
>
>
> _______________________________________________
> libertas-dev mailing list
> libertas-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_stop_iface()
  2022-12-06 11:46 ` [PATCH 3/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_stop_iface() Yang Yingliang
@ 2022-12-29  3:18   ` Info Skymem
  0 siblings, 0 replies; 7+ messages in thread
From: Info Skymem @ 2022-12-29  3:18 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: kvalo, libertas-dev, linux-wireless

Hi,
thank you for your information.

On our website you can find email addresses of companies and people.
https://www.skymem.info

In short, it’s like Google for emails.

Best regards,
Robert,
Skymem team

On Tue, Dec 6, 2022 at 12:49 PM Yang Yingliang <yangyingliang@huawei.com> 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().
>
> Fixes: d2e7b3425c47 ("libertas: disable functionality when interface is down")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  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
>
>
> _______________________________________________
> libertas-dev mailing list
> libertas-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-29  3:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 11:46 [PATCH 0/4] libertas/libertas_tf: don't call kfree_skb() under spin_lock_irqsave() Yang Yingliang
2022-12-06 11:46 ` [PATCH 1/4] libertas_tf: " Yang Yingliang
2022-12-06 11:46 ` [PATCH 2/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in process_cmdrequest() Yang Yingliang
2022-12-06 11:46 ` [PATCH 3/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_stop_iface() Yang Yingliang
2022-12-29  3:18   ` Info Skymem
2022-12-06 11:46 ` [PATCH 4/4] libertas: don't call kfree_skb() under spin_lock_irqsave() in lbs_mac_event_disconnected() Yang Yingliang
2022-12-29  3:18   ` Info Skymem

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.