alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: v3.1.8: hda-intel broken
Date: Wed, 22 Feb 2012 15:31:24 +0000	[thread overview]
Message-ID: <20120222153124.GH22562@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <s5h8vjv2b3i.wl%tiwai@suse.de>

On Wed, Feb 22, 2012 at 03:31:45PM +0100, Takashi Iwai wrote:
> Takashi (going to take a coffee now)

Your coffee seems to have worked.  It no longer warns at boot or
with your aplay test.  You can have a tested-by for this.  Thanks.

> From: Takashi Iwai <tiwai@suse.de>
> Subject: [PATCH] ALSA: hda - Fix redundant jack creations for cx5051
> 
> The cx5051 parser calls snd_hda_input_jack_add() in the init callback
> to create and initialize the jack detection instances.  Since the init
> callback is called at each time when the device gets woken up after
> suspend or power-saving mode, the duplicated instances are accumulated
> at each call.  This ends up with the kernel warnings with the too
> large array size.
> 
> The fix is simply to move the calls of snd_hda_input_jack_add() into
> the parser section instead of the init callback.
> 
> The fix is needed only up to 3.2 kernel, since the HD-audio jack layer
> was redesigned in the 3.3 kernel.
> 
> Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  sound/pci/hda/patch_conexant.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
> index 7072251..08bad5b 100644
> --- a/sound/pci/hda/patch_conexant.c
> +++ b/sound/pci/hda/patch_conexant.c
> @@ -1899,6 +1899,10 @@ static void cxt5051_init_mic_port(struct hda_codec *codec, hda_nid_t nid,
>  	snd_hda_codec_write(codec, nid, 0,
>  			    AC_VERB_SET_UNSOLICITED_ENABLE,
>  			    AC_USRSP_EN | event);
> +}
> +
> +static void cxt5051_init_mic_jack(struct hda_codec *codec, hda_nid_t nid)
> +{
>  	snd_hda_input_jack_add(codec, nid, SND_JACK_MICROPHONE, NULL);
>  	snd_hda_input_jack_report(codec, nid);
>  }
> @@ -1916,7 +1920,6 @@ static int cxt5051_init(struct hda_codec *codec)
>  	struct conexant_spec *spec = codec->spec;
>  
>  	conexant_init(codec);
> -	conexant_init_jacks(codec);
>  
>  	if (spec->auto_mic & AUTO_MIC_PORTB)
>  		cxt5051_init_mic_port(codec, 0x17, CXT5051_PORTB_EVENT);
> @@ -2037,6 +2040,12 @@ static int patch_cxt5051(struct hda_codec *codec)
>  	if (spec->beep_amp)
>  		snd_hda_attach_beep_device(codec, spec->beep_amp);
>  
> +	conexant_init_jacks(codec);
> +	if (spec->auto_mic & AUTO_MIC_PORTB)
> +		cxt5051_init_mic_jack(codec, 0x17);
> +	if (spec->auto_mic & AUTO_MIC_PORTC)
> +		cxt5051_init_mic_jack(codec, 0x18);
> +
>  	return 0;
>  }
>  
> -- 
> 1.7.9
> 

  reply	other threads:[~2012-02-22 15:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 23:58 v3.1.8: hda-intel broken Russell King - ARM Linux
2012-02-22  8:26 ` Takashi Iwai
2012-02-22  8:42   ` Russell King - ARM Linux
2012-02-22  8:59     ` Takashi Iwai
2012-02-22  9:04       ` Russell King - ARM Linux
2012-02-22  9:15         ` Takashi Iwai
2012-02-22 10:38           ` Russell King - ARM Linux
2012-02-22 10:43             ` Takashi Iwai
2012-02-22 11:26               ` Russell King - ARM Linux
2012-02-22 11:47                 ` Takashi Iwai
2012-02-22 14:02   ` Russell King - ARM Linux
2012-02-22 14:28     ` Takashi Iwai
2012-02-22 14:31       ` Takashi Iwai
2012-02-22 15:31         ` Russell King - ARM Linux [this message]
2012-02-22 16:00           ` 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=20120222153124.GH22562@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).