linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] wireless: wl12xx, fix lock imbalance
@ 2009-07-14 20:37 Jiri Slaby
  2009-07-15  5:41 ` Luciano Coelho
  2009-07-16  9:09 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Slaby @ 2009-07-14 20:37 UTC (permalink / raw)
  To: linville; +Cc: luciano.coelho, linux-wireless, linux-kernel, Jiri Slaby

Add omitted mutex_unlock to one of wl12xx_op_start fail paths (when
wl12xx_chip_wakeup fails).

[v2]
Power off the device, because:
\= cite from http://marc.info/?l=linux-kernel&m=124755028209880&w=2
If the chip cannot be booted, why should it remain powered on?
In some rare cases, the chip might fail to initialize, but can
recover if powered off and on again, so turning it off at this
point is the right thing to do. =/

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/net/wireless/wl12xx/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 603d611..d30683c 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -336,7 +336,7 @@ static int wl12xx_op_start(struct ieee80211_hw *hw)
 
 	ret = wl12xx_chip_wakeup(wl);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	ret = wl->chip.op_boot(wl);
 	if (ret < 0)
-- 
1.6.3.2


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

* Re: [PATCH v2] wireless: wl12xx, fix lock imbalance
  2009-07-14 20:37 [PATCH v2] wireless: wl12xx, fix lock imbalance Jiri Slaby
@ 2009-07-15  5:41 ` Luciano Coelho
  2009-07-16  9:09 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Luciano Coelho @ 2009-07-15  5:41 UTC (permalink / raw)
  To: ext Jiri Slaby; +Cc: linville, linux-wireless, linux-kernel

ext Jiri Slaby wrote:
> Add omitted mutex_unlock to one of wl12xx_op_start fail paths (when
> wl12xx_chip_wakeup fails).
>
> [v2]
> Power off the device, because:
> \= cite from http://marc.info/?l=linux-kernel&m=124755028209880&w=2
> If the chip cannot be booted, why should it remain powered on?
> In some rare cases, the chip might fail to initialize, but can
> recover if powered off and on again, so turning it off at this
> point is the right thing to do. =/
>
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> ---
>   

Looks good now.  Thanks!

Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>

>  drivers/net/wireless/wl12xx/main.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
> index 603d611..d30683c 100644
> --- a/drivers/net/wireless/wl12xx/main.c
> +++ b/drivers/net/wireless/wl12xx/main.c
> @@ -336,7 +336,7 @@ static int wl12xx_op_start(struct ieee80211_hw *hw)
>  
>  	ret = wl12xx_chip_wakeup(wl);
>  	if (ret < 0)
> -		return ret;
> +		goto out;
>  
>  	ret = wl->chip.op_boot(wl);
>  	if (ret < 0)
>   


-- 
Cheers,
Luca.


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

* Re: [PATCH v2] wireless: wl12xx, fix lock imbalance
  2009-07-14 20:37 [PATCH v2] wireless: wl12xx, fix lock imbalance Jiri Slaby
  2009-07-15  5:41 ` Luciano Coelho
@ 2009-07-16  9:09 ` Kalle Valo
  2009-07-20 21:28   ` Jiri Slaby
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2009-07-16  9:09 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linville, luciano.coelho, linux-wireless, linux-kernel

Jiri Slaby <jirislaby@gmail.com> writes:

> Add omitted mutex_unlock to one of wl12xx_op_start fail paths (when
> wl12xx_chip_wakeup fails).

Thanks for fixing this.

> [v2]
> Power off the device, because:
> \= cite from http://marc.info/?l=linux-kernel&m=124755028209880&w=2
> If the chip cannot be booted, why should it remain powered on?
> In some rare cases, the chip might fail to initialize, but can
> recover if powered off and on again, so turning it off at this
> point is the right thing to do. =/

Yes, I agree with this.

> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> ---
>  drivers/net/wireless/wl12xx/main.c |    2 +-

Unfortunately this won't apply to wireless-testing because main.c is
renamed to wl1251_main.c. Can you respin the patch or do you want me to
do it? I'm sending other wl12xx patches anyway and it's easy for me to
rebase this one at the same time.

-- 
Kalle Valo

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

* Re: [PATCH v2] wireless: wl12xx, fix lock imbalance
  2009-07-16  9:09 ` Kalle Valo
@ 2009-07-20 21:28   ` Jiri Slaby
  2009-07-21  9:10     ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby @ 2009-07-20 21:28 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linville, luciano.coelho, linux-wireless, linux-kernel

On 07/16/2009 11:09 AM, Kalle Valo wrote:
>> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
>> ---
>>  drivers/net/wireless/wl12xx/main.c |    2 +-
> 
> Unfortunately this won't apply to wireless-testing because main.c is
> renamed to wl1251_main.c.
> Can you respin the patch or do you want me to
> do it? I'm sending other wl12xx patches anyway and it's easy for me to
> rebase this one at the same time.

It seems to be fixed now. But currently I'm confused by wl1251_plt_start
and wl1251_plt_stop. They take a lock but doesn't unlock it at all.
Neither their callies. Is it hidden somewhere deeper?

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

* Re: [PATCH v2] wireless: wl12xx, fix lock imbalance
  2009-07-20 21:28   ` Jiri Slaby
@ 2009-07-21  9:10     ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2009-07-21  9:10 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linville, luciano.coelho, linux-wireless, linux-kernel

Jiri Slaby <jirislaby@gmail.com> writes:

> But currently I'm confused by wl1251_plt_start and wl1251_plt_stop.
> They take a lock but doesn't unlock it at all. Neither their callies.
> Is it hidden somewhere deeper?

I guess that's a bug which creeped in when I ported the patches from our
internal tree. I'll just remove plt start/stop functions altogether,
they need to ported to the new nl80211 test mode interface anyway.

Oh damn, I just noticed that I added wl1251_netlink.c accidentally to
wireless-testing tree. It should definitely not be there, instead we
need to use nl80211 test command interface. I'll send a patch to remove
the private netlink stuff soon. John, sorry about this.

-- 
Kalle Valo

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

end of thread, other threads:[~2009-07-21  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-14 20:37 [PATCH v2] wireless: wl12xx, fix lock imbalance Jiri Slaby
2009-07-15  5:41 ` Luciano Coelho
2009-07-16  9:09 ` Kalle Valo
2009-07-20 21:28   ` Jiri Slaby
2009-07-21  9:10     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).