From: Takashi Iwai <tiwai@suse.de>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: linux-tegra <linux-tegra@vger.kernel.org>, alsa-devel@alsa-project.org
Subject: Re: [alsa-devel] [PATCH] ALSA: hda: Use standard waitqueue for RIRB wakeup
Date: Wed, 18 Dec 2019 15:31:30 +0100 [thread overview]
Message-ID: <s5h5zid903h.wl-tiwai@suse.de> (raw)
In-Reply-To: <53562c71-4d81-1580-f311-971ceb029431@nvidia.com>
On Wed, 18 Dec 2019 15:17:27 +0100,
Jon Hunter wrote:
>
>
> On 10/12/2019 14:57, Takashi Iwai wrote:
> > The HD-audio CORB/RIRB communication was programmed in a way that was
> > documented in the reference in decades ago, which is essentially a
> > polling in the waiter side. It's working fine but costs CPU cycles on
> > some platforms that support only slow communications. Also, for some
> > platforms that had unreliable communications, we put longer wait time
> > (2 ms), which accumulate quite long time if you execute many verbs in
> > a shot (e.g. at the initialization or resume phase).
> >
> > This patch attempts to improve the situation by introducing the
> > standard waitqueue in the RIRB waiter side instead of polling. The
> > test results on my machine show significant improvements. The time
> > spent for "cat /proc/asound/card*/codec#*" were changed like:
> >
> > * Intel SKL + Realtek codec
> > before the patch:
> > 0.00user 0.04system 0:00.10elapsed 40.0%CPU
> > after the patch:
> > 0.00user 0.01system 0:00.10elapsed 10.0%CPU
> >
> > * Nvidia GP107GL + Nvidia HDMI codec
> > before the patch:
> > 0.00user 0.00system 0:02.76elapsed 0.0%CPU
> > after the patch:
> > 0.00user 0.00system 0:00.01elapsed 17.0%CPU
> >
> > So, for Intel chips, the total time is same, while the total time is
> > greatly reduced (from 2.76 to 0.01s) for Nvidia chips.
> > The only negative data here is the increase of CPU time for Nvidia,
> > but this is the unavoidable cost for faster wakeups, supposedly.
> >
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> Starting with next-20191217 I am seeing the following error on one of
> our Tegra platforms ...
>
> tegra-hda 3510000.hda: azx_get_response timeout, switching to polling
> mode: last cmd=0x404f2d00
>
> Bisect is point to this commit and although it does not cleanly revert,
> if I revert this and a couple dependencies on top of -next the issue
> goes away. Any thoughts on what could be going on here?
Do you see any bad behavior other than the warning message?
If you don't see any dysfunction, I guess that the difference is that
the old code went to the trial mode at first silently (with
dev_dbg()), then switching to polling mode at next. The trial mode is
basically same as polling mode, but it was just considered to be a
temporary transition, so not warned.
IOW, if my guess is correct, maybe Tegra never worked in the normal
mode but only in the polling mode (but without complaints).
If so, the patch like below would be needed.
To prove my theory, could you check the old code with dyndbg enabled
for sound/pci/hda/hda_controller.c? If a message like below appears,
it's the case:
azx_get_response timeout, polling the codec once: last cmd=xxx
thanks,
Takashi
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -394,6 +394,7 @@ static int hda_tegra_create(struct snd_card *card,
if (err < 0)
return err;
+ chip->bus.core.polling = 1;
chip->bus.core.needs_damn_long_delay = 1;
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2019-12-18 14:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 14:57 [alsa-devel] [PATCH] ALSA: hda: Use standard waitqueue for RIRB wakeup Takashi Iwai
2019-12-12 17:17 ` Kai Vehmanen
2019-12-12 17:23 ` Takashi Iwai
2019-12-12 18:42 ` Takashi Iwai
2019-12-13 13:05 ` Kai Vehmanen
2019-12-13 13:34 ` Takashi Iwai
2019-12-13 13:42 ` Takashi Iwai
2019-12-18 14:17 ` Jon Hunter
2019-12-18 14:31 ` Takashi Iwai [this message]
2019-12-19 12:15 ` Jon Hunter
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=s5h5zid903h.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=jonathanh@nvidia.com \
--cc=linux-tegra@vger.kernel.org \
/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