diff options
-rw-r--r-- | sound/firewire/amdtp-stream-trace.h | 28 | ||||
-rw-r--r-- | sound/firewire/amdtp-stream.c | 14 |
2 files changed, 28 insertions, 14 deletions
diff --git a/sound/firewire/amdtp-stream-trace.h b/sound/firewire/amdtp-stream-trace.h index 425d1d7f26bc..16225792b722 100644 --- a/sound/firewire/amdtp-stream-trace.h +++ b/sound/firewire/amdtp-stream-trace.h | |||
@@ -14,8 +14,8 @@ | |||
14 | #include <linux/tracepoint.h> | 14 | #include <linux/tracepoint.h> |
15 | 15 | ||
16 | TRACE_EVENT(in_packet, | 16 | TRACE_EVENT(in_packet, |
17 | TP_PROTO(const struct amdtp_stream *s, u32 cycles, u32 cip_header[2], unsigned int payload_quadlets), | 17 | TP_PROTO(const struct amdtp_stream *s, u32 cycles, u32 cip_header[2], unsigned int payload_quadlets, unsigned int index), |
18 | TP_ARGS(s, cycles, cip_header, payload_quadlets), | 18 | TP_ARGS(s, cycles, cip_header, payload_quadlets, index), |
19 | TP_STRUCT__entry( | 19 | TP_STRUCT__entry( |
20 | __field(unsigned int, second) | 20 | __field(unsigned int, second) |
21 | __field(unsigned int, cycle) | 21 | __field(unsigned int, cycle) |
@@ -25,6 +25,8 @@ TRACE_EVENT(in_packet, | |||
25 | __field(u32, cip_header0) | 25 | __field(u32, cip_header0) |
26 | __field(u32, cip_header1) | 26 | __field(u32, cip_header1) |
27 | __field(unsigned int, payload_quadlets) | 27 | __field(unsigned int, payload_quadlets) |
28 | __field(unsigned int, packet_index) | ||
29 | __field(bool, irq) | ||
28 | __field(unsigned int, index) | 30 | __field(unsigned int, index) |
29 | ), | 31 | ), |
30 | TP_fast_assign( | 32 | TP_fast_assign( |
@@ -36,10 +38,12 @@ TRACE_EVENT(in_packet, | |||
36 | __entry->cip_header0 = cip_header[0]; | 38 | __entry->cip_header0 = cip_header[0]; |
37 | __entry->cip_header1 = cip_header[1]; | 39 | __entry->cip_header1 = cip_header[1]; |
38 | __entry->payload_quadlets = payload_quadlets; | 40 | __entry->payload_quadlets = payload_quadlets; |
39 | __entry->index = s->packet_index; | 41 | __entry->packet_index = s->packet_index; |
42 | __entry->irq = in_interrupt(); | ||
43 | __entry->index = index; | ||
40 | ), | 44 | ), |
41 | TP_printk( | 45 | TP_printk( |
42 | "%02u %04u %04x %04x %02d %08x %08x %03u %02u", | 46 | "%02u %04u %04x %04x %02d %08x %08x %03u %02u %01u %02u", |
43 | __entry->second, | 47 | __entry->second, |
44 | __entry->cycle, | 48 | __entry->cycle, |
45 | __entry->src, | 49 | __entry->src, |
@@ -48,12 +52,14 @@ TRACE_EVENT(in_packet, | |||
48 | __entry->cip_header0, | 52 | __entry->cip_header0, |
49 | __entry->cip_header1, | 53 | __entry->cip_header1, |
50 | __entry->payload_quadlets, | 54 | __entry->payload_quadlets, |
55 | __entry->packet_index, | ||
56 | __entry->irq, | ||
51 | __entry->index) | 57 | __entry->index) |
52 | ); | 58 | ); |
53 | 59 | ||
54 | TRACE_EVENT(out_packet, | 60 | TRACE_EVENT(out_packet, |
55 | TP_PROTO(const struct amdtp_stream *s, u32 cycles, __be32 *cip_header, unsigned int payload_length), | 61 | TP_PROTO(const struct amdtp_stream *s, u32 cycles, __be32 *cip_header, unsigned int payload_length, unsigned int index), |
56 | TP_ARGS(s, cycles, cip_header, payload_length), | 62 | TP_ARGS(s, cycles, cip_header, payload_length, index), |
57 | TP_STRUCT__entry( | 63 | TP_STRUCT__entry( |
58 | __field(unsigned int, second) | 64 | __field(unsigned int, second) |
59 | __field(unsigned int, cycle) | 65 | __field(unsigned int, cycle) |
@@ -63,6 +69,8 @@ TRACE_EVENT(out_packet, | |||
63 | __field(u32, cip_header0) | 69 | __field(u32, cip_header0) |
64 | __field(u32, cip_header1) | 70 | __field(u32, cip_header1) |
65 | __field(unsigned int, payload_quadlets) | 71 | __field(unsigned int, payload_quadlets) |
72 | __field(unsigned int, packet_index) | ||
73 | __field(bool, irq) | ||
66 | __field(unsigned int, index) | 74 | __field(unsigned int, index) |
67 | ), | 75 | ), |
68 | TP_fast_assign( | 76 | TP_fast_assign( |
@@ -74,10 +82,12 @@ TRACE_EVENT(out_packet, | |||
74 | __entry->cip_header0 = be32_to_cpu(cip_header[0]); | 82 | __entry->cip_header0 = be32_to_cpu(cip_header[0]); |
75 | __entry->cip_header1 = be32_to_cpu(cip_header[1]); | 83 | __entry->cip_header1 = be32_to_cpu(cip_header[1]); |
76 | __entry->payload_quadlets = payload_length / 4; | 84 | __entry->payload_quadlets = payload_length / 4; |
77 | __entry->index = s->packet_index; | 85 | __entry->packet_index = s->packet_index; |
86 | __entry->irq = in_interrupt(); | ||
87 | __entry->index = index; | ||
78 | ), | 88 | ), |
79 | TP_printk( | 89 | TP_printk( |
80 | "%02u %04u %04x %04x %02d %08x %08x %03u %02u", | 90 | "%02u %04u %04x %04x %02d %08x %08x %03u %02u %01u %02u", |
81 | __entry->second, | 91 | __entry->second, |
82 | __entry->cycle, | 92 | __entry->cycle, |
83 | __entry->src, | 93 | __entry->src, |
@@ -86,6 +96,8 @@ TRACE_EVENT(out_packet, | |||
86 | __entry->cip_header0, | 96 | __entry->cip_header0, |
87 | __entry->cip_header1, | 97 | __entry->cip_header1, |
88 | __entry->payload_quadlets, | 98 | __entry->payload_quadlets, |
99 | __entry->packet_index, | ||
100 | __entry->irq, | ||
89 | __entry->index) | 101 | __entry->index) |
90 | ); | 102 | ); |
91 | 103 | ||
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 024ab7fa84c9..bf10ca3adc57 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c | |||
@@ -409,7 +409,8 @@ static inline int queue_in_packet(struct amdtp_stream *s) | |||
409 | amdtp_stream_get_max_payload(s), false); | 409 | amdtp_stream_get_max_payload(s), false); |
410 | } | 410 | } |
411 | 411 | ||
412 | static int handle_out_packet(struct amdtp_stream *s, unsigned int cycle) | 412 | static int handle_out_packet(struct amdtp_stream *s, unsigned int cycle, |
413 | unsigned int index) | ||
413 | { | 414 | { |
414 | __be32 *buffer; | 415 | __be32 *buffer; |
415 | unsigned int syt; | 416 | unsigned int syt; |
@@ -434,7 +435,7 @@ static int handle_out_packet(struct amdtp_stream *s, unsigned int cycle) | |||
434 | s->data_block_counter = (s->data_block_counter + data_blocks) & 0xff; | 435 | s->data_block_counter = (s->data_block_counter + data_blocks) & 0xff; |
435 | payload_length = 8 + data_blocks * 4 * s->data_block_quadlets; | 436 | payload_length = 8 + data_blocks * 4 * s->data_block_quadlets; |
436 | 437 | ||
437 | trace_out_packet(s, cycle, buffer, payload_length); | 438 | trace_out_packet(s, cycle, buffer, payload_length, index); |
438 | 439 | ||
439 | if (queue_out_packet(s, payload_length, false) < 0) | 440 | if (queue_out_packet(s, payload_length, false) < 0) |
440 | return -EIO; | 441 | return -EIO; |
@@ -448,7 +449,8 @@ static int handle_out_packet(struct amdtp_stream *s, unsigned int cycle) | |||
448 | } | 449 | } |
449 | 450 | ||
450 | static int handle_in_packet(struct amdtp_stream *s, | 451 | static int handle_in_packet(struct amdtp_stream *s, |
451 | unsigned int payload_quadlets, unsigned int cycle) | 452 | unsigned int payload_quadlets, unsigned int cycle, |
453 | unsigned int index) | ||
452 | { | 454 | { |
453 | __be32 *buffer; | 455 | __be32 *buffer; |
454 | u32 cip_header[2]; | 456 | u32 cip_header[2]; |
@@ -463,7 +465,7 @@ static int handle_in_packet(struct amdtp_stream *s, | |||
463 | cip_header[0] = be32_to_cpu(buffer[0]); | 465 | cip_header[0] = be32_to_cpu(buffer[0]); |
464 | cip_header[1] = be32_to_cpu(buffer[1]); | 466 | cip_header[1] = be32_to_cpu(buffer[1]); |
465 | 467 | ||
466 | trace_in_packet(s, cycle, cip_header, payload_quadlets); | 468 | trace_in_packet(s, cycle, cip_header, payload_quadlets, index); |
467 | 469 | ||
468 | /* | 470 | /* |
469 | * This module supports 'Two-quadlet CIP header with SYT field'. | 471 | * This module supports 'Two-quadlet CIP header with SYT field'. |
@@ -602,7 +604,7 @@ static void out_stream_callback(struct fw_iso_context *context, u32 tstamp, | |||
602 | 604 | ||
603 | for (i = 0; i < packets; ++i) { | 605 | for (i = 0; i < packets; ++i) { |
604 | cycle = increment_cycle_count(cycle, 1); | 606 | cycle = increment_cycle_count(cycle, 1); |
605 | if (handle_out_packet(s, cycle) < 0) { | 607 | if (handle_out_packet(s, cycle, i) < 0) { |
606 | s->packet_index = -1; | 608 | s->packet_index = -1; |
607 | amdtp_stream_pcm_abort(s); | 609 | amdtp_stream_pcm_abort(s); |
608 | return; | 610 | return; |
@@ -649,7 +651,7 @@ static void in_stream_callback(struct fw_iso_context *context, u32 tstamp, | |||
649 | break; | 651 | break; |
650 | } | 652 | } |
651 | 653 | ||
652 | if (handle_in_packet(s, payload_quadlets, cycle) < 0) | 654 | if (handle_in_packet(s, payload_quadlets, cycle, i) < 0) |
653 | break; | 655 | break; |
654 | } | 656 | } |
655 | 657 | ||