[PATCH] ALSA: firewire-lib: fix to check cycle continuity
The local helper function to compare the given pair of cycle count evaluates them. If the left value is less than the right value, the function returns negative value.
If the safe cycle is less than the current cycle, it is the case of cycle lost. However, it is not currently handled properly.
This commit fixes the bug.
Cc: stable@vger.kernel.org Fixes: 705794c53b00 ("ALSA: firewire-lib: check cycle continuity") Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/amdtp-stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index a13c0b408aad..7be17bca257f 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -951,7 +951,7 @@ static int generate_tx_packet_descs(struct amdtp_stream *s, struct pkt_desc *des // to the reason. unsigned int safe_cycle = increment_ohci_cycle_count(next_cycle, IR_JUMBO_PAYLOAD_MAX_SKIP_CYCLES); - lost = (compare_ohci_cycle_count(safe_cycle, cycle) > 0); + lost = (compare_ohci_cycle_count(safe_cycle, cycle) < 0); } if (lost) { dev_err(&s->unit->device, "Detect discontinuity of cycle: %d %d\n",
On Sun, 18 Feb 2024 04:30:26 +0100, Takashi Sakamoto wrote:
The local helper function to compare the given pair of cycle count evaluates them. If the left value is less than the right value, the function returns negative value.
If the safe cycle is less than the current cycle, it is the case of cycle lost. However, it is not currently handled properly.
This commit fixes the bug.
Cc: stable@vger.kernel.org Fixes: 705794c53b00 ("ALSA: firewire-lib: check cycle continuity") Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp
Thanks, applied.
Takashi
participants (2)
-
Takashi Iwai
-
Takashi Sakamoto