From: Takashi Iwai Subject: Re: [RFC PATCH v2 1/2] ASoC: refine ASoC hdmi audio suspend/resume Date: Wed, 09 Jan 2019 09:29:36 +0100 Message-ID: References: <1546827721-25586-1-git-send-email-libin.yang@intel.com> <96A12704CE18D347B625EE2D4A099D19527AE0B4@SHSMSX103.ccr.corp.intel.com> <96A12704CE18D347B625EE2D4A099D19527AE92B@SHSMSX103.ccr.corp.intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 62955266829 for ; Wed, 9 Jan 2019 09:29:37 +0100 (CET) In-Reply-To: <96A12704CE18D347B625EE2D4A099D19527AE92B@SHSMSX103.ccr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Yang, Libin" Cc: "liam.r.girdwood@linux.intel.com" , "Lin, Mengdong" , "alsa-devel@alsa-project.org" , "broonie@kernel.org" , Pierre-Louis Bossart List-Id: alsa-devel@alsa-project.org On Wed, 09 Jan 2019 09:16:34 +0100, Yang, Libin wrote: > > >- > >-static void hdmi_codec_complete(struct device *dev) > >+#ifdef CONFIG_PM_SLEEP > >+static int hdmi_codec_resume(struct device *dev) > > { > > struct hdac_device *hdev = dev_to_hdac_dev(dev); > > struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev); > >+ int ret; > > > >- /* Power up afg */ > >- snd_hdac_codec_read(hdev, hdev->afg, 0, > > AC_VERB_SET_POWER_STATE, > >- AC_PWRST_D0); > >- > >- hdac_hdmi_skl_enable_all_pins(hdev); > >- hdac_hdmi_skl_enable_dp12(hdev); > >- > >+ ret = pm_runtime_force_resume(dev); > > The code hopes to call hdmi pm_runtime() whenever this resume() > is called? If so, I'm afraid it will not work. pm_runtime_force_resume() > calls pm_runtime with conditions. Sometimes pm_runtime will not > be called. In my suspend/resume test, it shows that pm_runtime() is > not called. This may cause the following function > hdac_hdmi_present_sense_all_pins() not work well as there is no > power on. Hm, right, maybe we should move hdac_hdmi_present_sense_all_pins() into runtime resume. It may be called unconditionally, but safer to call it conditionally only after S3 or so... thanks, Takashi