Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5066027imd; Tue, 30 Oct 2018 11:25:15 -0700 (PDT) X-Google-Smtp-Source: AJdET5cRwHOWtXwAOGg4E6NTV6ht0cbV7EaBJB45AW2p2XGN7QcRek+XDg1aa0sPzwpTgnpbRiCj X-Received: by 2002:a62:8f:: with SMTP id 137-v6mr4065588pfa.24.1540923915075; Tue, 30 Oct 2018 11:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540923915; cv=none; d=google.com; s=arc-20160816; b=hprKGn7Bm1HCLBbuFEuUUEVdgXfY+20m/00hERn/fCP9JoM99TljeyvuJkNoI83bt/ k2q3mnJHlkoLBEEVodE9FgMqxEMeig8rhocGlgJucn7y/qapNvucfWHcI4W40sZNaoBB LlmX5oevzIki1V3lsbT7U+RrpU809ksvsquuWGrq+Ht3Qz7PIqXK7bOOOpOUlNkqA4xw LBdygWwx+hA1Gxl6SSOU8t4EXdeFghqrNNZgpoMNt1tud1d6JrG234hlTt0u2YPPSv6H Xo+wiYWRYGYtwhuBvMYaTMeYaTsqiBXLuVV3PsN1DGWlZnySTSeW6zGHn/n4xRMfkW6Z xzRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uUse1PhAotbWoOgxObmZkP3z/Ehb8eAgsvgeMJs1frE=; b=VXnKomF6mG1TEIRe8UHvuGBgdjgY24V6j9O5d2xSpcfRltSfwHUZ2FCQMyXMYuN0V7 2LUs37kLIMd2nR5D/5sHrNHqDPPK1qQ/ZVaGSWaC9nG+Ez4TGIGKNskjEWm2+jpHYiNH u13dyeThHOfSisw3EdFwxzIYPtvRI3Ga9ey44Th6ekk8CCAkQ5blx0SfPw2GmNx6mz8E zVnRzA9o8iTN4sK7GprGnfA18Uv2t8M1oQMUeKHft0YLl77RmMSv3xPUvaWO7yJ2csaF JVBnxF8mp9yeU+BLzKYdID78EB4UJ6O5pAomBAS5coB1sLbtiGQEwyqydxqurvS0OpBM Zc/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u28-v6si10846441pfi.175.2018.10.30.11.24.59; Tue, 30 Oct 2018 11:25:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727713AbeJaBWD (ORCPT + 99 others); Tue, 30 Oct 2018 21:22:03 -0400 Received: from mga06.intel.com ([134.134.136.31]:50674 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbeJaBWD (ORCPT ); Tue, 30 Oct 2018 21:22:03 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2018 09:27:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,445,1534834800"; d="scan'208";a="87021718" Received: from agcho-mobl1.amr.corp.intel.com (HELO [10.254.98.112]) ([10.254.98.112]) by orsmga006.jf.intel.com with ESMTP; 30 Oct 2018 09:27:52 -0700 Subject: Re: Regression found (Stop-marking-clocks-as-CLK_IS_CRITICAL) To: Hans de Goede , Dean Wallace Cc: Andy Shevchenko , Stephen Boyd , Michael Turquette , linux-clk , Stable , Johannes Stezenbach , Carlo Caione , Andy Shevchenko , Linux Kernel Mailing List , Mogens Jensen References: <20181025232517.ywnw54qibemosjws@picard> <154083512089.98144.9141070901932719147@swboyd.mtv.corp.google.com> <20181029190819.2ivlx73n6y6sx4vk@picard> <20181030143836.feo7zcxiestylxoo@picard> <2d429c87-24c5-4075-683e-b0d12c3eb1c2@linux.intel.com> <783f17c2-ecc6-00fc-5629-02319b965205@redhat.com> From: Pierre-Louis Bossart Message-ID: Date: Tue, 30 Oct 2018 11:27:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <783f17c2-ecc6-00fc-5629-02319b965205@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/30/18 11:02 AM, Hans de Goede wrote: > Hi, > > On 30-10-18 16:46, Hans de Goede wrote: >> Hi, >> >> On 30-10-18 16:04, Pierre-Louis Bossart wrote: >>> >>> On 10/30/18 9:38 AM, Dean Wallace wrote: >>>> On 30-10-18, Hans de Goede wrote: >>>>> Hi Dean, >>>>> >>>>> Attached are 2 different attempts at fixing this. >>>>> >>>>> When trying these patches do not forget to remove the revert of the >>>>> "Stop-marking-clocks-as-CLK_IS_CRITICAL" commit. >>>>> >>>>> Please first try the >>>>> 0001-ASoC-intel-cht_bsw_max98090_ti-Use-pmc_plt_clk_0-ins.patch >>>>> patch I expect that one to do the trick indicating that the Swanky >>>>> model >>>>> uses a different pmc clk then which is normally used for the codec >>>>> clock. >>>>> >>>>> If that patch does not fix things, please give the other patch a try. >>> >>> For Baytrail devices, the audio platform clocks are not managed by >>> the firmware. They are for CHT-based devices - as can be seen by >>> clock resources being described in the DSDT. We used to have a >>> if(baytrail) in the code which was replaced by this CRITICAL label, >>> but the point remains that there is a difference between the two SOC >>> versions. >> >> As I mentioned before the CRITICAL flag was only added a year ago to >> workaround >> an issue with on board ethernet needing plt_clk_4 on some laptops, >> this never >> had anything to do with sound. > > Ah I see now that you later made some changes based on the patch to > fix the ethernet: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=7735bce05a9c0bb0eb0f08c9002d65843a7c5798 > > > Note though that that does not touch the machine driver which we are > discussing > now and the reporters machine is also BYT based. > > As explained below (in my original reply) I think it is fine to always > manage the clk from within the kernel. But if you think this is a bad > idea, we could re-introduce the is_valleyview() checks in machine > drivers which are used on CHT devices. I am having difficulties following the proposal for audio, managing the platform clocks from the kernel is only useful for Baytrail, and the code handling the CRITICAL flags is really equivalent to having a is_valleyview() test in the machine drivers. I don't quite understand the S0ix-related changes and I also don't get how using plt_clk_0 makes things better or wonder if audio on Swanky worked before the commit 7735bce05a9c ('ASoC: Intel: boards: use devm_clk_get() unconditionally'. In other words, I don't know if we are dealing with a platform that only started working with 7735bce05a9c and does need a quirk to make use of plt_clk_0 or a fundamental issue with clock/power management. > >>> In addition I am not aware of any baytrail device using plt_clk_0, >>> so moving a common machine driver such a cht_bsw_max98090_ti to use >>> plt_clk0 only would break other devices (e.g. Rambi/Orco). Asking >>> for both clocks to be on might work though, >> >> Ok, so we need to have a DMI based quirk for the Swanky and maybe also >> the clapper to use plt_clk_0 there. Asking for 2 clks if we only need >> one does not seem like a good plan. >> >>> however you still have the problem of trying to manage from the >>> kernel what the firmware already manages. >> >> The firmware only manages it when going to D3 state, with ASoC most of >> the codecs gets turned off (and we no longer need the clock) but we do >> not put the device in D3 / execute the _PS3 method. So from a pm pov >> it is better if we manage the clk ourselves. >> >> Once we do actually put the device in D3 (on suspend) the kernel will >> have >> already turned off the clk and the _OFF method of the CLK3 power >> resource >> which directly pokes mmio, will just set the enable bit to 0 when it >> already is 0, so no problem. > > Regards, > > Hans