Stable Archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: firewire-lib: fix to check cycle continuity
@ 2024-02-18  3:30 Takashi Sakamoto
  2024-02-19  8:26 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2024-02-18  3:30 UTC (permalink / raw
  To: tiwai; +Cc: alsa-devel, stable

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",
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: firewire-lib: fix to check cycle continuity
  2024-02-18  3:30 [PATCH] ALSA: firewire-lib: fix to check cycle continuity Takashi Sakamoto
@ 2024-02-19  8:26 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2024-02-19  8:26 UTC (permalink / raw
  To: Takashi Sakamoto; +Cc: alsa-devel, stable

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-19  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-18  3:30 [PATCH] ALSA: firewire-lib: fix to check cycle continuity Takashi Sakamoto
2024-02-19  8:26 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).