Skip to contentSkip to conversation

usb: fix bug in marvell libertas driver

PATCH Superseded Jakov Novak 3 participants 9 messages Apr 10 – May 4 Marvell libertas wireless driver

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover usb: fix bug in marvell libertas driver

This patch fixes a bug inside the Marvell Libertas driver. The problem was the if_usb_disconnect function not properly calling wake_up(), which lead to if_usb_prog_firmware being stuck on initialization. This caused the lbs_wait_for_firmware_load to be stuck as well and to trigger the error message.
The solution was to add the wake_up() call inside if_usb_disconnect.

Jakov Novak (1):
add wake_up call inside if_usb_disconnect

 drivers/net/wireless/marvell/libertas/if_usb.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/1 add wake_up call inside if_usb_disconnect

---
 drivers/net/wireless/marvell/libertas/if_usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/marvell/libertas/if_usb.c +1 -0
index 8a6bf1365cfa..245c902a7e42 100644
@@ -310,6 +310,7 @@ static void if_usb_disconnect(struct usb_interface *intf)
 	struct lbs_private *priv = cardp->priv;
 
 	cardp->surprise_removed = 1;
+	wake_up(&cardp->fw_wq);
 
 	if (priv) {
 		lbs_stop_card(priv);
Signature · 1 line
2.53.0
#3 lore raw

v2 cover wifi: libertas: fix bug in Marvell Libertas driver

Thank you for the reply. It should be fixed now.

Jakov Novak (1):
wifi: libertas: add wake_up() call to properly notify fw_wq during
disconnect

 drivers/net/wireless/marvell/libertas/if_usb.c | 1 -
 1 file changed, 1 deletion(-)
Signature · 1 line
2.53.0
#4 lore raw

PATCH v2 1/1 wifi: libertas: add wake_up() call to properly notify fw_wq during disconnect

This is necessary because the thread would be stuck if the firmware is not fully loaded before the if_usb_disconnect function is called. In that case if_usb_prog_firmware would be stuck in wait_event_interruptible and lbs_remove_card would also be stuck waiting for firmware loading to be done which was the original bug reported.

Fixes 954ee164f4f4 ("[PATCH] libertas: reorganize and simplify init sequence")
Reported-and-tested-by [email protected]
---
 drivers/net/wireless/marvell/libertas/if_usb.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/marvell/libertas/if_usb.c +0 -1
index 245c902a7e42..8a6bf1365cfa 100644
@@ -310,7 +310,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
 	struct lbs_private *priv = cardp->priv;
 
 	cardp->surprise_removed = 1;
-	wake_up(&cardp->fw_wq);
 
 	if (priv) {
 		lbs_stop_card(priv);
Signature · 1 line
2.53.0
#5 lore raw

v2 cover wifi: libertas: fix bug in Marvell Libertas driver

In reply to Johannes Berg

This is the same patch with the suggested tag and message fixes.

Jakov Novak (1):
wifi: libertas: add wake_up() call to properly notify

 drivers/net/wireless/marvell/libertas/if_usb.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.54.0
#6 lore raw

PATCH RESEND v2 1/1 wifi: libertas: add wake_up() call to properly notify

This is necessary because the thread would be stuck if the firmware is not fully loaded before the if_usb_disconnect function is called. In that case if_usb_prog_firmware would be stuck in wait_event_interruptible and lbs_remove_card would also be stuck waiting for firmware loading to be done which was the original bug reported.

Fixes 954ee164f4f4 ("[PATCH] libertas: reorganize and simplify init sequence")
Reported-and-tested-by [email protected]
---
 drivers/net/wireless/marvell/libertas/if_usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/marvell/libertas/if_usb.c +1 -0
index 4fae0e335136..22f0bd6a141a 100644
@@ -310,6 +310,7 @@ static void if_usb_disconnect(struct usb_interface *intf)
 	struct lbs_private *priv = cardp->priv;
 
 	cardp->surprise_removed = 1;
+	wake_up(&cardp->fw_wq);
 
 	if (priv) {
 		lbs_stop_card(priv);
Signature · 1 line
2.54.0
#7 lore raw

Re: [resend PATCH v2 0/1] wifi: libertas: fix bug in Marvell Libertas driver

In reply to Jakov Novak
Quoted 2 lines · Jakov Novak

This is the same patch with the suggested tag and message fixes.

That makes it not a resend but a v3 I guess ...

johannes

#8 lore raw

Re: [resend PATCH v2 0/1] wifi: libertas: fix bug in Marvell Libertas driver

In reply to Jakov Novak
Quoted 8 lines · Jakov Novak

This is the same patch with the suggested tag and message fixes.

Jakov Novak (1):
wifi: libertas: add wake_up() call to properly notify

 drivers/net/wireless/marvell/libertas/if_usb.c | 1 +
 1 file changed, 1 insertion(+)

1) A single patch doesn't need a cover letter
2) new versions of a patch should be a separate thread. Don't make new versions "In-reply-to" the previous version.
3) Ingo Molnar once suggested a good template to follow for many changes:https://lore.kernel.org/all/[email protected]/ Over time I found this advice helpful, although not that exact template, especially given that using "we" is now strongly discouraged.

I suggest something more like:
Currently, when <scenario>, <code reference> does <action>.
This has a <problem description>.
To address this issue, <imperative action to fix the code>.
<Any other comments which support this action such as describing how it fixes the problem, how we know there are no side-effects (or known side-effects or limitations)>