Skip to content

Commit 8326f5e

Browse files
committed
Merge tag 'firewire-updates-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull firewire updates from Takashi Sakamoto: "There are many lines of changes for FireWire subsystem, but there is practically no functional change. Most of the changes are for code refactoring, some KUnit tests to added helper functions, and new tracepoints events for both the core functions and 1394 OHCI driver. The tracepoints events now cover the verbose logging enabled by debug parameter of firewire-ohci kernel module. The parameter would be removed in any future timing, thus it is now deprecated" * tag 'firewire-updates-6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: (32 commits) firewire: core: move copy_port_status() helper function to TP_fast_assign() block Revert "firewire: ohci: use common macro to interpret be32 data in le32 buffer" firewire: ohci: add tracepoints event for data of Self-ID DMA firewire: ohci: use inline functions to operate data of self-ID DMA firewire: ohci: add static inline functions to deserialize for Self-ID DMA operation firewire: ohci: use static function to handle endian issue on PowerPC platform firewire: ohci: use common macro to interpret be32 data in le32 buffer firewire: core: Fix spelling mistakes in tracepoint messages firewire: ohci: add tracepoints event for hardIRQ event firewire: ohci: add support for Linux kernel tracepoints firewire: core: add tracepoints events for completions of packets in isochronous context firewire: core: add tracepoints events for queueing packets of isochronous context firewire: core: add tracepoints events for flushing completions of isochronous context firewire: core: add tracepoints events for flushing of isochronous context firewire: core: add tracepoints events for starting/stopping of isochronous context firewire: core: add tracepoints events for setting channels of multichannel context firewire: core: add tracepoints events for allocation/deallocation of isochronous context firewire: core: undefine macros after use in tracepoints events firewire: core: record card index in tracepoints event for self ID sequence firewire: core: use inline helper functions to serialize phy config packet ...
2 parents 13a7871 + 06dcc4c commit 8326f5e

16 files changed

+1867
-222
lines changed

drivers/firewire/.kunitconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ CONFIG_FIREWIRE=y
44
CONFIG_FIREWIRE_KUNIT_UAPI_TEST=y
55
CONFIG_FIREWIRE_KUNIT_DEVICE_ATTRIBUTE_TEST=y
66
CONFIG_FIREWIRE_KUNIT_PACKET_SERDES_TEST=y
7+
CONFIG_FIREWIRE_KUNIT_SELF_ID_SEQUENCE_HELPER_TEST=y
8+
CONFIG_FIREWIRE_KUNIT_OHCI_SERDES_TEST=y

drivers/firewire/Kconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ config FIREWIRE_KUNIT_PACKET_SERDES_TEST
6666
For more information on KUnit and unit tests in general, refer
6767
to the KUnit documentation in Documentation/dev-tools/kunit/.
6868

69+
config FIREWIRE_KUNIT_SELF_ID_SEQUENCE_HELPER_TEST
70+
tristate "KUnit tests for helpers of self ID sequence" if !KUNIT_ALL_TESTS
71+
depends on FIREWIRE && KUNIT
72+
default KUNIT_ALL_TESTS
73+
help
74+
This builds the KUnit tests for helpers of self ID sequence.
75+
76+
KUnit tests run during boot and output the results to the debug
77+
log in TAP format (https://testanything.org/). Only useful for
78+
kernel devs running KUnit test harness and are not for inclusion
79+
into a production build.
80+
81+
For more information on KUnit and unit tests in general, refer
82+
to the KUnit documentation in Documentation/dev-tools/kunit/.
83+
6984
config FIREWIRE_OHCI
7085
tristate "OHCI-1394 controllers"
7186
depends on PCI && FIREWIRE && MMU
@@ -77,6 +92,22 @@ config FIREWIRE_OHCI
7792
To compile this driver as a module, say M here: The module will be
7893
called firewire-ohci.
7994

95+
config FIREWIRE_KUNIT_OHCI_SERDES_TEST
96+
tristate "KUnit tests for serialization/deserialization of data in buffers/registers" if !KUNIT_ALL_TESTS
97+
depends on FIREWIRE && KUNIT
98+
default KUNIT_ALL_TESTS
99+
help
100+
This builds the KUnit tests to check serialization and deserialization
101+
of data in buffers and registers defined in 1394 OHCI specification.
102+
103+
KUnit tests run during boot and output the results to the debug
104+
log in TAP format (https://testanything.org/). Only useful for
105+
kernel devs running KUnit test harness and are not for inclusion
106+
into a production build.
107+
108+
For more information on KUnit and unit tests in general, refer
109+
to the KUnit documentation in Documentation/dev-tools/kunit/.
110+
80111
config FIREWIRE_SBP2
81112
tristate "Storage devices (SBP-2 protocol)"
82113
depends on FIREWIRE && SCSI

drivers/firewire/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ obj-$(CONFIG_PROVIDE_OHCI1394_DMA_INIT) += init_ohci1394_dma.o
1818

1919
obj-$(CONFIG_FIREWIRE_KUNIT_UAPI_TEST) += uapi-test.o
2020
obj-$(CONFIG_FIREWIRE_KUNIT_PACKET_SERDES_TEST) += packet-serdes-test.o
21+
obj-$(CONFIG_FIREWIRE_KUNIT_SELF_ID_SEQUENCE_HELPER_TEST) += self-id-sequence-helper-test.o
22+
obj-$(CONFIG_FIREWIRE_KUNIT_OHCI_SERDES_TEST) += ohci-serdes-test.o

drivers/firewire/core-iso.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include "core.h"
2424

25+
#include <trace/events/firewire.h>
26+
2527
/*
2628
* Isochronous DMA context management
2729
*/
@@ -148,25 +150,39 @@ struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
148150
ctx->callback.sc = callback;
149151
ctx->callback_data = callback_data;
150152

153+
trace_isoc_outbound_allocate(ctx, channel, speed);
154+
trace_isoc_inbound_single_allocate(ctx, channel, header_size);
155+
trace_isoc_inbound_multiple_allocate(ctx);
156+
151157
return ctx;
152158
}
153159
EXPORT_SYMBOL(fw_iso_context_create);
154160

155161
void fw_iso_context_destroy(struct fw_iso_context *ctx)
156162
{
163+
trace_isoc_outbound_destroy(ctx);
164+
trace_isoc_inbound_single_destroy(ctx);
165+
trace_isoc_inbound_multiple_destroy(ctx);
166+
157167
ctx->card->driver->free_iso_context(ctx);
158168
}
159169
EXPORT_SYMBOL(fw_iso_context_destroy);
160170

161171
int fw_iso_context_start(struct fw_iso_context *ctx,
162172
int cycle, int sync, int tags)
163173
{
174+
trace_isoc_outbound_start(ctx, cycle);
175+
trace_isoc_inbound_single_start(ctx, cycle, sync, tags);
176+
trace_isoc_inbound_multiple_start(ctx, cycle, sync, tags);
177+
164178
return ctx->card->driver->start_iso(ctx, cycle, sync, tags);
165179
}
166180
EXPORT_SYMBOL(fw_iso_context_start);
167181

168182
int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels)
169183
{
184+
trace_isoc_inbound_multiple_channels(ctx, *channels);
185+
170186
return ctx->card->driver->set_iso_channels(ctx, channels);
171187
}
172188

@@ -175,24 +191,40 @@ int fw_iso_context_queue(struct fw_iso_context *ctx,
175191
struct fw_iso_buffer *buffer,
176192
unsigned long payload)
177193
{
194+
trace_isoc_outbound_queue(ctx, payload, packet);
195+
trace_isoc_inbound_single_queue(ctx, payload, packet);
196+
trace_isoc_inbound_multiple_queue(ctx, payload, packet);
197+
178198
return ctx->card->driver->queue_iso(ctx, packet, buffer, payload);
179199
}
180200
EXPORT_SYMBOL(fw_iso_context_queue);
181201

182202
void fw_iso_context_queue_flush(struct fw_iso_context *ctx)
183203
{
204+
trace_isoc_outbound_flush(ctx);
205+
trace_isoc_inbound_single_flush(ctx);
206+
trace_isoc_inbound_multiple_flush(ctx);
207+
184208
ctx->card->driver->flush_queue_iso(ctx);
185209
}
186210
EXPORT_SYMBOL(fw_iso_context_queue_flush);
187211

188212
int fw_iso_context_flush_completions(struct fw_iso_context *ctx)
189213
{
214+
trace_isoc_outbound_flush_completions(ctx);
215+
trace_isoc_inbound_single_flush_completions(ctx);
216+
trace_isoc_inbound_multiple_flush_completions(ctx);
217+
190218
return ctx->card->driver->flush_iso_completions(ctx);
191219
}
192220
EXPORT_SYMBOL(fw_iso_context_flush_completions);
193221

194222
int fw_iso_context_stop(struct fw_iso_context *ctx)
195223
{
224+
trace_isoc_outbound_stop(ctx);
225+
trace_isoc_inbound_single_stop(ctx);
226+
trace_isoc_inbound_multiple_stop(ctx);
227+
196228
return ctx->card->driver->stop_iso(ctx);
197229
}
198230
EXPORT_SYMBOL(fw_iso_context_stop);

0 commit comments

Comments
 (0)