Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Matt Mullins <mokomull@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Fwd: Problems with hda_intel, Santa Rosa, and suspend
Date: Fri, 06 Jul 2007 11:32:29 +0200	[thread overview]
Message-ID: <s5hzm29513m.wl%tiwai@suse.de> (raw)
In-Reply-To: <dfd4051f0707051942n699f69cava8a9d83b3bae5e1@mail.gmail.com>

At Thu, 5 Jul 2007 21:42:21 -0500,
Matt Mullins wrote:
> 
> Found what I think is the problem... patch_sigmatel.c set
> spec->num_pins=14, yet spec->pin_nids pointed to stac9205_pin_nids,
> which was an array of only 12 NIDs.  That caused [total guess here]
> either stac92xx_save_bios_config_regs or stac92xx_set_config_regs to
> read past the end of the array and into an uninitialized area.  I
> changed the 14 to a 12, and it seems to work.  The attached patch is
> against the current Mercurial sources, but I made the similar change
> to kernel 2.6.22-rc7, and it doesn't use single_cmd anymore.

Argh!  Thanks for spotting this nasty bug.

It'd be better to use ARRAY_SIZE there.  Then typos would be more
obvious.  Could you check the patch below?

>  It still
> doesn't work after a suspend, though, making me unload and reload the
> module.

Do you mean you'll get a communication error after suspend, or got no
sound output, or any other problem?


thanks,

Takashi

diff -r 42d31b8a307d pci/hda/patch_sigmatel.c
--- a/pci/hda/patch_sigmatel.c	Thu Jul 05 13:10:51 2007 +0200
+++ b/pci/hda/patch_sigmatel.c	Fri Jul 06 11:30:50 2007 +0200
@@ -1958,7 +1958,7 @@ static int patch_stac9200(struct hda_cod
 		return -ENOMEM;
 
 	codec->spec = spec;
-	spec->num_pins = 8;
+	spec->num_pins = ARRAY_SIZE(stac9200_pin_nids);
 	spec->pin_nids = stac9200_pin_nids;
 	spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS,
 							stac9200_models,
@@ -2008,7 +2008,7 @@ static int patch_stac925x(struct hda_cod
 		return -ENOMEM;
 
 	codec->spec = spec;
-	spec->num_pins = 8;
+	spec->num_pins = ARRAY_SIZE(stac925x_pin_nids);
 	spec->pin_nids = stac925x_pin_nids;
 	spec->board_config = snd_hda_check_board_config(codec, STAC_925x_MODELS,
 							stac925x_models,
@@ -2080,7 +2080,7 @@ static int patch_stac922x(struct hda_cod
 		return -ENOMEM;
 
 	codec->spec = spec;
-	spec->num_pins = 10;
+	spec->num_pins = ARRAY_SIZE(stac922x_pin_nids);
 	spec->pin_nids = stac922x_pin_nids;
 	spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS,
 							stac922x_models,
@@ -2181,7 +2181,7 @@ static int patch_stac927x(struct hda_cod
 		return -ENOMEM;
 
 	codec->spec = spec;
-	spec->num_pins = 14;
+	spec->num_pins = ARRAY_SIZE(stac927x_pin_nids);
 	spec->pin_nids = stac927x_pin_nids;
 	spec->board_config = snd_hda_check_board_config(codec, STAC_927X_MODELS,
 							stac927x_models,
@@ -2259,7 +2259,7 @@ static int patch_stac9205(struct hda_cod
 		return -ENOMEM;
 
 	codec->spec = spec;
-	spec->num_pins = 14;
+	spec->num_pins = ARRAY_SIZE(stac9205_pin_nids);
 	spec->pin_nids = stac9205_pin_nids;
 	spec->board_config = snd_hda_check_board_config(codec, STAC_9205_MODELS,
 							stac9205_models,

  reply	other threads:[~2007-07-06  9:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <dfd4051f0706161836xa191176ke10deff2868ad8d6@mail.gmail.com>
     [not found] ` <200706171149.27547.rjw@sisk.pl>
     [not found]   ` <dfd4051f0706171355i7bc3d4b7qe9aee2acb904c8c@mail.gmail.com>
2007-06-18  0:35     ` Fwd: Problems with hda_intel, Santa Rosa, and suspend Matt Mullins
2007-06-18  0:49       ` Lee Revell
2007-06-18  1:59         ` Matt Mullins
2007-06-19 10:56           ` Takashi Iwai
     [not found]             ` <dfd4051f0706191354i679c5b82pd8d788dfb012df3d@mail.gmail.com>
2007-06-20 10:14               ` Takashi Iwai
2007-06-20 21:18                 ` Matt Mullins
2007-06-21 10:29                   ` Takashi Iwai
2007-06-22 20:31                     ` Matt Mullins
2007-06-25 10:18                       ` Takashi Iwai
     [not found]                         ` <dfd4051f0706251316uf265b3dw9c069dc5f75ceedf@mail.gmail.com>
2007-06-25 20:17                           ` Fwd: " Matt Mullins
2007-06-27 12:42                           ` Takashi Iwai
2007-07-04 20:37                             ` Matt Mullins
2007-07-05 11:03                               ` Takashi Iwai
2007-07-05 22:13                                 ` Matt Mullins
2007-07-06  2:42                                   ` Matt Mullins
2007-07-06  9:32                                     ` Takashi Iwai [this message]
2007-07-06 15:46                                       ` Thorsten Leemhuis
2007-07-06 16:19                                         ` Takashi Iwai
2007-07-06 16:56                                           ` Thorsten Leemhuis
2007-07-09 12:52                                             ` Takashi Iwai
2007-07-09 15:09                                               ` Thorsten Leemhuis
2007-06-29  6:13 albox
2007-06-29 23: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=s5hzm29513m.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=mokomull@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox