From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754499AbeALJ0N (ORCPT + 1 other); Fri, 12 Jan 2018 04:26:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:58369 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754304AbeALJ0L (ORCPT ); Fri, 12 Jan 2018 04:26:11 -0500 Date: Fri, 12 Jan 2018 10:26:09 +0100 Message-ID: From: Takashi Iwai To: " Kumar, Abhijeet " Cc: "Vinod Koul" , , "Liam Girdwood" , "Guneshwor Singh" , "Jeeja KP" , "Sandeep Tayal" , "Subhransu S. Prusty" , "Mark Brown" , "Jaroslav Kysela" , Subject: Re: [PATCH] ASoC: hdac_hdmi: Ensuring proper setting of output widget power state In-Reply-To: References: <1515670468-9198-1-git-send-email-abhijeet.kumar@intel.com> <20180112054638.GL18649@localhost> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, 12 Jan 2018 09:25:54 +0100, Kumar, Abhijeet wrote: > > > > On 1/12/2018 11:16 AM, Vinod Koul wrote: > > On Thu, Jan 11, 2018 at 05:04:27PM +0530, abhijeet.kumar@intel.com wrote: > >> From: Abhijeet Kumar > >> > >> When we change the resolution of DP pannel or hot plug-unplug it while > >> playing an audio clip,sometimes we observe a silent playback(no audio). > > can you rephrase this please > done please review v2! > >> During no audio condition, we have noticed that the power state of the > >> pin or the connector is D3. Optimzing the way we set the power could > >> mitigate the issue.With this changes the verb is sent to set the power > > space after . > > > >> state and response is received. Thus ensuring power state is set. > > am not sure I fully understood the problem here > > This appears to be an timing issue, while performing a stress test, we > found out that sometimes either pin or converters are not powered > up. Thus ensuring it that the power state is set correctly. > > > > >> Signed-off-by: Abhijeet Kumar > >> --- > >> sound/soc/codecs/hdac_hdmi.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c > >> index f3b4f4dfae6a..e24caecf0a4f 100644 > >> --- a/sound/soc/codecs/hdac_hdmi.c > >> +++ b/sound/soc/codecs/hdac_hdmi.c > >> @@ -718,7 +718,7 @@ static void hdac_hdmi_set_power_state(struct hdac_ext_device *edev, > >> { > >> if (get_wcaps(&edev->hdac, nid) & AC_WCAP_POWER) { > >> if (!snd_hdac_check_power_state(&edev->hdac, nid, pwr_state)) > >> - snd_hdac_codec_write(&edev->hdac, nid, 0, > >> + snd_hdac_codec_read(&edev->hdac, nid, 0, > > how does read help instead of write? > > Indeed i'm making use of read instead of write to send the set command. > > But unlike codec_write, codec_read send the verb synchronously. Maybe > if you read the comment while powering up and down in > hdmi_codec_prepare and hdmi_codec_complete you would understand > better. > > "codec_read is preferred over codec_write to set the power state. > > This way verb is send to set the power state and response is > received. So setting power state is ensured without using loop to read > the state." It's better, but doesn't guarantee that the node reached the given power state. codec_read assures that the verb is sent and the codec gives the response. But it means only the target state gets updated, and doesn't mean that the actual state reached. thanks, Takashi