Re: [boot crash, bisected] in 9f240a55 "ALSA: opti93x: use cs4231 lib"

Previous thread: PATCH] block: update add_partition() error handling by Rufus & Azrael on Monday, July 14, 2008 - 2:07 am. (2 messages)

Next thread: Microblaze architecture - ACK by Michal Simek on Monday, July 14, 2008 - 2:18 am. (2 messages)
From: Jaroslav Kysela
Date: Monday, July 14, 2008 - 2:09 am

Linus, please pull from:

  git pull git://git.alsa-project.org/alsa-kernel.git for-linus

gitweb interface:

  http://git.alsa-project.org/?p=3Dalsa-kernel.git;a=3Dshortlog;h=3Dfor-lin=
us

The GNU patch is available at:

  ftp://ftp.alsa-project.org/pub/kernel-patches/alsa-git-for-linus-2008-07-=
14.patch.gz
 =20
The following files will be updated:

 Documentation/sound/alsa/ALSA-Configuration.txt    |   17 +-
 .../sound/alsa/DocBook/writing-an-alsa-driver.tmpl |    4 +-
 include/asm-mips/mach-au1x00/au1xxx_psc.h          |    8 +
 include/sound/ad1843.h                             |   46 +
 include/sound/control.h                            |    3 -
 include/sound/core.h                               |    8 +-
 include/sound/cs4231-regs.h                        |    8 +
 include/sound/cs4231.h                             |    3 +
 include/sound/emu10k1.h                            |    1 +
 include/sound/seq_kernel.h                         |    2 +-
 include/sound/soc-dapm.h                           |   42 +-
 include/sound/soc.h                                |  175 ++-
 include/sound/uda1341.h                            |    2 -
 include/sound/version.h                            |    4 +-
 sound/Kconfig                                      |   34 +-
 sound/aoa/Kconfig                                  |   11 +-
 sound/aoa/codecs/Kconfig                           |    4 -
 sound/aoa/fabrics/Kconfig                          |    1 -
 sound/aoa/soundbus/Kconfig                         |    1 -
 sound/arm/Kconfig                                  |   21 +-
 sound/arm/sa11xx-uda1341.c                         |    2 -
 sound/core/Kconfig                                 |   29 +-
 sound/core/control.c                               |    7 +-
 sound/core/init.c                                  |   67 +-
 sound/core/memalloc.c                              |   62 -
 sound/core/seq/seq_clientmgr.c                     |    2 +-
 sound/core/seq/seq_device.c                 ...
From: Ingo Molnar
Date: Thursday, July 17, 2008 - 10:06 am

hi Jaroslav, et al,


-tip testing found the following bootup crash on latest -git:
    
    [   44.827459] calling  alsa_card_opti9xx_init+0x0/0x20
    [   44.830435] bus: 'isa': add driver opti93x
    [   44.833503] device: 'opti93x.0': device_add
    [   44.837804] bus: 'isa': add device opti93x.0
    [   44.841820] bus: 'isa': driver_probe_device: matched device opti93x.0 with driver opti93x
    [   44.845327] bus: 'isa': really_probe: probing driver opti93x with device opti93x.0
    [   44.851601] BUG: unable to handle kernel NULL pointer dereference at 00000010
    [   44.855329] IP: [<786c0782>] snd_card_opti9xx_free+0x12/0x40
    [   44.859370] *pde = 00000000
    [   44.862651] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    [   44.862651]
    [   44.862651] Pid: 1, comm: swapper Not tainted (2.6.26-00085-g9f240a5-dirty #20182)
    [   44.862651] EIP: 0060:[<786c0782>] EFLAGS: 00010286 CPU: 0
    [   44.862651] EIP is at snd_card_opti9xx_free+0x12/0x40
    [   44.862651] EAX: 96892000 EBX: 00000000 ECX: 96892140 EDX: 786c0770
    [   44.862651] ESI: 9689229c EDI: 9689229c EBP: 9782fe10 ESP: 9782fe08
    [   44.862651]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
    [   44.862651] Process swapper (pid: 1, ti=9782f000 task=97848000 task.ti=9782f000)
    [   44.862651] Stack: 96892000 00000286 9782fe1c 786a2b5b 96892000 9782fe48 786a349d 00000000
    [   44.862651]        00000286 78b34028 9688a100 00000286 9689229c fffff000 00000286 9689229c
    [   44.862651]        9782fe84 787f4b18 968922c0 9689229f 9688dc00 96892000 00000004 00000000
    [   44.862651] Call Trace:
    [   44.862651]  [<786a2b5b>] ? snd_card_do_free+0x4b/0x120
    [   44.862651]  [<786a349d>] ? snd_card_free+0x7d/0x90
    [   44.862651]  [<787f4b18>] ? snd_opti9xx_isa_probe+0x158/0xa30
    [   44.862651]  [<787f49c0>] ? snd_opti9xx_isa_probe+0x0/0xa30
    [   44.862651]  [<7832580d>] ? isa_bus_probe+0x1d/0x30
    [   44.862651]  [<783229c0>] ? driver_probe_device+0xa0/0x1c0
    [   44.862651]  ...
From: Takashi Iwai
Date: Thursday, July 17, 2008 - 11:40 am

At Thu, 17 Jul 2008 19:06:57 +0200,

Could you try the patch below?


thanks,

Takashi

---
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 41c047e..d20abb2 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -688,7 +688,7 @@ static void snd_card_opti9xx_free(struct snd_card *card)
 	if (chip) {
 #ifdef OPTi93X
 		struct snd_cs4231 *codec = chip->codec;
-		if (codec->irq > 0) {
+		if (codec && codec->irq > 0) {
 			disable_irq(codec->irq);
 			free_irq(codec->irq, codec);
 		}
--

From: Rene Herman
Date: Thursday, July 17, 2008 - 12:20 pm

No, please hang on, it's much simpler. Above commit isn't actually 
itself guilty. Have a patch ready, but am testing a bit.

Rene.
--

From: Rene Herman
Date: Thursday, July 17, 2008 - 12:38 pm

I retract that. Your patch should fix things.

I would like to place something on top to make the init isa/pnp choice 
look more generic but I'll submit that tomorrow.

Rene.



--

From: Rene Herman
Date: Friday, July 18, 2008 - 2:19 am

This bug was uncovered by !CONFIG_PNP and we had trouble in this driver 
due to that before so was rewriting the init to be a generic multi-card 
ALSA init but, actually, not much point.

The hardware fundamentally doesn't support more than one card per system 
due to the fixed chip->mc_base and the bug was in this case not _caused_ 
but only uncovered by !CONFIG_PNP (it triggers for CONFIG_PNP after 
supplying "isapnp=0" as a module param) so I'll just wait for the next 
time this ifdeffed together mess breaks on !CONFIG_PNP to make the init 
look generic ;-)

In fact, in the meantime I'll look at splitting 92x and 93x again. It's 
much better now that Krzysztof made it use the generic library code but 
I still hate this driver. It's also poking at ports without being told 
something is there by either system or user.

Trivial remainder of init rewrite that's still applicable:

Rene.

From: Krzysztof Helt
Date: Friday, July 18, 2008 - 5:28 am

On Fri, 18 Jul 2008 11:19:19 +0200

The bug was introduced by the patch as it used (tried to free) the codec pointer
before it was assigned any value. It happened only if the card was missing and
I didn't test the driver on such a configuration. My mistake. The CONFIG_PNP

Please hold your axe until Monday. The last patch (not posted yet) from the 
unification of the WSS library series removes some ifdefs in this driver.
This may (or may not) change your view on splitting the driver.

Regards,
Krzysztof

----------------------------------------------------------------------
Zobacz cala prawde o Lukaszu Podolskim!
kliknij >>> http://link.interia.pl/f1e57

--

From: Rene Herman
Date: Friday, July 18, 2008 - 5:36 am

Yes it does. Note how the ISA match method fails due to "if (isapnp)" 
with CONFIG_PNP and isapnp being initialized to 1. I did test without 

Will do.

Rene.

--

From: Rene Herman
Date: Friday, July 18, 2008 - 5:39 am

(but please note, yes, "uncovered", not "caused". the bug was indeed in 
this commit and was fixed by Takashi).

Rene.

--

From: Ingo Molnar
Date: Friday, July 18, 2008 - 1:15 pm

box survived dozens of reboots so the fix from yesterday indeed did the 
trick.

thanks,

	Ingo
--

From: Ingo Molnar
Date: Friday, July 18, 2008 - 1:44 am

yeah, looks like it should fix the issue. Please consider this bug:

  Tested-by: Ingo Molnar <mingo@elte.hu>
  Acked-by: Ingo Molnar <mingo@elte.hu>

unless i mail about a new crash in the next 24 hours. I've queued up 
your fix for testing. (and have removed the revert from the test setup)

	Ingo
--

From: Guillaume Chazarain
Date: Sunday, August 24, 2008 - 2:30 pm

This commit introduces a regression from 2.6.26 on my MacBookPro 3,1.
I lose the "Front" mixer entry but this I don't mind.
The actual regression is that when I plug headphones, the internal
speakers are not muted anymore so I hear the sound from both outputs
(headphones & internal). Reverting this commit fixes the problem for
me.

Thanks.

commit 3e0e469fa216ec70c93b1593821b759d19ee2e6b
Author: Travis Place <wishie@wishie.net>
Date:   Fri Jun 20 16:51:45 2008 +0200

    ALSA: hda - Added model selection for iMac 24"

    Added the SSID of a known iMac 24" to automatically use
    ALC885_IMAC24 quirk.

    Signed-off-by: Travis Place <wishie@wishie.net>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Jaroslav Kysela <perex@perex.cz>

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 61f8c13..d96a876 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6192,6 +6192,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG),
        SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
        SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
+       SND_PCI_QUIRK(0x106b, 0x00a0, "Apple iMac 24''", ALC885_IMAC24),
        SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
        SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /*
MSI-1049 T8  */
        SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),



-- 
Guillaume
--

From: Takashi Iwai
Date: Sunday, August 24, 2008 - 10:50 pm

At Sun, 24 Aug 2008 23:30:08 +0200,

OK, this must be a conflict of PCI SSID.  Apple seems to assign the
same PCI SSID for completely different models.

I guess it's fixed as well by passing model=auto?

Anyway, please run alsa-info.sh with --no-upload option, and attach
the generated file.  The script is found in
    http://www.alsa-project.org/alsa-info.sh

thanks,

Takashi
--

From: Guillaume Chazarain
Date: Monday, August 25, 2008 - 2:36 pm

Here you go.

Thanks.

-- 
Guillaume
From: Guillaume Chazarain
Date: Monday, August 25, 2008 - 3:43 pm

I spoke too soon, with model=auto I get back the "Front" mixer that I
used during the git bisection to find the culprit, but I get no sound

alsa-info-good.txt actually contained the output of alsa-info.sh with
model=auto, so it's not good.
Here is the output with the commit reverted, so sound is working.
Looks like the revert brings back the "Speaker" switch which I need.

Sorry for the confusion.

-- 
Guillaume
From: Takashi Iwai
Date: Monday, August 25, 2008 - 10:59 pm

At Tue, 26 Aug 2008 00:43:59 +0200,

This is odd.
Are you sure both are the same kernel but just one commit reverted?


Takashi
--

From: Guillaume Chazarain
Date: Tuesday, August 26, 2008 - 2:10 pm

I retested, yes.
With or without the revert, model=auto disables sound completely, and
I get this in dmesg:

HDA Intel 0000:00:1b.0: PCI INT A disabled
HDA Intel 0000:00:1b.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
HDA Intel 0000:00:1b.0: setting latency timer to 64
ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:2325: hda_codec:
model 'auto' is selected
ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3021: autoconfig:
line_outs=1 (0x14/0x0/0x0/0x0/0x0)
ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3025:
speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3029:    hp_outs=1
(0x15/0x0/0x0/0x0/0x0)
ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3030:    mono: mono_out=0x0
ALSA /home/g/linux-2.6/sound/pci/hda/hda_codec.c:3038:    inputs:
mic=0x18, fmic=0x0, line=0x1a, fline=0x0, cd=0x0, aux=0x0

I played with model=intel-mac-auto and model=intel-mac-v3 but it had
no effect, i.e. same as without the model= parameter.

So, without model=auto the problem is that I get the output on both
the internal speakers and the headphones, and this is fixed by
reverting the commit.

Thanks.

-- 
Guillaume
--

From: Takashi Iwai
Date: Tuesday, August 26, 2008 - 11:02 pm

At Tue, 26 Aug 2008 23:10:55 +0200,


Then this is really a PCI SSID conflict, and reverting the patch is
the right fix (and possibly addition of check of codec SID).

I fixed it now on my tree, and will include it in the next pull
request.


thanks,

Takashi
--

Previous thread: PATCH] block: update add_partition() error handling by Rufus & Azrael on Monday, July 14, 2008 - 2:07 am. (2 messages)

Next thread: Microblaze architecture - ACK by Michal Simek on Monday, July 14, 2008 - 2:18 am. (2 messages)