Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933503AbeALLJF (ORCPT + 1 other); Fri, 12 Jan 2018 06:09:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:36739 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932740AbeALLJE (ORCPT ); Fri, 12 Jan 2018 06:09:04 -0500 Date: Fri, 12 Jan 2018 12:09:00 +0100 Message-ID: From: Takashi Iwai To: "Kumar, Abhijeet" Cc: "Koul, Vinod" , "alsa-devel@alsa-project.org" , Liam Girdwood , "Singh, Guneshwor O" , "Kp, Jeeja" , "Tayal, SandeepX" , "Prusty, Subhransu S" , Mark Brown , "Jaroslav Kysela" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] ASoC: hdac_hdmi: Ensuring proper setting of output widget power state In-Reply-To: <60213CA7255C53479ADE3BCF0360117F02E7124F@PGSMSX104.gar.corp.intel.com> References: <1515670468-9198-1-git-send-email-abhijeet.kumar@intel.com> <20180112054638.GL18649@localhost> <60213CA7255C53479ADE3BCF0360117F02E7124F@PGSMSX104.gar.corp.intel.com> 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 11:37:28 +0100, Kumar, Abhijeet wrote: > > > 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 for replying. I guess, I should make use of return value from codec_read and retry if power state is not set properly! I'll make those changes and update again. And just wondering, how does hdmi_codec_prepare() and hdmi_codec_complete() gurantee while powering up and down the afg ? There are two power states in the codec node: the target and the actual. By setting the power state, the target is set, but the actual state change may still take some time. In such a case, you'd need to wait until the actual state reaches. See hda_sync_power_state() in the hda legacy. Takashi