aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-12-09 10:26:13 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-12-19 16:17:44 -0500
commitb80667eee2af9c1a36ec45a06f9ff85dd8768412 (patch)
tree396743cbbcb1d1b6c196bfcc3fc9dacd2a07b7b6 /drivers/net/wireless/iwlwifi
parent27bf88829f50cf1af2b052ecee2f6f0dbe4a5141 (diff)
iwlagn: add IRQ tracing
The legacy IRQs could be read from a trace by their IO accesses, but reading the ICT doesn't leave any trace (pun intended ;-) ) so in order to see what input they get we need to add specific tracepoints. While at it, fix whitespace in two related places. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace.h29
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c32
2 files changed, 50 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
index f9d3319ecad5..9b212a8f30bb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
@@ -90,6 +90,35 @@ TRACE_EVENT(iwlwifi_dev_iowrite32,
90 TP_printk("[%p] write io[%#x] = %#x)", __entry->priv, __entry->offs, __entry->val) 90 TP_printk("[%p] write io[%#x] = %#x)", __entry->priv, __entry->offs, __entry->val)
91); 91);
92 92
93TRACE_EVENT(iwlwifi_dev_irq,
94 TP_PROTO(void *priv),
95 TP_ARGS(priv),
96 TP_STRUCT__entry(
97 PRIV_ENTRY
98 ),
99 TP_fast_assign(
100 PRIV_ASSIGN;
101 ),
102 /* TP_printk("") doesn't compile */
103 TP_printk("%d", 0)
104);
105
106TRACE_EVENT(iwlwifi_dev_ict_read,
107 TP_PROTO(void *priv, u32 index, u32 value),
108 TP_ARGS(priv, index, value),
109 TP_STRUCT__entry(
110 PRIV_ENTRY
111 __field(u32, index)
112 __field(u32, value)
113 ),
114 TP_fast_assign(
115 PRIV_ASSIGN;
116 __entry->index = index;
117 __entry->value = value;
118 ),
119 TP_printk("read ict[%d] = %#.8x", __entry->index, __entry->value)
120);
121
93#undef TRACE_SYSTEM 122#undef TRACE_SYSTEM
94#define TRACE_SYSTEM iwlwifi_ucode 123#define TRACE_SYSTEM iwlwifi_ucode
95 124
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
index 791005d47836..06d5698cd03e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
@@ -1281,6 +1281,8 @@ static irqreturn_t iwl_isr(int irq, void *data)
1281 if (!trans) 1281 if (!trans)
1282 return IRQ_NONE; 1282 return IRQ_NONE;
1283 1283
1284 trace_iwlwifi_dev_irq(priv(trans));
1285
1284 trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 1286 trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1285 1287
1286 spin_lock_irqsave(&trans->shrd->lock, flags); 1288 spin_lock_irqsave(&trans->shrd->lock, flags);
@@ -1355,6 +1357,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
1355 struct iwl_trans_pcie *trans_pcie; 1357 struct iwl_trans_pcie *trans_pcie;
1356 u32 inta, inta_mask; 1358 u32 inta, inta_mask;
1357 u32 val = 0; 1359 u32 val = 0;
1360 u32 read;
1358 unsigned long flags; 1361 unsigned long flags;
1359 1362
1360 if (!trans) 1363 if (!trans)
@@ -1368,6 +1371,8 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
1368 if (!trans_pcie->use_ict) 1371 if (!trans_pcie->use_ict)
1369 return iwl_isr(irq, data); 1372 return iwl_isr(irq, data);
1370 1373
1374 trace_iwlwifi_dev_irq(priv(trans));
1375
1371 spin_lock_irqsave(&trans->shrd->lock, flags); 1376 spin_lock_irqsave(&trans->shrd->lock, flags);
1372 1377
1373 /* Disable (but don't clear!) interrupts here to avoid 1378 /* Disable (but don't clear!) interrupts here to avoid
@@ -1382,24 +1387,29 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
1382 /* Ignore interrupt if there's nothing in NIC to service. 1387 /* Ignore interrupt if there's nothing in NIC to service.
1383 * This may be due to IRQ shared with another device, 1388 * This may be due to IRQ shared with another device,
1384 * or due to sporadic interrupts thrown from our NIC. */ 1389 * or due to sporadic interrupts thrown from our NIC. */
1385 if (!trans_pcie->ict_tbl[trans_pcie->ict_index]) { 1390 read = le32_to_cpu(trans_pcie->ict_tbl[trans_pcie->ict_index]);
1391 trace_iwlwifi_dev_ict_read(priv(trans), trans_pcie->ict_index, read);
1392 if (!read) {
1386 IWL_DEBUG_ISR(trans, "Ignore interrupt, inta == 0\n"); 1393 IWL_DEBUG_ISR(trans, "Ignore interrupt, inta == 0\n");
1387 goto none; 1394 goto none;
1388 } 1395 }
1389 1396
1390 /* read all entries that not 0 start with ict_index */ 1397 /*
1391 while (trans_pcie->ict_tbl[trans_pcie->ict_index]) { 1398 * Collect all entries up to the first 0, starting from ict_index;
1392 1399 * note we already read at ict_index.
1393 val |= le32_to_cpu(trans_pcie->ict_tbl[trans_pcie->ict_index]); 1400 */
1401 do {
1402 val |= read;
1394 IWL_DEBUG_ISR(trans, "ICT index %d value 0x%08X\n", 1403 IWL_DEBUG_ISR(trans, "ICT index %d value 0x%08X\n",
1395 trans_pcie->ict_index, 1404 trans_pcie->ict_index, read);
1396 le32_to_cpu(
1397 trans_pcie->ict_tbl[trans_pcie->ict_index]));
1398 trans_pcie->ict_tbl[trans_pcie->ict_index] = 0; 1405 trans_pcie->ict_tbl[trans_pcie->ict_index] = 0;
1399 trans_pcie->ict_index = 1406 trans_pcie->ict_index =
1400 iwl_queue_inc_wrap(trans_pcie->ict_index, ICT_COUNT); 1407 iwl_queue_inc_wrap(trans_pcie->ict_index, ICT_COUNT);
1401 1408
1402 } 1409 read = le32_to_cpu(trans_pcie->ict_tbl[trans_pcie->ict_index]);
1410 trace_iwlwifi_dev_ict_read(priv(trans), trans_pcie->ict_index,
1411 read);
1412 } while (read);
1403 1413
1404 /* We should not get this value, just ignore it. */ 1414 /* We should not get this value, just ignore it. */
1405 if (val == 0xffffffff) 1415 if (val == 0xffffffff)
@@ -1426,7 +1436,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
1426 if (likely(inta)) 1436 if (likely(inta))
1427 tasklet_schedule(&trans_pcie->irq_tasklet); 1437 tasklet_schedule(&trans_pcie->irq_tasklet);
1428 else if (test_bit(STATUS_INT_ENABLED, &trans->shrd->status) && 1438 else if (test_bit(STATUS_INT_ENABLED, &trans->shrd->status) &&
1429 !trans_pcie->inta) { 1439 !trans_pcie->inta) {
1430 /* Allow interrupt if was disabled by this handler and 1440 /* Allow interrupt if was disabled by this handler and
1431 * no tasklet was schedules, We should not enable interrupt, 1441 * no tasklet was schedules, We should not enable interrupt,
1432 * tasklet will enable it. 1442 * tasklet will enable it.
@@ -1442,7 +1452,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
1442 * only Re-enable if disabled by irq. 1452 * only Re-enable if disabled by irq.
1443 */ 1453 */
1444 if (test_bit(STATUS_INT_ENABLED, &trans->shrd->status) && 1454 if (test_bit(STATUS_INT_ENABLED, &trans->shrd->status) &&
1445 !trans_pcie->inta) 1455 !trans_pcie->inta)
1446 iwl_enable_interrupts(trans); 1456 iwl_enable_interrupts(trans);
1447 1457
1448 spin_unlock_irqrestore(&trans->shrd->lock, flags); 1458 spin_unlock_irqrestore(&trans->shrd->lock, flags);