iwlwifi: turn on a lockdep assertion
Subsystems (2)
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
@@ -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 &&
Johannes Berg
maintainerQuoted 3 lines · Dan Carpenter
CMD_SYNCis 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
Quoted 11 lines · Johannes Berg
Quoted 3 lines · Dan Carpenter
CMD_SYNCis 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
PATCH v2 1/1 iwlwifi: turn on a lockdep assertion
In reply to Johannes BergCMD_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
@@ -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 &&
Am 10.06.2012 13:25, schrieb Dan Carpenter:
Quoted 7 lines
CMD_SYNCis zero so the if (cmd->flags&CMD_SYNC) is never true and we never check the assertion.Signed-off-by Dan Carpenter <[email protected]>---
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@@ -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
Quoted 6 lines · walter harms
Am 10.06.2012 13:25, schrieb Dan Carpenter:
Quoted 3 lines
CMD_SYNCis zero so the if (cmd->flags&CMD_SYNC) is never true and we never check the assertion.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Dan Carpenter <[email protected]>---
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
Johannes Berg
maintainerQuoted 7 lines · Dan Carpenter
CMD_SYNCis zero so the if (cmd->flags&CMD_SYNC) is never true and we never check the assertion.Signed-off-by Dan Carpenter <[email protected]>---
v2: enables the assertion even more than v1 (based on feedback from Johannes Berg).
Thanks, I picked this up.
johannes