aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-05-01 16:32:38 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-05-02 08:13:21 +0900
commite01f7a2a3ad9f2a099a3bf8b1c55a21efb014bbc (patch)
tree53d7393e2f4db57805441042f1b4ca0a222715e7
parent1c2e5f5d5e8695c9429c445a6f93f39173336418 (diff)
downloadlinux-next-history-e01f7a2a3ad9f2a099a3bf8b1c55a21efb014bbc.tar.gz
firewire: core: add tracepoint event for handling bus reset
Notice: this object is not reachable from any branch.
The core function expects hardware drivers to call fw_core_handle_bus_reset() when changing bus topology. The 1394 OHCI driver calls it when handling selfID event as a result of any bus-reset. This commit adds a tracepoints event for it. Link: https://lore.kernel.org/r/20240501073238.72769-6-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Notice: this object is not reachable from any branch.
-rw-r--r--drivers/firewire/core-topology.c3
-rw-r--r--include/trace/events/firewire.h28
2 files changed, 30 insertions, 1 deletions
diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c
index f40c8153438121..837cc44d8d9f2a 100644
--- a/drivers/firewire/core-topology.c
+++ b/drivers/firewire/core-topology.c
@@ -20,6 +20,7 @@
#include <asm/byteorder.h>
#include "core.h"
+#include <trace/events/firewire.h>
#define SELF_ID_PHY_ID(q) (((q) >> 24) & 0x3f)
#define SELF_ID_EXTENDED(q) (((q) >> 23) & 0x01)
@@ -507,6 +508,8 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation,
struct fw_node *local_node;
unsigned long flags;
+ trace_bus_reset_handle(generation, node_id, bm_abdicate, self_ids, self_id_count);
+
spin_lock_irqsave(&card->lock, flags);
/*
diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h
index 92bcbe69bb4245..4163959be57af9 100644
--- a/include/trace/events/firewire.h
+++ b/include/trace/events/firewire.h
@@ -204,7 +204,6 @@ DEFINE_EVENT(async_outbound_complete_template, async_response_outbound_complete,
#undef ASYNC_HEADER_GET_SOURCE
#undef ASYNC_HEADER_GET_OFFSET
#undef ASYNC_HEADER_GET_RCODE
-#undef QUADLET_SIZE
TRACE_EVENT(async_phy_outbound_initiate,
TP_PROTO(u64 packet, unsigned int generation, u32 first_quadlet, u32 second_quadlet),
@@ -317,6 +316,33 @@ DEFINE_EVENT(bus_reset_arrange_template, bus_reset_postpone,
TP_ARGS(generation, short_reset)
);
+TRACE_EVENT(bus_reset_handle,
+ TP_PROTO(unsigned int generation, unsigned int node_id, bool bm_abdicate, u32 *self_ids, unsigned int self_id_count),
+ TP_ARGS(generation, node_id, bm_abdicate, self_ids, self_id_count),
+ TP_STRUCT__entry(
+ __field(u8, generation)
+ __field(u8, node_id)
+ __field(bool, bm_abdicate)
+ __dynamic_array(u32, self_ids, self_id_count)
+ ),
+ TP_fast_assign(
+ __entry->generation = generation;
+ __entry->node_id = node_id;
+ __entry->bm_abdicate = bm_abdicate;
+ memcpy(__get_dynamic_array(self_ids), self_ids, __get_dynamic_array_len(self_ids));
+ ),
+ TP_printk(
+ "generation=%u node_id=0x%04x bm_abdicate=%s self_ids=%s",
+ __entry->generation,
+ __entry->node_id,
+ __entry->bm_abdicate ? "true" : "false",
+ __print_array(__get_dynamic_array(self_ids),
+ __get_dynamic_array_len(self_ids) / QUADLET_SIZE, QUADLET_SIZE)
+ )
+);
+
+#undef QUADLET_SIZE
+
#endif // _FIREWIRE_TRACE_EVENT_H
#include <trace/define_trace.h>