From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ALSA: hda - delay resume haswell hdmi codec in system resume Date: Sun, 07 Apr 2013 09:28:26 +0200 Message-ID: References: <1364321572-2634-1-git-send-email-mengdong.lin@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 846C12616C1 for ; Sun, 7 Apr 2013 09:28:27 +0200 (CEST) In-Reply-To: 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: "Lin, Mengdong" Cc: "alsa-devel@alsa-project.org" List-Id: alsa-devel@alsa-project.org At Fri, 5 Apr 2013 16:58:54 +0000, Lin, Mengdong wrote: > > > -----Original Message----- > > From: Takashi Iwai [mailto:tiwai@suse.de] > > Sent: Tuesday, April 02, 2013 5:53 PM > > To: Lin, Mengdong > > Cc: alsa-devel@alsa-project.org > > Subject: Re: [alsa-devel] [PATCH] ALSA: hda - delay resume haswell hdmi codec > > in system resume > > > > At Tue, 26 Mar 2013 07:02:54 +0000, > > Lin, Mengdong wrote: > > > > > > Is it okay to add a new parameter to snd_hda_resume(), to indicate whether > > codec resume should be delayed or not? > > > Is because snd_hda_resume() is only only called by azx_resume() but also > > called by azx_bus_reset(). > > > The latter can be called on a fatal verb execution failure and codec resume > > delay is not suitable for this case. > > > > Well, I prefer creating a new function (e.g. snd_hda_bus_reset()) called from > > azx_bus_reset(). > > > > > > Takashi > > Hi Takashi, > > Do you mean that in azx_bus_reset(), we can merge the snd_hda_suspend() and snd_hda_resume() to a new function like snd_hda_bus_reset()? Yes. Calling snd_hda_suspend() following snd_hda_resume() immediately is just an ad hoc way of reset. It should have been a dedicated reset function from the beginning. Takashi > snd_hda_suspend() and snd_hda_resume() look symmetrical here and so I don't want to destroy the symmetry. > > static void azx_bus_reset(struct hda_bus *bus) > { > ... > #ifdef CONFIG_PM > if (chip->initialized) { > struct azx_pcm *p; > list_for_each_entry(p, &chip->pcm_list, list) > snd_pcm_suspend_all(p->pcm); > snd_hda_suspend(chip->bus); > snd_hda_resume(chip->bus); > } > #endif > bus->in_reset = 0; > } > > Thanks > Mengdong >