From: Takashi Iwai Subject: Re: [RFC PATCH] ALSA: hda - add support for runtime power management Date: Mon, 20 Aug 2012 11:09:49 +0200 Message-ID: References: <1345195814-2287-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 CFC8B265D7F for ; Mon, 20 Aug 2012 10:40:03 +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 Sun, 19 Aug 2012 10:46:42 +0000, Lin, Mengdong wrote: > > > - Are snd_power_change_state() calls needed for runtime PM? > I think this is needed. It's because HW is actually in D3 when it's runtime suspended and need a delay for transition back to D0. And there are operations that need HW in D0, such as snd_pcm_prepare(). Well, first off, PCM prepare will be never reached during runtime PM suspend. Secondly, you seem to misunderstand the concept of snd_power_change_state(). It's for blocking the whole operations until the resume finished. In the case of runtime PM, the resume itself is triggered by the operation. Thus if you call snd_power_change_state(D3) in the runtime suspend, it'd deadlock, since the wake-up operation itself is blocked by that. thanks, Takashi