aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2009-11-06 17:52:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-11 15:23:46 -0500
commite585447189123de627ecbfaccab9d7a3328a5dd8 (patch)
tree024a18c68f57e0f0d23a5cdf2987b769c0b5a6f4 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent84c4069232a671b3739387949d5cb588dacbd24a (diff)
iwlwifi: speed up event log dumps
Take advantage of device's auto-increment for SRAM reads to eliminate extra write address accesses. Grab/release NIC access before/after entire read sequence, rather than for each read individually. After a quick check of dmesg logs, this seems to double Event Log dump speed, reducing from about 20 milliseconds to about 10 milliseconds for 512 entries using 3945. 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/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a17afe01c0c0..92ecdd9abd9f 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1570,6 +1570,7 @@ static void iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
1570 u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */ 1570 u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
1571 u32 ptr; /* SRAM byte address of log data */ 1571 u32 ptr; /* SRAM byte address of log data */
1572 u32 ev, time, data; /* event log data */ 1572 u32 ev, time, data; /* event log data */
1573 unsigned long reg_flags;
1573 1574
1574 if (num_events == 0) 1575 if (num_events == 0)
1575 return; 1576 return;
@@ -1583,24 +1584,33 @@ static void iwl3945_print_event_log(struct iwl_priv *priv, u32 start_idx,
1583 1584
1584 ptr = base + EVENT_START_OFFSET + (start_idx * event_size); 1585 ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
1585 1586
1587 /* Make sure device is powered up for SRAM reads */
1588 spin_lock_irqsave(&priv->reg_lock, reg_flags);
1589 iwl_grab_nic_access(priv);
1590
1591 /* Set starting address; reads will auto-increment */
1592 _iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR, ptr);
1593 rmb();
1594
1586 /* "time" is actually "data" for mode 0 (no timestamp). 1595 /* "time" is actually "data" for mode 0 (no timestamp).
1587 * place event id # at far right for easier visual parsing. */ 1596 * place event id # at far right for easier visual parsing. */
1588 for (i = 0; i < num_events; i++) { 1597 for (i = 0; i < num_events; i++) {
1589 ev = iwl_read_targ_mem(priv, ptr); 1598 ev = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1590 ptr += sizeof(u32); 1599 time = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1591 time = iwl_read_targ_mem(priv, ptr);
1592 ptr += sizeof(u32);
1593 if (mode == 0) { 1600 if (mode == 0) {
1594 /* data, ev */ 1601 /* data, ev */
1595 IWL_ERR(priv, "0x%08x\t%04u\n", time, ev); 1602 IWL_ERR(priv, "0x%08x\t%04u\n", time, ev);
1596 trace_iwlwifi_dev_ucode_event(priv, 0, time, ev); 1603 trace_iwlwifi_dev_ucode_event(priv, 0, time, ev);
1597 } else { 1604 } else {
1598 data = iwl_read_targ_mem(priv, ptr); 1605 data = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1599 ptr += sizeof(u32);
1600 IWL_ERR(priv, "%010u\t0x%08x\t%04u\n", time, data, ev); 1606 IWL_ERR(priv, "%010u\t0x%08x\t%04u\n", time, data, ev);
1601 trace_iwlwifi_dev_ucode_event(priv, time, data, ev); 1607 trace_iwlwifi_dev_ucode_event(priv, time, data, ev);
1602 } 1608 }
1603 } 1609 }
1610
1611 /* Allow device to power down */
1612 iwl_release_nic_access(priv);
1613 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
1604} 1614}
1605 1615
1606/* For sanity check only. Actual size is determined by uCode, typ. 512 */ 1616/* For sanity check only. Actual size is determined by uCode, typ. 512 */