Re: intel hda regression: 2.6.33-rc{1,2}: hd-audio0 eats 25% CPU (according to top)

From: Takashi Iwai
Date: Fri Dec 25 2009 - 16:59:36 EST


At Fri, 25 Dec 2009 20:01:46 +0100,
Maciej Rutecki wrote:
>
> 2009/12/25 Takashi Iwai <tiwai@xxxxxxx>:
>
> > diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> > index 950ee5c..f98b47c 100644
> > --- a/sound/pci/hda/hda_codec.c
> > +++ b/sound/pci/hda/hda_codec.c
> > @@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps);
> > Â*/
> > Âu32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid)
> > Â{
> > - Â Â Â u32 pincap = snd_hda_query_pin_caps(codec, nid);
> > -
> > - Â Â Â if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
> > - Â Â Â Â Â Â Â snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
> > + Â Â Â u32 pincap;
> >
> > + Â Â Â if (!codec->no_trigger_sense) {
> > + Â Â Â Â Â Â Â pincap = snd_hda_query_pin_caps(codec, nid);
> > + Â Â Â Â Â Â Â if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
> > + Â Â Â Â Â Â Â Â Â Â Â snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
> > + Â Â Â }
> > Â Â Â Âreturn snd_hda_codec_read(codec, nid, 0,
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂAC_VERB_GET_PIN_SENSE, 0);
> > Â}
> > diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
> > index 1d541b7..0a770a2 100644
> > --- a/sound/pci/hda/hda_codec.h
> > +++ b/sound/pci/hda/hda_codec.h
> > @@ -817,6 +817,7 @@ struct hda_codec {
> > Â Â Â Âunsigned int pin_amp_workaround:1; /* pin out-amp takes index
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â* (e.g. Conexant codecs)
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â*/
> > + Â Â Â unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
> > Â#ifdef CONFIG_SND_HDA_POWER_SAVE
> > Â Â Â Âunsigned int power_on :1; Â Â Â /* current (global) power-state */
> > Â Â Â Âunsigned int power_transition :1; /* power-state in transition */
> > diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
> > index 1a36137..69a941c 100644
> > --- a/sound/pci/hda/patch_analog.c
> > +++ b/sound/pci/hda/patch_analog.c
> > @@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec)
> > Â Â Â Â */
> > Â Â Â Âspec->multiout.no_share_stream = 1;
> >
> > + Â Â Â codec->no_trigger_sense = 1;
> > +
> > Â Â Â Âreturn 0;
> > Â}
> >
> > @@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec)
> >
> > Â Â Â Âcodec->patch_ops = ad198x_patch_ops;
> >
> > + Â Â Â codec->no_trigger_sense = 1;
> > +
> > Â Â Â Âreturn 0;
> > Â}
> >
> > @@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec)
> > Â Â Â Â Â Â Â Âcodec->patch_ops.unsol_event = ad1981_hp_unsol_event;
> > Â Â Â Â Â Â Â Âbreak;
> > Â Â Â Â}
> > +
> > + Â Â Â codec->no_trigger_sense = 1;
> > +
> > Â Â Â Âreturn 0;
> > Â}
> >
> > @@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec)
> > Â#endif
> > Â Â Â Âspec->vmaster_nid = 0x04;
> >
> > + Â Â Â codec->no_trigger_sense = 1;
> > +
> > Â Â Â Âreturn 0;
> > Â}
> >
> > @@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec)
> >
> > Â Â Â Âcodec->patch_ops = ad198x_patch_ops;
> >
> > + Â Â Â codec->no_trigger_sense = 1;
> > +
> > Â Â Â Âreturn 0;
> > Â}
> >
> > @@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec)
> > Â Â Â Â Â Â Â Âbreak;
> > Â Â Â Â}
> >
> > + Â Â Â codec->no_trigger_sense = 1;
> > +
> > Â Â Â Âreturn 0;
> > Â}
> >
> > @@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec)
> > Â Â Â Â Â Â Â Âspec->mixers[2] = ad1882_6stack_mixers;
> > Â Â Â Â Â Â Â Âbreak;
> > Â Â Â Â}
> > +
> > + Â Â Â codec->no_trigger_sense = 1;
> > +
> > Â Â Â Âreturn 0;
> > Â}
> >
> >
> Patch solves the problem.
>
> Tested-by Maciej Rutecki <maciej.rutecki@xxxxxxxxx>

Thanks for testing.
I merged the patch now.


Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/