From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ALSA: HDA - Check return value to reduce useless delay Date: Thu, 25 Oct 2012 00:00:36 +0200 Message-ID: References: <1351061603-2433-1-git-send-email-xingchao.wang@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 5F01B26261A for ; Thu, 25 Oct 2012 00:00:37 +0200 (CEST) In-Reply-To: <1351061603-2433-1-git-send-email-xingchao.wang@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 List-Id: alsa-devel@alsa-project.org At Wed, 24 Oct 2012 14:53:23 +0800, Wang Xingchao wrote: > > For verb 705h, it's useless to read response, so use *write api would be > better. If there's error after sending cmd, just try again without continue > after wrong operation.Otherwise there's long time delay. Well, this is a bit sensitive part. Did you do the good test coverage for different hardware controllers and codecs, including the non-Intel ones? Takashi > Signed-off-by: Wang Xingchao > --- > sound/pci/hda/hda_codec.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c > index 960800b..0946eca 100644 > --- a/sound/pci/hda/hda_codec.c > +++ b/sound/pci/hda/hda_codec.c > @@ -3569,6 +3569,7 @@ static unsigned int hda_set_power_state(struct hda_codec *codec, > hda_nid_t fg = codec->afg ? codec->afg : codec->mfg; > int count; > unsigned int state; > + int err; > > /* this delay seems necessary to avoid click noise at power-down */ > if (power_state == AC_PWRST_D3) { > @@ -3582,9 +3583,11 @@ static unsigned int hda_set_power_state(struct hda_codec *codec, > codec->patch_ops.set_power_state(codec, fg, > power_state); > else { > - snd_hda_codec_read(codec, fg, 0, > + err = snd_hda_codec_write(codec, fg, 0, > AC_VERB_SET_POWER_STATE, > power_state); > + if (err < 0) > + continue; > snd_hda_codec_set_power_to_all(codec, fg, power_state, > true); > } > -- > 1.7.9.5 >