firewire: ohci: add tracepoints event for hardIRQ event

1394 OHCI hardware triggers PCI interrupts to notify any events to
software. Current driver for the hardware is programmed by the typical
way to utilize top- and bottom- halves, thus it has a timing gap to handle
the notification in softIRQ (tasklet).

This commit adds a tracepoint event for the hardIRQ event. The comparison
of the tracepoint event to tracepoints events in firewire subsystem is
helpful to diagnose the timing gap.

Link: https://lore.kernel.org/r/20240625031806.956650-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
Takashi Sakamoto 2024-06-25 12:18:06 +09:00
parent 001c1ff5dc
commit 0d8914165d
2 changed files with 33 additions and 1 deletions
drivers/firewire
include/trace/events

@ -2185,6 +2185,7 @@ static irqreturn_t irq_handler(int irq, void *data)
*/
reg_write(ohci, OHCI1394_IntEventClear,
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
trace_irqs(ohci->card.index, event);
log_irqs(ohci, event);
// The flag is masked again at bus_reset_work() scheduled by selfID event.
if (event & OHCI1394_busReset)

@ -9,7 +9,38 @@
#include <linux/tracepoint.h>
// Placeholder for future use.
TRACE_EVENT(irqs,
TP_PROTO(unsigned int card_index, u32 events),
TP_ARGS(card_index, events),
TP_STRUCT__entry(
__field(u8, card_index)
__field(u32, events)
),
TP_fast_assign(
__entry->card_index = card_index;
__entry->events = events;
),
TP_printk(
"card_index=%u events=%s",
__entry->card_index,
__print_flags(__entry->events, "|",
{ OHCI1394_selfIDComplete, "selfIDComplete" },
{ OHCI1394_RQPkt, "RQPkt" },
{ OHCI1394_RSPkt, "RSPkt" },
{ OHCI1394_reqTxComplete, "reqTxComplete" },
{ OHCI1394_respTxComplete, "respTxComplete" },
{ OHCI1394_isochRx, "isochRx" },
{ OHCI1394_isochTx, "isochTx" },
{ OHCI1394_postedWriteErr, "postedWriteErr" },
{ OHCI1394_cycleTooLong, "cycleTooLong" },
{ OHCI1394_cycle64Seconds, "cycle64Seconds" },
{ OHCI1394_cycleInconsistent, "cycleInconsistent" },
{ OHCI1394_regAccessFail, "regAccessFail" },
{ OHCI1394_unrecoverableError, "unrecoverableError" },
{ OHCI1394_busReset, "busReset" }
)
)
);
#endif // _FIREWIRE_OHCI_TRACE_EVENT_H