linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* iwl: potential deadlock?
@ 2009-07-13 19:34 Jiri Slaby
  2009-07-13 20:18 ` reinette chatre
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2009-07-13 19:34 UTC (permalink / raw)
  To: yi.zhu
  Cc: reinette.chatre, linux-wireless, ipw3945-devel,
	Linux kernel mailing list

Hi,

we found a potential deadlock in iwl code by our tool.

Can this happen:
iwl_update_tkip_key()
-> spin_lock_irqsave(&priv->sta_lock)
-> iwl_send_add_sta()
   -> iwl_sta_ucode_activate()
      -> spin_lock_irqsave(&priv->sta_lock)
?

Thanks.

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

* Re: iwl: potential deadlock?
  2009-07-13 19:34 iwl: potential deadlock? Jiri Slaby
@ 2009-07-13 20:18 ` reinette chatre
  2009-07-13 20:33   ` Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: reinette chatre @ 2009-07-13 20:18 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Zhu, Yi, linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net, Linux kernel mailing list

Hi Jiri,

On Mon, 2009-07-13 at 12:34 -0700, Jiri Slaby wrote:
> Hi,
> 
> we found a potential deadlock in iwl code by our tool.

What tool is this?

> 
> Can this happen:

I don't think so ...

> iwl_update_tkip_key()
> -> spin_lock_irqsave(&priv->sta_lock)
> -> iwl_send_add_sta()

iwl_send_add_sta() is called here with flags = CMD_ASYNC

In iwl_send_add_sta() we have:
	if (ret || (flags & CMD_ASYNC))
		return ret;

>    -> iwl_sta_ucode_activate()

... so this is not run in this case.

>       -> spin_lock_irqsave(&priv->sta_lock)

Reinette


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

* Re: iwl: potential deadlock?
  2009-07-13 20:18 ` reinette chatre
@ 2009-07-13 20:33   ` Jiri Slaby
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-07-13 20:33 UTC (permalink / raw)
  To: reinette chatre
  Cc: Zhu, Yi, linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net, Linux kernel mailing list

On 07/13/2009 10:18 PM, reinette chatre wrote:
> On Mon, 2009-07-13 at 12:34 -0700, Jiri Slaby wrote:
>> we found a potential deadlock in iwl code by our tool.
> 
> What tool is this?

It's called stanse[1], we still work on it.

>> iwl_update_tkip_key()
>> -> spin_lock_irqsave(&priv->sta_lock)
>> -> iwl_send_add_sta()
> 
> iwl_send_add_sta() is called here with flags = CMD_ASYNC
> 
> In iwl_send_add_sta() we have:
> 	if (ret || (flags & CMD_ASYNC))
> 		return ret;

Yes, you're right, indeed. Thanks for the explanation.

[1] http://iti.fi.muni.cz/stanse/

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

end of thread, other threads:[~2009-07-13 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13 19:34 iwl: potential deadlock? Jiri Slaby
2009-07-13 20:18 ` reinette chatre
2009-07-13 20:33   ` Jiri Slaby

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