All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Bard Liao <bardliao@realtek.com>,
	alsa-devel@alsa-project.org, Carlo Caione <carlo@endlessm.com>,
	Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 02/11] ASoC: rt5651: Remove is_sys_clk_from_pll, it has ordering issues
Date: Thu, 22 Feb 2018 10:48:16 +0000	[thread overview]
Message-ID: <20180222104816.GA5905@sirena.org.uk> (raw)
In-Reply-To: <7c0a41b1-6765-13e6-be96-b354c744ba29@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2438 bytes --]

On Wed, Feb 21, 2018 at 08:38:01PM +0100, Hans de Goede wrote:
> On 21-02-18 12:18, Mark Brown wrote:
> > On Tue, Feb 20, 2018 at 11:15:02PM +0100, Hans de Goede wrote:

> > Only if jack detection is enabled, if jack detection is not in use for
> > some reason then the PLL isn't required and should be powered off - this
> > is normally handled by having the jack detection code force enable
> > things.

> As the commit message tries to explain, the code this removes is fundamentally
> broken and this is not jack-detection related:

>    "dapm_power_widgets() first builds a list of which widgets to power-up
>     before actually powering any of them up. For dapm-supply widgets their
>     connected method, in our case is_sys_clk_from_pll() get called at this
>     point.

>     Before this commit is_sys_clk_from_pll() was looking at the actually
>     selected clock in the RT5651_GBL_CLK register. But the sysclk itself is
>     selected by another dapm-supply (the "Platform Clock" supply in the
>     machine driver) and any changes to that supply part of the same power-
>     transition get executed after building the list, causing
>     is_sys_clk_from_pll() to return the wrong value."

Right, but there's a couple of jumps in your reasoning with the actual
solution.

> As for that the PLL should be powered-off when not needed, I agree but that
> is controlled by the machine-driver through the "Platform Clock" dapm supply
> and if that leaves things on for some reason then that is the problem which
> we actually need to fix, e.g. this will also leave the MCLK input clk enabled
> needlessly.

I don't follow this bit, sorry.  If there's a DAPM supply that's being
enabled when it's not needed then we should just disable it.

> I really don't see how configuring a broken sysclk (GBL_CLK points to PLL1,
> but PLL-bit in PWR_ANLG2 is OFF) is ever a good thing, instead we should make
> sure we always switch to the RCCLK when we don't need the SYSCLK.

> Last force-enabling the PLL bit on all machines where we can do jack-detection
> (not only over-current, but the JD irq in general needs a valid sysclk) would
> in practice mean always force-enabling the PLL bit since almost all boards have
> jack-detection once we add the necessary quirks, so this really is not a solution.

A bit confused here as well, sorry - I think you're assuming I'm
suggesting some particular solution but I'm not sure what that is.

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

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2018-02-22 10:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 22:15 [PATCH 01/11] ASoC: rt5651: Avoid duplicating DMI quirks between codec and machine driver Hans de Goede
2018-02-20 22:15 ` [PATCH 02/11] ASoC: rt5651: Remove is_sys_clk_from_pll, it has ordering issues Hans de Goede
2018-02-21 11:18   ` Mark Brown
2018-02-21 19:38     ` Hans de Goede
2018-02-22 10:48       ` Mark Brown [this message]
2018-02-22 11:00         ` Hans de Goede
2018-02-22 11:13           ` Mark Brown
2018-02-20 22:15 ` [PATCH 03/11] ASoC: rt5651: Fix bias_level confusion / overcurrent detection deps Hans de Goede
2018-02-21 11:40   ` Mark Brown
2018-02-21 19:43     ` Hans de Goede
2018-02-22 10:52       ` Mark Brown
2018-02-22 11:04         ` Hans de Goede
2018-02-20 22:15 ` [PATCH 04/11] ASoC: rt5651: Simplify set_bias_level() Hans de Goede
2018-02-21 11:43   ` Mark Brown
2018-02-21 20:11     ` Hans de Goede
2018-02-22 11:12       ` Mark Brown
2018-02-20 22:15 ` [PATCH 05/11] ASoC: rt5651: Allow specifying micbias over-current thresholds through pdata Hans de Goede
2018-02-20 22:15 ` [PATCH 06/11] ASoC: rt5651: Improve headphone vs headset detection Hans de Goede
2018-02-21 12:05   ` Mark Brown
2018-02-21 20:22     ` Hans de Goede
2018-02-20 22:15 ` [PATCH 07/11] ASoC: Intel: bytcr_rt5651: Configure PLL1 before using it Hans de Goede
2018-02-20 22:15 ` [PATCH 08/11] ASoC: Intel: bytcr_rt5651: Rename IN3_MAP to IN1_HS_IN3_MAP Hans de Goede
2018-02-20 22:15 ` [PATCH 09/11] ASoC: Intel: bytcr_rt5651: Add new IN2_HS_IN3 input map and a quirk using it Hans de Goede
2018-02-20 22:15 ` [PATCH 10/11] ASoC: Intel: bytcr_rt5651: Add support for Bay Trail CR / SSP0 using boards Hans de Goede
2018-02-20 22:44   ` Pierre-Louis Bossart
2018-02-24 11:52     ` Hans de Goede
2018-02-20 22:15 ` [PATCH 11/11] ASoC: Intel: bytcr_rt5651: Add quirk for the VIOS LTH17 laptop Hans de Goede
2018-02-21 11:54 ` [PATCH 01/11] ASoC: rt5651: Avoid duplicating DMI quirks between codec and machine driver Mark Brown
2018-02-21 19:23   ` Hans de Goede
2018-02-22 11:08     ` Hans de Goede
2018-02-22 11:35       ` Mark Brown
2018-02-22 20:38         ` Hans de Goede
2018-02-22 11:32     ` Mark Brown
2018-02-21 17:36 ` Carlo Caione
2018-02-21 20:55   ` Hans de Goede

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=20180222104816.GA5905@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=carlo@endlessm.com \
    --cc=hdegoede@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.