linux1394-devel Mailing List for IEEE 1394 for Linux (Page 8)
Brought to you by:
aeb,
bencollins
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
(39) |
Apr
(154) |
May
(172) |
Jun
(237) |
Jul
(127) |
Aug
(135) |
Sep
(193) |
Oct
(175) |
Nov
(173) |
Dec
(148) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(161) |
Feb
(225) |
Mar
(193) |
Apr
(158) |
May
(179) |
Jun
(292) |
Jul
(146) |
Aug
(134) |
Sep
(185) |
Oct
(190) |
Nov
(149) |
Dec
(161) |
2002 |
Jan
(186) |
Feb
(236) |
Mar
(254) |
Apr
(207) |
May
(189) |
Jun
(182) |
Jul
(202) |
Aug
(155) |
Sep
(149) |
Oct
(449) |
Nov
(191) |
Dec
(108) |
2003 |
Jan
(174) |
Feb
(242) |
Mar
(243) |
Apr
(255) |
May
(202) |
Jun
(290) |
Jul
(237) |
Aug
(178) |
Sep
(101) |
Oct
(153) |
Nov
(144) |
Dec
(95) |
2004 |
Jan
(162) |
Feb
(278) |
Mar
(282) |
Apr
(152) |
May
(127) |
Jun
(138) |
Jul
(94) |
Aug
(63) |
Sep
(64) |
Oct
(150) |
Nov
(102) |
Dec
(197) |
2005 |
Jan
(102) |
Feb
(172) |
Mar
(89) |
Apr
(158) |
May
(139) |
Jun
(160) |
Jul
(288) |
Aug
(89) |
Sep
(201) |
Oct
(92) |
Nov
(190) |
Dec
(139) |
2006 |
Jan
(121) |
Feb
(204) |
Mar
(133) |
Apr
(134) |
May
(91) |
Jun
(226) |
Jul
(122) |
Aug
(101) |
Sep
(144) |
Oct
(141) |
Nov
|
Dec
|
2023 |
Jan
(19) |
Feb
(1) |
Mar
(5) |
Apr
(5) |
May
(33) |
Jun
(17) |
Jul
|
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(5) |
Dec
(40) |
2024 |
Jan
(26) |
Feb
(14) |
Mar
(26) |
Apr
(46) |
May
(17) |
Jun
(47) |
Jul
(23) |
Aug
(72) |
Sep
(33) |
Oct
|
Nov
|
Dec
|
From: Takashi S. <o-t...@sa...> - 2024-05-14 10:04:30
|
Hi Linus, Please pull the updates for firewire subsystem to your tree. The following changes since commit dd5a440a31fae6e459c0d6271dddd62825505361: Linux 6.9-rc7 (2024-05-05 14:06:01 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git tags/firewire-updates-6.10 for you to fetch changes up to 21151fd8f0ea5dcff27e8db25b65bf892d408bdc: firewire: obsolete usage of *-objs in Makefile for KUnit test (2024-05-09 08:06:22 +0900) ---------------------------------------------------------------- firewire updates for v6.10 During the development period of v6.8 kernel, it became evident that there was a lack of helper utilities to trace the initial state of bus, while investigating certain PHYs compliant with different versions of IEEE 1394 specification. This series of changes includes the addition of tracepoints events, provided by 'firewire' subsystem. These events enable tracing of how firewire core functions during bus reset and asynchronous communication over IEEE 1394 bus. When implementing the tracepoints events, it was found that the existing serialization and deserialization helpers for several types of asynchronous packets are scattered across both firewire-core and firewire-ohci kernel modules. A set of inline functions is newly added to address it, along with some KUnit tests, serving as the foundation for the tracepoints events. This renders the dispersed code obsolete. The remaining changes constitute the final steps in phasing out the usage of deprecated PCI MSI APIs, in continuation from the previous version. ---------------------------------------------------------------- Adam Goldman (1): firewire: core: option to log bus reset initiation Gustavo A. R. Silva (1): firewire: Annotate struct fw_iso_packet with __counted_by() Takashi Sakamoto (27): Revert "firewire: ohci: use devres for requested IRQ" firewire: ohci: replace request_irq() with request_threaded_irq() firewire: ohci: obsolete usage of deprecated API for MSI firewire: ohci: use pci_irq_vector() to retrieve allocated interrupt line firewire: core: add common inline functions to serialize/deserialize asynchronous packet header firewire: core: replace local macros with common inline functions for asynchronous packet header firewire: ohci: replace local macros with common inline functions for asynchronous packet header firewire: ohci: replace hard-coded values with inline functions for asynchronous packet header firewire: ohci: replace hard-coded values with common macros firewire: core: obsolete tcode check macros with inline functions firewire: core: add common macro to serialize/deserialize isochronous packet header firewire: core: replace local macros with common inline functions for isochronous packet header firewire: core: add support for Linux kernel tracepoints firewire: core: add tracepoints events for asynchronous outbound request firewire: core: add tracepoints event for asynchronous inbound response firewire: core: add tracepoint event for asynchronous inbound request firewire: core: add tracepoints events for asynchronous outbound response firewire: core/cdev: add tracepoints events for asynchronous phy packet firewire: core: add tracepoints event for asynchronous inbound phy packet firewire: ohci: add bus-reset event for initial set of handled irq firewire: ohci: obsolete OHCI_PARAM_DEBUG_BUSRESETS from debug module parameter firewire: core: add tracepoints events for initiating bus reset Revert "firewire: core: option to log bus reset initiation" firewire: core: add tracepoint event for handling bus reset firewire: core: fix type of timestamp for async_inbound_template tracepoints events firewire: core: remove flag and width from u64 formats of tracepoints events firewire: obsolete usage of *-objs in Makefile for KUnit test drivers/firewire/.kunitconfig | 1 + drivers/firewire/Kconfig | 16 ++++++ drivers/firewire/Makefile | 6 +- drivers/firewire/core-card.c | 7 +++ drivers/firewire/core-cdev.c | 7 +++ drivers/firewire/core-topology.c | 3 + drivers/firewire/core-trace.c | 5 ++ drivers/firewire/core-transaction.c | 251 ++++++++++++++++++++++++++++++++++++++++++---------------------------------------- drivers/firewire/core.h | 21 ++++--- drivers/firewire/ohci.c | 131 +++++++++++++++++++++++-------------------- drivers/firewire/packet-header-definitions.h | 234 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/firewire/packet-serdes-test.c | 582 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/firewire.h | 3 +- include/trace/events/firewire.h | 348 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 1420 insertions(+), 195 deletions(-) create mode 100644 drivers/firewire/core-trace.c create mode 100644 drivers/firewire/packet-header-definitions.h create mode 100644 drivers/firewire/packet-serdes-test.c create mode 100644 include/trace/events/firewire.h Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-08 23:22:41
|
On Wed, May 08, 2024 at 07:53:51PM +0900, Takashi Sakamoto wrote: > Nowadays *-objs list is just for user space programs. > > This commit obsolete the usage, and simplify Makefile for firewire KUnit > tests since the tests are not composite objects. > > Signed-off-by: Takashi Sakamoto <o-t...@sa...> > --- > drivers/firewire/Makefile | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/firewire/Makefile b/drivers/firewire/Makefile > index 013e1f2641bd..75c47d046925 100644 > --- a/drivers/firewire/Makefile > +++ b/drivers/firewire/Makefile > @@ -16,8 +16,5 @@ obj-$(CONFIG_FIREWIRE_NET) += firewire-net.o > obj-$(CONFIG_FIREWIRE_NOSY) += nosy.o > obj-$(CONFIG_PROVIDE_OHCI1394_DMA_INIT) += init_ohci1394_dma.o > > -firewire-uapi-test-objs += uapi-test.o > -firewire-packet-serdes-test-objs += packet-serdes-test.o > - > -obj-$(CONFIG_FIREWIRE_KUNIT_UAPI_TEST) += firewire-uapi-test.o > -obj-$(CONFIG_FIREWIRE_KUNIT_PACKET_SERDES_TEST) += firewire-packet-serdes-test.o > +obj-$(CONFIG_FIREWIRE_KUNIT_UAPI_TEST) += uapi-test.o > +obj-$(CONFIG_FIREWIRE_KUNIT_PACKET_SERDES_TEST) += packet-serdes-test.o > -- > 2.43.0 Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-08 10:54:08
|
Nowadays *-objs list is just for user space programs. This commit obsolete the usage, and simplify Makefile for firewire KUnit tests since the tests are not composite objects. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/firewire/Makefile b/drivers/firewire/Makefile index 013e1f2641bd..75c47d046925 100644 --- a/drivers/firewire/Makefile +++ b/drivers/firewire/Makefile @@ -16,8 +16,5 @@ obj-$(CONFIG_FIREWIRE_NET) += firewire-net.o obj-$(CONFIG_FIREWIRE_NOSY) += nosy.o obj-$(CONFIG_PROVIDE_OHCI1394_DMA_INIT) += init_ohci1394_dma.o -firewire-uapi-test-objs += uapi-test.o -firewire-packet-serdes-test-objs += packet-serdes-test.o - -obj-$(CONFIG_FIREWIRE_KUNIT_UAPI_TEST) += firewire-uapi-test.o -obj-$(CONFIG_FIREWIRE_KUNIT_PACKET_SERDES_TEST) += firewire-packet-serdes-test.o +obj-$(CONFIG_FIREWIRE_KUNIT_UAPI_TEST) += uapi-test.o +obj-$(CONFIG_FIREWIRE_KUNIT_PACKET_SERDES_TEST) += packet-serdes-test.o -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-08 09:54:52
|
On Mon, May 06, 2024 at 05:21:54PM +0900, Takashi Sakamoto wrote: > The pointer to fw_packet structure is passed to ring buffer of tracepoints > framework as the value of u64 type. '0x%016llx' is used for the print > format of value, while the flag and width are useless in the case. > > This commit removes them. > > Signed-off-by: Takashi Sakamoto <o-t...@sa...> > --- > include/trace/events/firewire.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h > index 4163959be57a..cd6931b134ee 100644 > --- a/include/trace/events/firewire.h > +++ b/include/trace/events/firewire.h > @@ -221,7 +221,7 @@ TRACE_EVENT(async_phy_outbound_initiate, > __entry->second_quadlet = second_quadlet > ), > TP_printk( > - "packet=0x%016llx generation=%u first_quadlet=0x%08x second_quadlet=0x%08x", > + "packet=0x%llx generation=%u first_quadlet=0x%08x second_quadlet=0x%08x", > __entry->packet, > __entry->generation, > __entry->first_quadlet, > @@ -245,7 +245,7 @@ TRACE_EVENT(async_phy_outbound_complete, > __entry->timestamp = timestamp; > ), > TP_printk( > - "packet=0x%016llx generation=%u status=%u timestamp=0x%04x", > + "packet=0x%llx generation=%u status=%u timestamp=0x%04x", > __entry->packet, > __entry->generation, > __entry->status, > @@ -273,7 +273,7 @@ TRACE_EVENT(async_phy_inbound, > __entry->second_quadlet = second_quadlet > ), > TP_printk( > - "packet=0x%016llx generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x", > + "packet=0x%llx generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x", > __entry->packet, > __entry->generation, > __entry->status, > -- > 2.43.0 Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-08 09:54:32
|
On Mon, May 06, 2024 at 05:21:53PM +0900, Takashi Sakamoto wrote: > The type of time stamp should be u16, instead of u8. > > Signed-off-by: Takashi Sakamoto <o-t...@sa...> > --- > include/trace/events/firewire.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h > index cd6931b134ee..d695a560673f 100644 > --- a/include/trace/events/firewire.h > +++ b/include/trace/events/firewire.h > @@ -106,7 +106,7 @@ DECLARE_EVENT_CLASS(async_inbound_template, > __field(u8, generation) > __field(u8, scode) > __field(u8, status) > - __field(u8, timestamp) > + __field(u16, timestamp) > __array(u32, header, ASYNC_HEADER_QUADLET_COUNT) > __dynamic_array(u32, data, data_count) > ), > -- > 2.43.0 Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-06 08:22:19
|
The pointer to fw_packet structure is passed to ring buffer of tracepoints framework as the value of u64 type. '0x%016llx' is used for the print format of value, while the flag and width are useless in the case. This commit removes them. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- include/trace/events/firewire.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h index 4163959be57a..cd6931b134ee 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -221,7 +221,7 @@ TRACE_EVENT(async_phy_outbound_initiate, __entry->second_quadlet = second_quadlet ), TP_printk( - "packet=0x%016llx generation=%u first_quadlet=0x%08x second_quadlet=0x%08x", + "packet=0x%llx generation=%u first_quadlet=0x%08x second_quadlet=0x%08x", __entry->packet, __entry->generation, __entry->first_quadlet, @@ -245,7 +245,7 @@ TRACE_EVENT(async_phy_outbound_complete, __entry->timestamp = timestamp; ), TP_printk( - "packet=0x%016llx generation=%u status=%u timestamp=0x%04x", + "packet=0x%llx generation=%u status=%u timestamp=0x%04x", __entry->packet, __entry->generation, __entry->status, @@ -273,7 +273,7 @@ TRACE_EVENT(async_phy_inbound, __entry->second_quadlet = second_quadlet ), TP_printk( - "packet=0x%016llx generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x", + "packet=0x%llx generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x", __entry->packet, __entry->generation, __entry->status, -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-06 08:22:09
|
The type of time stamp should be u16, instead of u8. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- include/trace/events/firewire.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h index cd6931b134ee..d695a560673f 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -106,7 +106,7 @@ DECLARE_EVENT_CLASS(async_inbound_template, __field(u8, generation) __field(u8, scode) __field(u8, status) - __field(u8, timestamp) + __field(u16, timestamp) __array(u32, header, ASYNC_HEADER_QUADLET_COUNT) __dynamic_array(u32, data, data_count) ), -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-02 12:13:42
|
Hi, On Wed, May 01, 2024 at 11:17:44AM -0400, Thanassis Avgerinos wrote: > Perfect, thank you for the update and getting the fix in Takashi! > > Who would be the right person to contact to get a CVE number for this issue > and track remediation downstream? I'm sorry but I scarcely know the CVE process in kernel development. I think that the entry point is to refer to documentation about it[1], recently added to kernel tree. Jonathan Corbet wrote an article about the kernel CNA[2]. It would be a good resource to you. [1] https://docs.kernel.org/process/cve.html [2] https://lwn.net/Articles/961978/ Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-02 12:07:15
|
Hi Linus, The following changes since commit e67572cd2204894179d89bd7b984072f19313b03: Linux 6.9-rc6 (2024-04-28 13:47:24 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git tags/firewire-fixes-6.9-rc6 for you to fetch changes up to 09773bf55aeabe3fd61745d900798dc1272c778a: firewire: ohci: fulfill timestamp for some local asynchronous transaction (2024-04-29 18:41:00 +0900) ---------------------------------------------------------------- firewire: fixes for v6.9-rc6 The following two driver fixes: * The firewire-ohci driver for 1394 OHCI hardware does not fill time stamp for response packet when handling asynchronous transaction to local destination. This brings an inconvenience that the response packet is not equivalent between the transaction to local and remote. It is fixed by fulfilling the time stamp with hardware time. The fix should be applied to Linux kernel v6.5 or later as well. * The nosy driver for Texas Instruments TSB12LV21A (PCILynx) has long-standing issue about the behaviour when user space application passes less size of buffer than expected. It is fixed by returning zero according to the convention of UNIX-like systems. ---------------------------------------------------------------- Takashi Sakamoto (1): firewire: ohci: fulfill timestamp for some local asynchronous transaction Thanassis Avgerinos (1): firewire: nosy: ensure user_length is taken into account when fetching packet contents drivers/firewire/nosy.c | 6 ++++-- drivers/firewire/ohci.c | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-01 23:19:41
|
Hi Adam, On Wed, May 01, 2024 at 04:39:23AM -0700, Adam Goldman wrote: > Hi Takashi, > > On Mon, Apr 01, 2024 at 09:18:00PM +0900, Takashi Sakamoto wrote: > > I sent an additional patch[1] to handle the bus-reset event at the first > > time. I'd like you to review and test it as well, especially under your > > environment in which 1394:1995 and 1394a phys exist. > > > > [1] https://lore.kernel.org/lkml/202...@sa.../ > > I'm sorry for another very late reply. > > Now that we eliminated the IRQ storm, it makes sense to always enable > the bus-reset interrupt at startup. I tested your patch with various > devices, with a FW800 repeater, with a FW400 hub, without a hub, etc. > Everything works OK. However, I only tested with XIO2213B OHCI. > > -- Adam Thanks for your test. The content of patch is equivalent to the first one in the candidate series[1], so I appended Tested-by tag when applying to for-next branch. The for-next branch includes the commits to provide the following tracepoints events: * firewire:async_request_outbound_initiate * firewire:async_request_outbound_complete * firewire:async_response_inbound * firewire:async_request_inbound * firewire:async_response_outbound_initiate * firewire:async_response_outbound_complete * firewire:async_phy_outbound_initiate * firewire:async_phy_outbound_complete * firewire:async_phy_inbound * firewire:bus_reset_initiate * firewire:bus_reset_schedule * firewire:bus_reset_postpone * firewire:bus_reset_handle All of them are used to trace the action of firewire core function, instead of 1394 OHCI driver. I think they are helpful to debug the kind of issue which we handled for v6.8 kernel. [1] https://lore.kernel.org/lkml/202...@sa.../ Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-01 23:14:23
|
Hi, On Wed, May 01, 2024 at 04:32:33PM +0900, Takashi Sakamoto wrote: > Hi, > > IEEE 1394 bus is under bus-reset state when the physical state of bus is > changed; e.g. bus topology change by adding new nodes in the bus. It is > important to handle the state appropriately for the maintenance of bus. > > This series of change adds some tracepoints events to trace the events > related to bus-reset. Some kernel log messages are obsoleted and > deleted. It also includes for 1394 OHCI driver so that bus-reset IRQ > event is recorded as much as possible, and obsoletes bus-resets bit > from debug parameter successfully. > > Takashi Sakamoto (5): > firewire: ohci: add bus-reset event for initial set of handled irq > firewire: ohci: obsolete OHCI_PARAM_DEBUG_BUSRESETS from debug module > parameter > firewire: core: add tracepoints events for initiating bus reset > Revert "firewire: core: option to log bus reset initiation" > firewire: core: add tracepoint event for handling bus reset > > drivers/firewire/core-card.c | 13 +++--- > drivers/firewire/core-topology.c | 3 ++ > drivers/firewire/core-transaction.c | 7 ---- > drivers/firewire/core.h | 4 -- > drivers/firewire/ohci.c | 18 +++------ > include/trace/events/firewire.h | 61 ++++++++++++++++++++++++++++- > 6 files changed, 73 insertions(+), 33 deletions(-) Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-05-01 07:33:32
|
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. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-topology.c | 3 +++ include/trace/events/firewire.h | 28 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c index f40c81534381..837cc44d8d9f 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 92bcbe69bb42..4163959be57a 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> -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-01 07:33:30
|
This reverts commit 6732491243045f5a7e1995b4be5f3c964b579ebd. The former commit adds some alternative tracepoints events to replace the reverted kernel log messages. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-card.c | 10 ---------- drivers/firewire/core-transaction.c | 7 ------- drivers/firewire/core.h | 4 ---- 3 files changed, 21 deletions(-) diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 5d43acf45a7d..127d87e3a153 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c @@ -224,10 +224,6 @@ static int reset_bus(struct fw_card *card, bool short_reset) trace_bus_reset_initiate(card->generation, short_reset); - if (unlikely(fw_core_param_debug & FW_CORE_PARAM_DEBUG_BUSRESETS)) - fw_notice(card, "initiating %s bus reset\n", - short_reset ? "short" : "long"); - return card->driver->update_phy_reg(card, reg, 0, bit); } @@ -235,10 +231,6 @@ void fw_schedule_bus_reset(struct fw_card *card, bool delayed, bool short_reset) { trace_bus_reset_schedule(card->generation, short_reset); - if (unlikely(fw_core_param_debug & FW_CORE_PARAM_DEBUG_BUSRESETS)) - fw_notice(card, "scheduling %s bus reset\n", - short_reset ? "short" : "long"); - /* We don't try hard to sort out requests of long vs. short resets. */ card->br_short = short_reset; @@ -259,8 +251,6 @@ static void br_work(struct work_struct *work) time_before64(get_jiffies_64(), card->reset_jiffies + 2 * HZ)) { trace_bus_reset_postpone(card->generation, card->br_short); - if (unlikely(fw_core_param_debug & FW_CORE_PARAM_DEBUG_BUSRESETS)) - fw_notice(card, "delaying bus reset\n"); if (!queue_delayed_work(fw_workqueue, &card->br_work, 2 * HZ)) fw_card_put(card); return; diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index d3eefbf23663..571fdff65c2b 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -1390,12 +1390,5 @@ static void __exit fw_core_cleanup(void) idr_destroy(&fw_device_idr); } -int fw_core_param_debug; -module_param_named(debug, fw_core_param_debug, int, 0644); -MODULE_PARM_DESC(debug, "Verbose logging (default = 0" - ", bus resets = " __stringify(FW_CORE_PARAM_DEBUG_BUSRESETS) - ")"); - - module_init(fw_core_init); module_exit(fw_core_cleanup); diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h index 5097c7a270b4..7c36d2628e37 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h @@ -245,10 +245,6 @@ static inline bool tcode_is_link_internal(unsigned int tcode) /* OHCI-1394's default upper bound for physical DMA: 4 GB */ #define FW_MAX_PHYSICAL_RANGE (1ULL << 32) -#define FW_CORE_PARAM_DEBUG_BUSRESETS 1 - -extern int fw_core_param_debug; - void fw_core_handle_request(struct fw_card *card, struct fw_packet *request); void fw_core_handle_response(struct fw_card *card, struct fw_packet *packet); int fw_get_response_length(struct fw_request *request); -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-01 07:33:23
|
In the former commits, the spurious interrupt events are suppressed as possible, by unset bus-reset event from the set of handled irq. The change was written with the less-intrusive style, thus it firstly works at the second time to handle the event. But it is slightly inconvenient. This commit adds the event for the initial set of irq to handle. As a result, the event can be handled even if it is the first time. The change has a benefit that the OHCI_PARAM_DEBUG_BUSRESETS bit in debug module parameter is always effective. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 6116153f0ce6..d69629d8ba71 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -394,7 +394,7 @@ MODULE_PARM_DESC(quirks, "Chip quirks (default = 0" #define OHCI_PARAM_DEBUG_AT_AR 1 #define OHCI_PARAM_DEBUG_SELFIDS 2 #define OHCI_PARAM_DEBUG_IRQS 4 -#define OHCI_PARAM_DEBUG_BUSRESETS 8 /* only effective before chip init */ +#define OHCI_PARAM_DEBUG_BUSRESETS 8 static int param_debug; module_param_named(debug, param_debug, int, 0644); @@ -2062,8 +2062,7 @@ static void bus_reset_work(struct work_struct *work) ohci->generation = generation; reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset); - if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS) - reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); + reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset); if (ohci->quirks & QUIRK_RESET_PACKET) ohci->request_generation = generation; @@ -2135,6 +2134,7 @@ static irqreturn_t irq_handler(int irq, void *data) reg_write(ohci, OHCI1394_IntEventClear, event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr)); log_irqs(ohci, event); + // The flag is masked again at bus_reset_work() scheduled by selfID event. if (event & OHCI1394_busReset) reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset); @@ -2474,9 +2474,8 @@ static int ohci_enable(struct fw_card *card, OHCI1394_cycleInconsistent | OHCI1394_unrecoverableError | OHCI1394_cycleTooLong | - OHCI1394_masterIntEnable; - if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS) - irqs |= OHCI1394_busReset; + OHCI1394_masterIntEnable | + OHCI1394_busReset; reg_write(ohci, OHCI1394_IntMaskSet, irqs); reg_write(ohci, OHCI1394_HCControlSet, -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-01 07:33:22
|
At a commit 673249124304 ("firewire: core: option to log bus reset initiation"), some kernel log messages were added to trace initiation of bus reset. The kernel log messages are really helpful, while nowadays it is not preferable just for debugging purpose. For the purpose, Linux kernel tracepoints is more preferable. This commit adds some alternative tracepoints events. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-card.c | 7 +++++++ include/trace/events/firewire.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index dac1b0fc7a42..5d43acf45a7d 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c @@ -23,6 +23,7 @@ #include <asm/byteorder.h> #include "core.h" +#include <trace/events/firewire.h> #define define_fw_printk_level(func, kern_level) \ void func(const struct fw_card *card, const char *fmt, ...) \ @@ -221,6 +222,8 @@ static int reset_bus(struct fw_card *card, bool short_reset) int reg = short_reset ? 5 : 1; int bit = short_reset ? PHY_BUS_SHORT_RESET : PHY_BUS_RESET; + trace_bus_reset_initiate(card->generation, short_reset); + if (unlikely(fw_core_param_debug & FW_CORE_PARAM_DEBUG_BUSRESETS)) fw_notice(card, "initiating %s bus reset\n", short_reset ? "short" : "long"); @@ -230,6 +233,8 @@ static int reset_bus(struct fw_card *card, bool short_reset) void fw_schedule_bus_reset(struct fw_card *card, bool delayed, bool short_reset) { + trace_bus_reset_schedule(card->generation, short_reset); + if (unlikely(fw_core_param_debug & FW_CORE_PARAM_DEBUG_BUSRESETS)) fw_notice(card, "scheduling %s bus reset\n", short_reset ? "short" : "long"); @@ -252,6 +257,8 @@ static void br_work(struct work_struct *work) /* Delay for 2s after last reset per IEEE 1394 clause 8.2.1. */ if (card->reset_jiffies != 0 && time_before64(get_jiffies_64(), card->reset_jiffies + 2 * HZ)) { + trace_bus_reset_postpone(card->generation, card->br_short); + if (unlikely(fw_core_param_debug & FW_CORE_PARAM_DEBUG_BUSRESETS)) fw_notice(card, "delaying bus reset\n"); if (!queue_delayed_work(fw_workqueue, &card->br_work, 2 * HZ)) diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h index db49b9828bd1..92bcbe69bb42 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -284,6 +284,39 @@ TRACE_EVENT(async_phy_inbound, ) ); +DECLARE_EVENT_CLASS(bus_reset_arrange_template, + TP_PROTO(unsigned int generation, bool short_reset), + TP_ARGS(generation, short_reset), + TP_STRUCT__entry( + __field(u8, generation) + __field(bool, short_reset) + ), + TP_fast_assign( + __entry->generation = generation; + __entry->short_reset = short_reset; + ), + TP_printk( + "generation=%u short_reset=%s", + __entry->generation, + __entry->short_reset ? "true" : "false" + ) +); + +DEFINE_EVENT(bus_reset_arrange_template, bus_reset_initiate, + TP_PROTO(unsigned int generation, bool short_reset), + TP_ARGS(generation, short_reset) +); + +DEFINE_EVENT(bus_reset_arrange_template, bus_reset_schedule, + TP_PROTO(unsigned int generation, bool short_reset), + TP_ARGS(generation, short_reset) +); + +DEFINE_EVENT(bus_reset_arrange_template, bus_reset_postpone, + TP_PROTO(unsigned int generation, bool short_reset), + TP_ARGS(generation, short_reset) +); + #endif // _FIREWIRE_TRACE_EVENT_H #include <trace/define_trace.h> -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-01 07:33:21
|
The OHCI_PARAM_DEBUG_BUSRESETS bit of debug module parameter was added at a commit a007bb857e0b ("firewire: fw-ohci: conditionally log busReset interrupts"). At the former commit, the bit becomes less meaningful, just to skip logging. This commit obsoletes it. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index d69629d8ba71..93dca3216e45 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -394,7 +394,6 @@ MODULE_PARM_DESC(quirks, "Chip quirks (default = 0" #define OHCI_PARAM_DEBUG_AT_AR 1 #define OHCI_PARAM_DEBUG_SELFIDS 2 #define OHCI_PARAM_DEBUG_IRQS 4 -#define OHCI_PARAM_DEBUG_BUSRESETS 8 static int param_debug; module_param_named(debug, param_debug, int, 0644); @@ -402,7 +401,6 @@ MODULE_PARM_DESC(debug, "Verbose logging (default = 0" ", AT/AR events = " __stringify(OHCI_PARAM_DEBUG_AT_AR) ", self-IDs = " __stringify(OHCI_PARAM_DEBUG_SELFIDS) ", IRQs = " __stringify(OHCI_PARAM_DEBUG_IRQS) - ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) ", or a combination, or all = -1)"); static bool param_remote_dma; @@ -411,12 +409,7 @@ MODULE_PARM_DESC(remote_dma, "Enable unfiltered remote DMA (default = N)"); static void log_irqs(struct fw_ohci *ohci, u32 evt) { - if (likely(!(param_debug & - (OHCI_PARAM_DEBUG_IRQS | OHCI_PARAM_DEBUG_BUSRESETS)))) - return; - - if (!(param_debug & OHCI_PARAM_DEBUG_IRQS) && - !(evt & OHCI1394_busReset)) + if (likely(!(param_debug & OHCI_PARAM_DEBUG_IRQS))) return; ohci_notice(ohci, "IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-05-01 07:32:56
|
Hi, IEEE 1394 bus is under bus-reset state when the physical state of bus is changed; e.g. bus topology change by adding new nodes in the bus. It is important to handle the state appropriately for the maintenance of bus. This series of change adds some tracepoints events to trace the events related to bus-reset. Some kernel log messages are obsoleted and deleted. It also includes for 1394 OHCI driver so that bus-reset IRQ event is recorded as much as possible, and obsoletes bus-resets bit from debug parameter successfully. Takashi Sakamoto (5): firewire: ohci: add bus-reset event for initial set of handled irq firewire: ohci: obsolete OHCI_PARAM_DEBUG_BUSRESETS from debug module parameter firewire: core: add tracepoints events for initiating bus reset Revert "firewire: core: option to log bus reset initiation" firewire: core: add tracepoint event for handling bus reset drivers/firewire/core-card.c | 13 +++--- drivers/firewire/core-topology.c | 3 ++ drivers/firewire/core-transaction.c | 7 ---- drivers/firewire/core.h | 4 -- drivers/firewire/ohci.c | 18 +++------ include/trace/events/firewire.h | 61 ++++++++++++++++++++++++++++- 6 files changed, 73 insertions(+), 33 deletions(-) -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-04-30 13:11:14
|
On Tue, Apr 30, 2024 at 09:14:02AM +0900, Takashi Sakamoto wrote: > Hi, > > In IEEE 1394 bus, the type of asynchronous packet without any offset to > node address space is called as phy packet. The destination of packet is > IEEE 1394 phy itself. This type of packet is used for several purposes, > mainly for selfID at the state of bus reset, to force selection of root > node, and to adjust gap count. > > This series of changes is to add tracepoints events for this kind of > asynchronous packets. > > Takashi Sakamoto (2): > firewire: core/cdev: add tracepoints events for asynchronous phy > packet > firewire: core: add tracepoints event for asynchronous inbound phy > packet > > drivers/firewire/core-cdev.c | 7 +++ > drivers/firewire/core-transaction.c | 8 +++ > include/trace/events/firewire.h | 78 +++++++++++++++++++++++++++++ > 3 files changed, 93 insertions(+) Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-04-30 00:14:24
|
At the former commit, a pair of tracepoints events is added to trace asynchronous outbound phy packet. This commit adds a tracepoints event to trace inbound phy packet. It includes transaction status as well as the content of phy packet. This is an example for Remote Reply Packet as a response to Remote Access Packet sent by lsfirewirephy command in linux-firewire-utils: async_phy_inbound: \ packet=0xffff955fc02b4e10 generation=1 status=1 timestamp=0x0619 \ first_quadlet=0x001c8208 second_quadlet=0xffe37df7 Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-transaction.c | 2 ++ include/trace/events/firewire.h | 30 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index a828b7167d15..d3eefbf23663 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -995,6 +995,8 @@ void fw_core_handle_request(struct fw_card *card, struct fw_packet *p) tcode = async_header_get_tcode(p->header); if (tcode_is_link_internal(tcode)) { + trace_async_phy_inbound((uintptr_t)p, p->generation, p->ack, p->timestamp, + p->header[1], p->header[2]); fw_cdev_handle_phy_packet(card, p); return; } diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h index 3ade7d4b9268..db49b9828bd1 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -254,6 +254,36 @@ TRACE_EVENT(async_phy_outbound_complete, ) ); +TRACE_EVENT(async_phy_inbound, + TP_PROTO(u64 packet, unsigned int generation, unsigned int status, unsigned int timestamp, u32 first_quadlet, u32 second_quadlet), + TP_ARGS(packet, generation, status, timestamp, first_quadlet, second_quadlet), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, generation) + __field(u8, status) + __field(u16, timestamp) + __field(u32, first_quadlet) + __field(u32, second_quadlet) + ), + TP_fast_assign( + __entry->packet = packet; + __entry->generation = generation; + __entry->status = status; + __entry->timestamp = timestamp; + __entry->first_quadlet = first_quadlet; + __entry->second_quadlet = second_quadlet + ), + TP_printk( + "packet=0x%016llx generation=%u status=%u timestamp=0x%04x first_quadlet=0x%08x second_quadlet=0x%08x", + __entry->packet, + __entry->generation, + __entry->status, + __entry->timestamp, + __entry->first_quadlet, + __entry->second_quadlet + ) +); + #endif // _FIREWIRE_TRACE_EVENT_H #include <trace/define_trace.h> -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-04-30 00:14:20
|
Hi, In IEEE 1394 bus, the type of asynchronous packet without any offset to node address space is called as phy packet. The destination of packet is IEEE 1394 phy itself. This type of packet is used for several purposes, mainly for selfID at the state of bus reset, to force selection of root node, and to adjust gap count. This series of changes is to add tracepoints events for this kind of asynchronous packets. Takashi Sakamoto (2): firewire: core/cdev: add tracepoints events for asynchronous phy packet firewire: core: add tracepoints event for asynchronous inbound phy packet drivers/firewire/core-cdev.c | 7 +++ drivers/firewire/core-transaction.c | 8 +++ include/trace/events/firewire.h | 78 +++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-04-30 00:14:17
|
In IEEE 1394 bus, the type of asynchronous packet without any offset to node address space is called as phy packet. The destination of packet is IEEE 1394 phy itself. This type of packet is used for several purposes, mainly for selfID at the state of bus reset, to force selection of root node, and to adjust gap count. This commit adds tracepoints events for the type of asynchronous outbound packet. Like asynchronous outbound transaction packets, a pair of events are added to trace initiation and completion of transmission. In the case that the phy packet is sent by kernel API, the match between the initiation and completion is not so easy, since the data of 'struct fw_packet' is allocated statically. In the case that it is sent by userspace applications via cdev, the match is easy, since the data is allocated per each. This example is for Remote Access Packet by lsfirewirephy command in linux-firewire-utils: async_phy_outbound_initiate: \ packet=0xffff89fb34e42e78 generation=1 first_quadlet=0x00148200 \ second_quadlet=0xffeb7dff async_phy_outbound_complete: \ packet=0xffff89fb34e42e78 generation=1 status=1 timestamp=0x0619 Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-cdev.c | 7 +++++ drivers/firewire/core-transaction.c | 6 ++++ include/trace/events/firewire.h | 48 +++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 6274b86eb943..55993c9e0b90 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -35,6 +35,7 @@ #include "core.h" +#include <trace/events/firewire.h> /* * ABI version history is documented in linux/firewire-cdev.h. @@ -1558,6 +1559,9 @@ static void outbound_phy_packet_callback(struct fw_packet *packet, struct client *e_client = e->client; u32 rcode; + trace_async_phy_outbound_complete((uintptr_t)packet, status, packet->generation, + packet->timestamp); + switch (status) { // expected: case ACK_COMPLETE: @@ -1655,6 +1659,9 @@ static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg) memcpy(pp->data, a->data, sizeof(a->data)); } + trace_async_phy_outbound_initiate((uintptr_t)&e->p, e->p.generation, e->p.header[1], + e->p.header[2]); + card->driver->send_request(card, &e->p); return 0; diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 0e49ebf52500..a828b7167d15 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -463,6 +463,8 @@ static DECLARE_COMPLETION(phy_config_done); static void transmit_phy_packet_callback(struct fw_packet *packet, struct fw_card *card, int status) { + trace_async_phy_outbound_complete((uintptr_t)packet, packet->generation, status, + packet->timestamp); complete(&phy_config_done); } @@ -501,6 +503,10 @@ void fw_send_phy_config(struct fw_card *card, phy_config_packet.generation = generation; reinit_completion(&phy_config_done); + trace_async_phy_outbound_initiate((uintptr_t)&phy_config_packet, + phy_config_packet.generation, phy_config_packet.header[1], + phy_config_packet.header[2]); + card->driver->send_request(card, &phy_config_packet); wait_for_completion_timeout(&phy_config_done, timeout); diff --git a/include/trace/events/firewire.h b/include/trace/events/firewire.h index d4688e341837..3ade7d4b9268 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -206,6 +206,54 @@ DEFINE_EVENT(async_outbound_complete_template, async_response_outbound_complete, #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), + TP_ARGS(packet, generation, first_quadlet, second_quadlet), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, generation) + __field(u32, first_quadlet) + __field(u32, second_quadlet) + ), + TP_fast_assign( + __entry->packet = packet; + __entry->generation = generation; + __entry->first_quadlet = first_quadlet; + __entry->second_quadlet = second_quadlet + ), + TP_printk( + "packet=0x%016llx generation=%u first_quadlet=0x%08x second_quadlet=0x%08x", + __entry->packet, + __entry->generation, + __entry->first_quadlet, + __entry->second_quadlet + ) +); + +TRACE_EVENT(async_phy_outbound_complete, + TP_PROTO(u64 packet, unsigned int generation, unsigned int status, unsigned int timestamp), + TP_ARGS(packet, generation, status, timestamp), + TP_STRUCT__entry( + __field(u64, packet) + __field(u8, generation) + __field(u8, status) + __field(u16, timestamp) + ), + TP_fast_assign( + __entry->packet = packet; + __entry->generation = generation; + __entry->status = status; + __entry->timestamp = timestamp; + ), + TP_printk( + "packet=0x%016llx generation=%u status=%u timestamp=0x%04x", + __entry->packet, + __entry->generation, + __entry->status, + __entry->timestamp + ) +); + #endif // _FIREWIRE_TRACE_EVENT_H #include <trace/define_trace.h> -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-04-29 23:03:43
|
On Mon, Apr 29, 2024 at 01:32:13PM +0900, Takashi Sakamoto wrote: > Hi, > > The series of changes in this patchse is to revise the previous RFC: > https://lore.kernel.org/lkml/202...@sa.../ > > In a view of IEEE 1394 bus, the main function of kernel core is to > provide transaction service to the bus. It is helpful to have some > mechanisms to trace any action of the service. > > This series of changes adds some tracepoints events for the purpose. > It adds the following tracepoints events via 'firewire' subsystem: > > * For outbound transactions (e.g. initiated by user process) > * async_request_outbound_initiate > * async_request_outbound_complete > * async_response_inbound > * For inbound transactions (e.g. initiated by the other nodes in the bus) > * async_request_inbound > * async_response_outbound_initiate > * async_response_outbound_complete > > When probing these tracepoints events, the content of 'struct fw_packet' > passed between the core function and 1394 OHCI driver is recorded with > the fields of header and packet data. For example of the outbound > split transaction: > > async_request_outbound_initiate: \ > transaction=0xffff955fc6a07b30 generation=5 scode=2 dst_id=0xffc0 \ > tlabel=18 tcode=9 src_id=0xffc1 offset=0xfffff0000984 \ > header={0xffc04990,0xffc1ffff,0xf0000984,0x80002} data={0x81,0x80} > async_request_outbound_complete: \ > transaction=0xffff955fc6a07b30 generation=5 scode=2 status=2 \ > timestamp=0xeabf > async_response_inbound: \ > transaction=0xffff955fc6a07b30 generation=5 scode=2 status=1 \ > timestamp=0xeac2 dst_id=0xffc1 tlabel=18 tcode=11 src_id=0xffc0 \ > rcode=0 header={0xffc149b0,0xffc00000,0x0,0x40002} data={0x81} > > Takashi Sakamoto (5): > firewire: core: add support for Linux kernel tracepoints > firewire: core: add tracepoints events for asynchronous outbound > request > firewire: core: add tracepoints event for asynchronous inbound > response > firewire: core: add tracepoint event for asynchronous inbound request > firewire: core: add tracepoints events for asynchronous outbound > response > > drivers/firewire/Makefile | 2 +- > drivers/firewire/core-trace.c | 5 + > drivers/firewire/core-transaction.c | 93 +++++++----- > include/trace/events/firewire.h | 211 ++++++++++++++++++++++++++++ > 4 files changed, 276 insertions(+), 35 deletions(-) > create mode 100644 drivers/firewire/core-trace.c > create mode 100644 include/trace/events/firewire.h Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-04-29 22:59:47
|
On Mon, Apr 29, 2024 at 05:47:08PM +0900, Takashi Sakamoto wrote: > 1394 OHCI driver generates packet data for the response subaction to the > request subaction to some local registers. In the case, the driver should > assign timestamp to them by itself. > > This commit fulfills the timestamp for the subaction. > > Cc: st...@vg... > Fixes: dcadfd7f7c74 ("firewire: core: use union for callback of transaction completion") > Signed-off-by: Takashi Sakamoto <o-t...@sa...> > --- > drivers/firewire/ohci.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) Applied to for-linus branch. I'll send it to mainline as the fix for v6.9-rc7 kernel. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-04-29 09:42:36
|
Hi, On Thu, Apr 18, 2024 at 11:18:08AM -0400, Thanassis Avgerinos wrote: > Resending as I forgot to reply-all. > > Best, > Thanassis I'm sorry for my late reply. I applied the patch to for-linus branch. I'll send it as the part of fixes for v6.9-rc7 in this weekend. Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-04-29 08:47:22
|
1394 OHCI driver generates packet data for the response subaction to the request subaction to some local registers. In the case, the driver should assign timestamp to them by itself. This commit fulfills the timestamp for the subaction. Cc: st...@vg... Fixes: dcadfd7f7c74 ("firewire: core: use union for callback of transaction completion") Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 38d19410a2be..b9ae0340b8a7 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -1556,6 +1556,8 @@ static int handle_at_packet(struct context *context, #define HEADER_GET_DATA_LENGTH(q) (((q) >> 16) & 0xffff) #define HEADER_GET_EXTENDED_TCODE(q) (((q) >> 0) & 0xffff) +static u32 get_cycle_time(struct fw_ohci *ohci); + static void handle_local_rom(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr) { @@ -1580,6 +1582,8 @@ static void handle_local_rom(struct fw_ohci *ohci, (void *) ohci->config_rom + i, length); } + // Timestamping on behalf of the hardware. + response.timestamp = cycle_time_to_ohci_tstamp(get_cycle_time(ohci)); fw_core_handle_response(&ohci->card, &response); } @@ -1628,6 +1632,8 @@ static void handle_local_lock(struct fw_ohci *ohci, fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0); out: + // Timestamping on behalf of the hardware. + response.timestamp = cycle_time_to_ohci_tstamp(get_cycle_time(ohci)); fw_core_handle_response(&ohci->card, &response); } @@ -1670,8 +1676,6 @@ static void handle_local_request(struct context *ctx, struct fw_packet *packet) } } -static u32 get_cycle_time(struct fw_ohci *ohci); - static void at_context_transmit(struct context *ctx, struct fw_packet *packet) { unsigned long flags; -- 2.43.0 |