mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: ALSA Development Mailing List <alsa-devel@alsa-project.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Clemens Ladisch <clemens@ladisch.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate()
Date: Mon, 15 May 2017 23:40:12 +0900	[thread overview]
Message-ID: <6d8977cb-05c9-b237-2f2d-8b0ab8077bc6@sakamocchi.jp> (raw)
In-Reply-To: <CAMuHMdXOkx3XcqH3LS--5Z9Gbfdftgvrbsz8MhH-4k3rqSmxRw@mail.gmail.com>

On May 15 2017 23:22, Geert Uytterhoeven wrote:
>>> diff --git a/sound/firewire/tascam/tascam-stream.c
>>> b/sound/firewire/tascam/tascam-stream.c
>>> index f1657a4e0621ef49..e433b92ac6904db5 100644
>>> --- a/sound/firewire/tascam/tascam-stream.c
>>> +++ b/sound/firewire/tascam/tascam-stream.c
>>> @@ -84,7 +84,7 @@ int snd_tscm_stream_get_rate(struct snd_tscm *tscm,
>>> unsigned int *rate)
>>>         unsigned int trials = 0;
>>>         int err;
>>>
>>> -       while (data == 0x0 || trials++ < 5) {
>>> +       while (data == 0x0 && trials++ < 5) {
>>>                 err = get_clock(tscm, &data);
>>>                 if (err < 0)
>>>                         return err;
>>
>> Yep. It looks a bug.
>>
>> ...However, removal of the bug causes issue that the driver fails to start a
>> pair of capture/playback PCM substream when application requests them mostly
>> the same time, like jackd process.
>>
>> I think I did apply the bug as a makeshift workaround, then forgot itself
>> when developing the driver... I'd like to have a bit time for further
>> investigation, then post my fix in this development period.
>
> Probably you need a small delay in the loop?
> Why else do you #include <linux/delay.h>? ;-)

I know PDI1394L40 (link layer) has quirks inconvenient to us. 
Furthermore, the behaviour of on-board FPGAs with unique firmwares are 
in black boxes to me.

I prefer deliberate approach for this kind of work, reverse engineering.


Regards

Takashi Sakamoto

      reply	other threads:[~2017-05-15 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15  8:19 Geert Uytterhoeven
2017-05-15  8:19 ` [PATCH 2/2] ALSA: firewire-tascam: Use do { } while for loops executed at least once Geert Uytterhoeven
2017-05-15 14:07 ` [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Takashi Sakamoto
2017-05-15 14:22   ` Geert Uytterhoeven
2017-05-15 14:40     ` Takashi Sakamoto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d8977cb-05c9-b237-2f2d-8b0ab8077bc6@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=clemens@ladisch.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®