Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1641741
| Path | csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() |
| Date | Mon, 15 May 2017 16:30:02 +0200 |
| Message-ID | <tHpay-Ra-13@gated-at.bofh.it> (permalink) |
| References | <tHjou-5y7-13@gated-at.bofh.it> <tHoRc-KQ-19@gated-at.bofh.it> |
| X-Original-To | Takashi Sakamoto <o-takashi@sakamocchi.jp> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=ZLq5/l2KO2cGvRfIpy7o1wlm9mXdPJNZhyEr5tV05ZU=; b=EPQLGLDRh5WRGpqWn9PSfTSH4yBwFw5kClVzluB5oVcf+lx54l6Vy8Fk1K6ghlF5wV 5FIfe/cu08aeyIeTZfNPxu+lz2w3wuupJawnOaOcF0xo2p2B9sO2COdbsnXrythKPpOX w3gNDB4r64ELhKBECp4aBzj972yqrUMjT3VTbF8Y3QZhNu74UXzHfgIvuKDHGKMyIdET BmPSh9jQ4jKcL5mJI3ewUJpX1/4FDxneIRITwRosHSZk+6V3TpOK7imktXzoEeMmHH9a PKBdyBgiCl07I1HhU9gT7GwqQQf2VJP89jnnLo+Aj0y2cEJghnIjap9sY/NPnZ/lnXp3 yuvw== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=ZLq5/l2KO2cGvRfIpy7o1wlm9mXdPJNZhyEr5tV05ZU=; b=rOFzcslAulTfglrYMUFYfBimFCDhEdqFoZB29eKUeILgVipUkPrSwgy/hHxpUzAPNc UBwj7yfP4BPiLHjTLN0TpVgkubc8NKvCSmkHg/7BYmb49cY9BBsZBsU98/zmGpm4o+IB j6bIQiGt12TPaWCKxxaB0PGfbtCAD9p6S5B0jTG7fSoLaM3KqQr4s1qMewIi9pNwPJyK DISxeebUe0Wvo9tKh20u/YwaDUhck+gS/EL84eq3vQREoYp/oZ3ZCtSoIzgn39eQCf2l 1nXODDBIyFHDGc4Th6TjDujNkNfqMZ7AUpLw9r2hHAd9I31vdyWDb2h4Szu+YETxLZaK xPLg== |
| X-Gm-Message-State | AODbwcDLyFziHx/f+/xA5nXqerapdN7SR2GlNJHYtnZAucPFnGFfZFMA 0s1nQ+ocLGhQlBaplQgxp9+Et+yQHw== |
| X-Received | by 10.107.142.16 with SMTP id q16mr6406716iod.21.1494858172482; Mon, 15 May 2017 07:22:52 -0700 (PDT) |
| MIME-Version | 1.0 |
| X-Google-Sender-Auth | ru1lRHlXhoWxJBK6OuLRUAyj4-k |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | quoted-printable |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 71 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Clemens Ladisch <clemens@ladisch.de>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, ALSA Development Mailing List <alsa-devel@alsa-project.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de> |
| X-Original-Date | Mon, 15 May 2017 16:22:50 +0200 |
| X-Original-Message-ID | <CAMuHMdXOkx3XcqH3LS--5Z9Gbfdftgvrbsz8MhH-4k3rqSmxRw@mail.gmail.com> |
| X-Original-References | <1494836350-28790-1-git-send-email-geert@linux-m68k.org> <fab2c28e-4ed2-8995-d11e-a843195103b2@sakamocchi.jp> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1641741 |
Show key headers only | View raw
Hi Sakamoto-san,
On Mon, May 15, 2017 at 4:07 PM, Takashi Sakamoto
<o-takashi@sakamocchi.jp> wrote:
> On May 15 2017 17:19, Geert Uytterhoeven wrote:
>> Obviously the intention was to put a limit on the maximum number of
>> operations. However, for this to work, the check should be
>> "&& trials++ < 5", not "|| trials++ < 5".
>>
>> Fixes: 35efa5c489de63a9 ("ALSA: firewire-tascam: add streaming
>> functionality")
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>> Compile-tested only.
>>
>> Triggered by a false-positive warning from gcc-4.1.2:
>>
>> warning: ‘err’ may be used uninitialized in this function
>> ---
>> sound/firewire/tascam/tascam-stream.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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>? ;-)
> Please let me keep this patch pending.
OK.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-15 10:20 +0200
[PATCH 2/2] ALSA: firewire-tascam: Use do { } while for loops executed at least once Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-15 10:20 +0200
Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Takashi Sakamoto <o-takashi@sakamocchi.jp> - 2017-05-15 16:10 +0200
Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-15 16:30 +0200
Re: [PATCH 1/2] ALSA: firewire-tascam: Fix infinite loop in snd_tscm_stream_get_rate() Takashi Sakamoto <o-takashi@sakamocchi.jp> - 2017-05-15 16:50 +0200
csiph-web