diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2009-11-20 15:04:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-23 17:05:30 -0500 |
commit | 74ba67edfcb235c0415a62d37493866c8380dc1d (patch) | |
tree | cadd766c992a8ac760443ecb25f4819123b9733b /drivers/net/wireless/iwlwifi/iwl-core.c | |
parent | 4e03185fb8e85d5624d3a68feced70cc9c9e2136 (diff) |
iwlagn: Use iwl_write8() for CSR_INT_COALESCING register
CSR_INT_COALESCING previously had only one, but now has two single-byte fields.
With only one single-byte field (lowest order byte) it was okay to write via
iwl_write32(), but now with two, an iwl_write32() to the lower order field
clobbers the other field (odd-address CSR_INT_PERIODIC_REG, offset 0x5), and an
iwl_write32() to CSR_INT_PERIODIC_REG could clobber the lowest byte of the
next-higher register (CSR_INT, offset 0x8).
Fortunately, no bad side effects have been produced by the iwl_write32()
usage, due to order of execution (low order byte was always written before
higher order byte), and the fact that writing "0" to the low byte of the
next higher register has no effect (only action is when writing "1"s).
Nonetheless, this cleans up the accesses so no bad side effects might occur
in the future, if execution order changes, or more bit fields get added to
CSR_INT_COALESCING.
Add some comments regarding periodic interrupt usage.
Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index a2636f4b068f..c25cab5d0451 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -255,7 +255,10 @@ int iwl_hw_nic_init(struct iwl_priv *priv) | |||
255 | /* nic_init */ | 255 | /* nic_init */ |
256 | spin_lock_irqsave(&priv->lock, flags); | 256 | spin_lock_irqsave(&priv->lock, flags); |
257 | priv->cfg->ops->lib->apm_ops.init(priv); | 257 | priv->cfg->ops->lib->apm_ops.init(priv); |
258 | iwl_write32(priv, CSR_INT_COALESCING, 512 / 32); | 258 | |
259 | /* Set interrupt coalescing timer to 512 usecs */ | ||
260 | iwl_write8(priv, CSR_INT_COALESCING, 512 / 32); | ||
261 | |||
259 | spin_unlock_irqrestore(&priv->lock, flags); | 262 | spin_unlock_irqrestore(&priv->lock, flags); |
260 | 263 | ||
261 | ret = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN); | 264 | ret = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN); |