linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Cc: David Yang <yangxiaohua@everest-semi.com>,
	Daniel Drake <drake@endlessm.com>,
	Hans de Goede <hdegoede@redhat.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing
Date: Tue, 3 Sep 2019 18:48:01 +0100	[thread overview]
Message-ID: <20190903174801.GD7916@sirena.co.uk> (raw)
In-Reply-To: <20190903165322.20791-1-katsuhiro@katsuster.net>

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

On Wed, Sep 04, 2019 at 01:53:19AM +0900, Katsuhiro Suzuki wrote:

> Root cause of this strange behavior is changing constraints list at
> set_sysclk timing. It seems that is too early to determine. So this
> patch does not use constraints list and check PCM rate limit more
> later timing at hw_params.

hw_params is a bit late to impose constraints, you want them to be
available to be available to the application before it gets as far as
picking the parameters it wants so that you don't get hw_params failing
due to an invalid configuration.  That makes everything run more
smoothly, applications should be able to trust the constraints they got
and some will not handle failures well.

The way this works with the variable MCLKs is that you end up in one of
two cases (wm8731 and wm8741 do this):

   1. The system is idle, MCLK is set to 0.  In this case no constraints
      are set and we just set MCLK to whatever is required in hw_params()
      in the machine driver.
   2. One direction is active, MCLK is set to whatever that needed.  In
      this case startup() sets constraints derived from the MCLK.

There are races in this if streams are being started and torn down
simultaneously, there's not much we can do about them with the API the
way it is so we do have to validate in hw_params() anyway but it should
be validation not constraint imposition.

If the system has a fixed MCLK it just sets that on probe then we always
get the constraints applied on startup through the same code that
handles case 2.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2019-09-03 17:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 16:53 [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing Katsuhiro Suzuki
2019-09-03 16:53 ` [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK Katsuhiro Suzuki
2019-09-03 18:00   ` Applied "ASoC: es8316: add clock control of MCLK" to the asoc tree Mark Brown
2019-09-04 14:37   ` [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK Andy Shevchenko
2019-09-04 15:46     ` Katsuhiro Suzuki
2019-09-03 16:53 ` [PATCH v3 3/4] ASoC: es8316: support fixed clock rate Katsuhiro Suzuki
2019-09-03 17:29   ` Mark Brown
2019-09-03 16:53 ` [PATCH v3 4/4] ASoC: es8316: add DT-bindings Katsuhiro Suzuki
2019-09-03 18:00   ` Applied "ASoC: es8316: add DT-bindings" to the asoc tree Mark Brown
2019-09-03 17:48 ` Mark Brown [this message]
2019-09-04 15:06   ` [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing Katsuhiro Suzuki
2019-09-04 15:30     ` Mark Brown
2019-09-04 15:55       ` Katsuhiro Suzuki

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=20190903174801.GD7916@sirena.co.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=drake@endlessm.com \
    --cc=hdegoede@redhat.com \
    --cc=katsuhiro@katsuster.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangxiaohua@everest-semi.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;
as well as URLs for NNTP newsgroup(s).