Skip to contentSkip to conversation

iwlwifi: turn on a lockdep assertion

PATCH Superseded Dan Carpenter 3 participants 7 messages Jun 9, 2012 – Jun 11, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: turn on a lockdep assertion

CMD_SYNC is zero so the if (cmd->flags & CMD_SYNC) is never true. I think it should be if (cmd->flags = CMD_SYNC). This enables a lockdep assertion.

drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -1
index e55ec6c..c5ccdfa 100644
@@ -1259,7 +1259,7 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 	 * the mutex, this ensures we don't try to send two
 	 * (or more) synchronous commands at a time.
 	 */
-	if (cmd->flags & CMD_SYNC)
+	if (cmd->flags = CMD_SYNC)
 		lockdep_assert_held(&priv->mutex);
 
 	if (priv->ucode_owner = IWL_OWNERSHIP_TM &&
maintainer
#1 lore raw
Quoted 3 lines · Dan Carpenter

CMD_SYNC is zero so the if (cmd->flags & CMD_SYNC) is never true. I think it should be if (cmd->flags = CMD_SYNC). This enables a lockdep assertion.

Good catch, thanks. It should really be if (!(cmd->flags & CMD_ASYNC)) though I think as there could be other flags set which don't make it non-sync.

I'll commit a fix on Monday unless you want to send a separate patch (which I'll then pick up on Monday :-) )

johannes

#2 lore raw
Quoted 11 lines · Johannes Berg
Quoted 3 lines · Dan Carpenter

CMD_SYNC is zero so the if (cmd->flags & CMD_SYNC) is never true. I think it should be if (cmd->flags = CMD_SYNC). This enables a lockdep assertion.

Good catch, thanks. It should really be if (!(cmd->flags & CMD_ASYNC)) though I think as there could be other flags set which don't make it non-sync.

I'll commit a fix on Monday unless you want to send a separate patch (which I'll then pick up on Monday :-) )

Sure. I'll resend it.

regards,
dan carpenter

#3 lore raw

PATCH v2 1/1 iwlwifi: turn on a lockdep assertion

In reply to Johannes Berg

CMD_SYNC is zero so the if (cmd->flags & CMD_SYNC) is never true and we never check the assertion.

---
v2: enables the assertion even more than v1 (based on feedback from Johannes Berg).

drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -1
index e55ec6c..5c04895 100644
@@ -1259,7 +1259,7 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 	 * the mutex, this ensures we don't try to send two
 	 * (or more) synchronous commands at a time.
 	 */
-	if (cmd->flags & CMD_SYNC)
+	if (!(cmd->flags & CMD_ASYNC))
 		lockdep_assert_held(&priv->mutex);
 
 	if (priv->ucode_owner = IWL_OWNERSHIP_TM &&
#4 lore raw

Am 10.06.2012 13:25, schrieb Dan Carpenter:

Quoted 7 lines

CMD_SYNC is zero so the if (cmd->flags & CMD_SYNC) is never true and we never check the assertion.

---
v2: enables the assertion even more than v1 (based on feedback from Johannes Berg).

The important part is CMD_SYNC -> CMD_ASYNC

re,
wh

Quoted 20 lines
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -2
index e55ec6c..5c04895 100644
@@ -1259,7 +1259,7 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 	 * the mutex, this ensures we don't try to send two
 	 * (or more) synchronous commands at a time.
 	 */
-	if (cmd->flags & CMD_SYNC)
+	if (!(cmd->flags & CMD_ASYNC))
 		lockdep_assert_held(&priv->mutex);
 
 	if (priv->ucode_owner = IWL_OWNERSHIP_TM &&
--

To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 6 lines · walter harms

Am 10.06.2012 13:25, schrieb Dan Carpenter:

Quoted 3 lines

CMD_SYNC is zero so the if (cmd->flags & CMD_SYNC) is never true and we never check the assertion.

Quoted 6 lines
Quoted 4 lines

---
v2: enables the assertion even more than v1 (based on feedback from Johannes Berg).

The important part is CMD_SYNC -> CMD_ASYNC

Not really, no. I considered Johannes's version for my first patch but I decided to be conservative because I didn't know the code well enough to say what is safe.

regards,
dan carpenter