aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.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/iwl-agn.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/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 9c40742727a2..2abd1f5b5eea 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1666,6 +1666,7 @@ static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
1666 u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */ 1666 u32 event_size; /* 2 u32s, or 3 u32s if timestamp recorded */
1667 u32 ptr; /* SRAM byte address of log data */ 1667 u32 ptr; /* SRAM byte address of log data */
1668 u32 ev, time, data; /* event log data */ 1668 u32 ev, time, data; /* event log data */
1669 unsigned long reg_flags;
1669 1670
1670 if (num_events == 0) 1671 if (num_events == 0)
1671 return; 1672 return;
@@ -1681,25 +1682,34 @@ static void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
1681 1682
1682 ptr = base + EVENT_START_OFFSET + (start_idx * event_size); 1683 ptr = base + EVENT_START_OFFSET + (start_idx * event_size);
1683 1684
1685 /* Make sure device is powered up for SRAM reads */
1686 spin_lock_irqsave(&priv->reg_lock, reg_flags);
1687 iwl_grab_nic_access(priv);
1688
1689 /* Set starting address; reads will auto-increment */
1690 _iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR, ptr);
1691 rmb();
1692
1684 /* "time" is actually "data" for mode 0 (no timestamp). 1693 /* "time" is actually "data" for mode 0 (no timestamp).
1685 * place event id # at far right for easier visual parsing. */ 1694 * place event id # at far right for easier visual parsing. */
1686 for (i = 0; i < num_events; i++) { 1695 for (i = 0; i < num_events; i++) {
1687 ev = iwl_read_targ_mem(priv, ptr); 1696 ev = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1688 ptr += sizeof(u32); 1697 time = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1689 time = iwl_read_targ_mem(priv, ptr);
1690 ptr += sizeof(u32);
1691 if (mode == 0) { 1698 if (mode == 0) {
1692 /* data, ev */ 1699 /* data, ev */
1693 trace_iwlwifi_dev_ucode_event(priv, 0, time, ev); 1700 trace_iwlwifi_dev_ucode_event(priv, 0, time, ev);
1694 IWL_ERR(priv, "EVT_LOG:0x%08x:%04u\n", time, ev); 1701 IWL_ERR(priv, "EVT_LOG:0x%08x:%04u\n", time, ev);
1695 } else { 1702 } else {
1696 data = iwl_read_targ_mem(priv, ptr); 1703 data = _iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
1697 ptr += sizeof(u32);
1698 IWL_ERR(priv, "EVT_LOGT:%010u:0x%08x:%04u\n", 1704 IWL_ERR(priv, "EVT_LOGT:%010u:0x%08x:%04u\n",
1699 time, data, ev); 1705 time, data, ev);
1700 trace_iwlwifi_dev_ucode_event(priv, time, data, ev); 1706 trace_iwlwifi_dev_ucode_event(priv, time, data, ev);
1701 } 1707 }
1702 } 1708 }
1709
1710 /* Allow device to power down */
1711 iwl_release_nic_access(priv);
1712 spin_unlock_irqrestore(&priv->reg_lock, reg_flags);
1703} 1713}
1704 1714
1705/* For sanity check only. Actual size is determined by uCode, typ. 512 */ 1715/* For sanity check only. Actual size is determined by uCode, typ. 512 */