Skip to contentSkip to conversation

iwl: potential deadlock?

DISCUSSION Jiri Slaby 2 participants 3 messages Jul 13, 2009

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

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.

#1 lore raw

Hi Jiri,

Quoted 3 lines · Jiri Slaby

Hi,

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

What tool is this?

Quoted 2 lines

Can this happen:

I don't think so ...

Quoted 3 lines

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;
Quoted 1 line
   -> iwl_sta_ucode_activate()

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

Quoted 1 line
      -> spin_lock_irqsave(&priv->sta_lock)

Reinette

author
#2 lore raw
Quoted 4 lines · reinette chatre
Quoted 1 line · Jiri Slaby

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.

Quoted 9 lines
Quoted 3 lines

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/