summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorBen Cahill2009-11-20 21:04:53 +0100
committerJohn W. Linville2009-11-23 23:05:30 +0100
commit74ba67edfcb235c0415a62d37493866c8380dc1d (patch)
treecadd766c992a8ac760443ecb25f4819123b9733b /drivers/net/wireless/iwlwifi/iwl-agn.c
parentiwlwifi: Add iwl_write8() (diff)
downloadkernel-qcow2-linux-74ba67edfcb235c0415a62d37493866c8380dc1d.tar.gz
kernel-qcow2-linux-74ba67edfcb235c0415a62d37493866c8380dc1d.tar.xz
kernel-qcow2-linux-74ba67edfcb235c0415a62d37493866c8380dc1d.zip
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-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e8f405a01e3d..a4e8db35a559 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1266,15 +1266,24 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
* 3- update RX shared data to indicate last write index.
* 4- send interrupt.
* This could lead to RX race, driver could receive RX interrupt
- * but the shared data changes does not reflect this.
- * this could lead to RX race, RX periodic will solve this race
+ * but the shared data changes does not reflect this;
+ * periodic interrupt will detect any dangling Rx activity.
*/
- iwl_write32(priv, CSR_INT_PERIODIC_REG,
+
+ /* Disable periodic interrupt; we use it as just a one-shot. */
+ iwl_write8(priv, CSR_INT_PERIODIC_REG,
CSR_INT_PERIODIC_DIS);
iwl_rx_handle(priv);
- /* Only set RX periodic if real RX is received. */
+
+ /*
+ * Enable periodic interrupt in 8 msec only if we received
+ * real RX interrupt (instead of just periodic int), to catch
+ * any dangling Rx interrupt. If it was just the periodic
+ * interrupt, there was no dangling Rx activity, and no need
+ * to extend the periodic interrupt; one-shot is enough.
+ */
if (inta & (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX))
- iwl_write32(priv, CSR_INT_PERIODIC_REG,
+ iwl_write8(priv, CSR_INT_PERIODIC_REG,
CSR_INT_PERIODIC_ENA);
priv->isr_stats.rx++;