From: Takashi Iwai Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume time Date: Tue, 25 Jun 2013 09:06:32 +0200 Message-ID: References: <1372074324-13563-1-git-send-email-xingchao.wang@linux.intel.com> <46B810F6945F7C4788E11DCE57EC489011833BCC@SHSMSX104.ccr.corp.intel.com> <46B810F6945F7C4788E11DCE57EC48901183434E@SHSMSX104.ccr.corp.intel.com> <46B810F6945F7C4788E11DCE57EC4890118343CA@SHSMSX104.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 mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D78C8265528 for ; Tue, 25 Jun 2013 09:05:43 +0200 (CEST) In-Reply-To: <46B810F6945F7C4788E11DCE57EC4890118343CA@SHSMSX104.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: "Wang, Xingchao" Cc: "alsa-devel@alsa-project.org" , Wang Xingchao List-Id: alsa-devel@alsa-project.org At Tue, 25 Jun 2013 06:34:49 +0000, Wang, Xingchao wrote: > > Hi Takashi, > > > -----Original Message----- > > From: Takashi Iwai [mailto:tiwai@suse.de] > > Sent: Tuesday, June 25, 2013 2:07 PM > > To: Wang, Xingchao > > Cc: alsa-devel@alsa-project.org; Wang Xingchao > > Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume time > > > > At Tue, 25 Jun 2013 04:54:05 +0000, > > Wang, Xingchao wrote: > > > > > > Hi Takashi, > > > > > > > > > > -----Original Message----- > > > > From: Takashi Iwai [mailto:tiwai@suse.de] > > > > Sent: Monday, June 24, 2013 8:50 PM > > > > To: Wang, Xingchao > > > > Cc: alsa-devel@alsa-project.org; Wang Xingchao > > > > Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume time > > > > > > > > At Mon, 24 Jun 2013 12:19:42 +0000, > > > > Wang, Xingchao wrote: > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Takashi Iwai [mailto:tiwai@suse.de] > > > > > > Sent: Monday, June 24, 2013 7:33 PM > > > > > > To: Wang Xingchao > > > > > > Cc: alsa-devel@alsa-project.org; Wang, Xingchao > > > > > > Subject: Re: [PATCH 1/2] ALSA: hdmi - poll eld at resume time > > > > > > > > > > > > At Mon, 24 Jun 2013 07:45:23 -0400, Wang Xingchao wrote: > > > > > > > > > > > > > > Hdmi driver may not receive intrinsic event from gfx side when > > > > > > > it's in runtime suspend mode. There's no ELD info when exit > > > > > > > from runtime suspend. This patch avoid missing ELD info. > > > > > > > > > > > > hda_call_codec_resume() sets the jack detection all dirty, thus > > > > > > each jack detection callback should be called at resume. Didn't > > > > > > it work as > > > > expected? > > > > > > > > > > I would double check that. In my test, it doesnot work as expected. > > > > > > > > OK, I found the problem. patch_hdmi.c enables the jack detection > > > > stuff without the callback, so the resume code triggers the check of > > > > jack detection but only updates the kcontrols. > > > > > > You patch did not resolve the issue. > > > I added some debug log, the callback wasnot called at all. > > > > Even if you unplugged while runtime suspend? > > Yes, the controller/codec suspended in runtime already. > > > > > The callback is called only when the plug status (i.e. the jack detection state) > > change is detected at the resume time -- i.e. the state the driver holds differs > > from the state at the resume. > > > > Do you assume jackpoll_interval be non-zero? If so the hda_jackpoll_work will continue to run periodically. > IMO the callback just need be called only once at resume time. Hmm, the problem is that the callback updater isn't called in the resume path as default. The oneliner below will fix it. But, looking through all changes, maybe your first patch is easier to apply as is now. I'll take it. We need a bit more cleanups over init and resume codes after all. The init callback is called before calling build_controls and build_pcm, and the very same init callback is called also in the resume path (if the resume callback is undefined). This causes the confusion, too. In patch_hdmi.c, the init changes only the pin control and amp, and can't touch anything else, because it cannot call any pin-related events at that point since the necessary resources are added in the later point, generic_hdmi_build_controls(). thanks, Takashi > > Thanks > --xingchao >