All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Wang, Xingchao" <xingchao.wang@intel.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] ALSA: HDA - Check return value to reduce useless delay
Date: Thu, 25 Oct 2012 13:08:08 +0200	[thread overview]
Message-ID: <s5hy5iustbb.wl%tiwai@suse.de> (raw)
In-Reply-To: <46B810F6945F7C4788E11DCE57EC48900FF86722@SHSMSX102.ccr.corp.intel.com>

At Thu, 25 Oct 2012 10:30:35 +0000,
Wang, Xingchao wrote:
> 
> 
> 
> > -----Original Message-----
> > From: Takashi Iwai [mailto:tiwai@suse.de]
> > Sent: Thursday, October 25, 2012 6:01 AM
> > To: Wang, Xingchao
> > Cc: alsa-devel@alsa-project.org
> > Subject: Re: [PATCH] ALSA: HDA - Check return value to reduce useless delay
> > 
> > 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?
> > 
> 
> Well I only tested the patch on Haswell/Ivybridge platform.

Both are too new :)

> For Haswell I meet an issue about codec suspend/resume.
> There's no response from codec when there's power state transition from D3 to D0, and the patch could reduced delay time.

But does it fix the issue itself?

> For ivybridge the codec works well, so this patch has no active behavior. 
> I assume the verb 705h will not work for subnodes if it failed at first for "function group".
> Is there such case when set power state for the "Audio Function Group" fail but the sub-nodes could keep on setting power?

Not sure.  But we need more testing obviously before breaking
anything.


thanks,

Takashi


> 
> Thanks
> --xingchao
> 
> > 
> > Takashi
> > 
> > > Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
> > > ---
> > >  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
> > >
> 

  reply	other threads:[~2012-10-25 11:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24  6:53 [PATCH] ALSA: HDA - Check return value to reduce useless delay Wang Xingchao
2012-10-24 22:00 ` Takashi Iwai
2012-10-25 10:30   ` Wang, Xingchao
2012-10-25 11:08     ` Takashi Iwai [this message]
2012-10-26 10:45       ` Wang, Xingchao
2012-10-26 10:59         ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hy5iustbb.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=xingchao.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.