From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ASoC: hdac_hdmi: Ensuring proper setting of output widget power state Date: Fri, 12 Jan 2018 12:09:00 +0100 Message-ID: References: <1515670468-9198-1-git-send-email-abhijeet.kumar@intel.com> <20180112054638.GL18649@localhost> <60213CA7255C53479ADE3BCF0360117F02E7124F@PGSMSX104.gar.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 mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 6A713266D71 for ; Fri, 12 Jan 2018 12:09:04 +0100 (CET) In-Reply-To: <60213CA7255C53479ADE3BCF0360117F02E7124F@PGSMSX104.gar.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: "Kumar, Abhijeet" Cc: "alsa-devel@alsa-project.org" , "Koul, Vinod" , "linux-kernel@vger.kernel.org" , "Singh, Guneshwor O" , Liam Girdwood , Mark Brown , "Kp, Jeeja" , "Tayal, SandeepX" , "Prusty, Subhransu S" List-Id: alsa-devel@alsa-project.org 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