Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 112730 - kernel lockup when loading snd-nm256 on dell latitude csx laptop
Summary: kernel lockup when loading snd-nm256 on dell latitude csx laptop
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-16 11:45 UTC by dean
Modified: 2005-12-29 12:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dean 2005-11-16 11:45:05 UTC
the sound module snd-nm256 causes lockup (hard) on (un)load. this happens with
every kernel i have tried. incl the newest development (see emerge -info &&
uname -a) the alsa package will 80% of the time also cause a hard lock on boot @
calculating module dependancies. (no log output >> hard lock..) this occurs with
both alsa and oss.

aether neo # lspci -v
0000:00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host
bridge (rev 03)
        Flags: bus master, medium devsel, latency 32
        Memory at f4000000 (32-bit, prefetchable) [size=64M]
        Capabilities: [a0] AGP version 1.0

0000:00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP
bridge (rev 03) (prog-if 00 [Normal decode])
        Flags: bus master, 66Mhz, medium devsel, latency 32
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
        I/O behind bridge: 0000c000-0000cfff
        Memory behind bridge: fd000000-feffffff
        Prefetchable memory behind bridge: f8000000-fbffffff

0000:00:03.0 CardBus bridge: Texas Instruments PCI1225 (rev 01)
        Subsystem: Dell: Unknown device 0091
        Flags: bus master, medium devsel, latency 168, IRQ 11
        Memory at 10100000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=02, subordinate=05, sec-latency=176
        Memory window 0: 12000000-13fff000 (prefetchable)
        Memory window 1: 14000000-15fff000
        I/O window 0: 00001000-00001fff
        I/O window 1: 00002000-00002fff
        16-bit legacy interface ports at 0001

0000:00:03.1 CardBus bridge: Texas Instruments PCI1225 (rev 01)
        Subsystem: Dell: Unknown device 0091
        Flags: bus master, medium devsel, latency 168, IRQ 11
        Memory at 10101000 (32-bit, non-prefetchable) [size=4K]
        Bus: primary=00, secondary=06, subordinate=09, sec-latency=176
        Memory window 0: 16000000-17fff000 (prefetchable)
        Memory window 1: 18000000-19fff000
        I/O window 0: 00003000-00003fff
        I/O window 1: 00004000-00004fff
        16-bit legacy interface ports at 0001

0000:00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 02)
        Flags: bus master, medium devsel, latency 0

0000:00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
(prog-if 80 [Master])
        Flags: bus master, medium devsel, latency 32
        I/O ports at 0860 [size=16]

0000:00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
(prog-if 00 [UHCI])
        Flags: bus master, medium devsel, latency 32, IRQ 11
        I/O ports at ece0 [size=32]

0000:00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
        Flags: medium devsel, IRQ 9

0000:01:00.0 VGA compatible controller: Neomagic Corporation NM2360 [MagicMedia
256ZX] (prog-if 00 [VGA])
        Subsystem: Dell: Unknown device 0091
        Flags: bus master, medium devsel, latency 32, IRQ 11
        Memory at fa000000 (32-bit, prefetchable) [size=32M]
        Memory at fdc00000 (32-bit, non-prefetchable) [size=4M]
        Memory at fdb00000 (32-bit, non-prefetchable) [size=1M]
        Capabilities: [dc] Power Management version 1

0000:01:00.1 Multimedia audio controller: Neomagic Corporation NM2360
[MagicMedia 256ZX Audio]
        Subsystem: Dell: Unknown device 0091
        Flags: medium devsel, IRQ 5
        Memory at f9800000 (32-bit, prefetchable) [disabled] [size=8M]
        Memory at fda00000 (32-bit, non-prefetchable) [disabled] [size=1M]
        Capabilities: [dc] Power Management version 1

0000:02:00.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless
LAN Controller (rev 03)
        Subsystem: Linksys WPC54G
        Flags: bus master, fast devsel, latency 64, IRQ 11
        Memory at 14000000 (32-bit, non-prefetchable) [size=8K]
        Capabilities: [40] Power Management version 2

aether neo # uname -a
Linux aether 2.6.13-gentoo-r3 #5 Fri Nov 4 14:44:07 UTC 2005 i686 Pentium III
(Coppermine) GenuineIntel GNU/Linux








Reproducible: Always
Steps to Reproduce:
1.install gentoo on dell latitude csx
2.build kernel w/ either alsa or oss
3.modprobe snd-nm256

Actual Results:  
hard lock. power cycle necessary, no log output, no dmesg output.

Expected Results:  
load module and init sound subsystem

aether neo # emerge --info
Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2,
2.6.13-gentoo-r3 i686)
=================================================================
System uname: 2.6.13-gentoo-r3 i686 Pentium III (Coppermine)
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts audiofile avi berkdb bitmap-fonts bzip2 cdb cdr crypt
cups curl dvd eds emboss encode esd exif expat fam ffmpeg flac foomaticdb
fortran gdbm gif glut gnome gpm gstreamer gtk gtk2 idn imlib ipv6 java jpeg kde
lcms ldap libg++ libwww mad mikmod mng motif mozilla mp3 mpeg mysql ncurses nls
ogg oggvorbis openal opengl oss pam pcre pdflib perl png python qt quicktime
readline sdl server spell ssl svga tcltk tcpd tiff truetype truetype-fonts
type1-fonts udev vorbis xine xml2 xmms xv xvid zlib video_cards_neomagic
userland_GNU kernel_linux elibc_glibc"
U
Comment 1 Daniel Drake (RETIRED) gentoo-dev 2005-11-18 08:57:32 UTC
Please try and reproduce on the latest stable kernel (2.6.14)
Comment 2 dean 2005-11-18 15:49:25 UTC
attempted as requested with kernel  
 
mordjah@aether /usr/portage $ uname -a 
Linux aether 2.6.14-gentoo-r2 #1 PREEMPT Sat Nov 19 11:58:39 UTC 2005 i686 
Pentium III (Coppermine) GenuineIntel GNU/Linux 
 
same result.. hard lockup. 
 
Comment 3 dean 2005-11-18 17:33:02 UTC
i found this patch while googling.. but it will not apply cleanly to 
gentoo-sources.. maby the code will help..? (hope i didnt bork my source tree 
messing about..) the code doesnt mean a whole lot to me, but then im not a 
kernel developer.. patch text follows... 
 
 
aether linux # patch -p1 < snd-nm256.diff 
patching file sound/pci/nm256/nm256.c 
Hunk #3 FAILED at 229. 
Hunk #4 FAILED at 1203. 
Hunk #5 succeeded at 1549 with fuzz 1. 
Hunk #6 FAILED at 1558. 
Hunk #7 FAILED at 1591. 
Hunk #8 FAILED at 1650. 
5 out of 8 hunks FAILED -- saving rejects to file sound/pci/nm256/nm256.c.rej 
aether linux # patch -p1 < snd-nm256.diff 
patching file sound/pci/nm256/nm256.c 
Reversed (or previously applied) patch detected!  Assume -R? [n] y 
Hunk #3 FAILED at 226. 
Hunk #4 FAILED at 1199. 
Hunk #5 succeeded at 1538 with fuzz 1 (offset -4 lines). 
Hunk #6 FAILED at 1547. 
Hunk #7 FAILED at 1578. 
Hunk #8 FAILED at 1634. 
5 out of 8 hunks FAILED -- saving rejects to file sound/pci/nm256/nm256.c.rej 
aether linux # cat *diff 
sound/pci/nm256/nm256.c |   23 ++++++++++++++++++++--- 
 1 files changed, 20 insertions(+), 3 deletions(-) 
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c 
--- a/sound/pci/nm256/nm256.c 
+++ b/sound/pci/nm256/nm256.c 
@@ -62,6 +62,7 @@ static int buffer_top[SNDRV_CARDS] = {[0 
 static int use_cache[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* 
disabled */ 
 static int vaio_hack[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* 
disabled */ 
 static int reset_workaround[SNDRV_CARDS]; 
+static int reset_workaround_2[SNDRV_CARDS]; 
 
 module_param_array(index, int, NULL, 0444); 
 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); 
@@ -83,6 +84,8 @@ module_param_array(vaio_hack, bool, NULL 
 MODULE_PARM_DESC(vaio_hack, "Enable workaround for Sony VAIO notebooks."); 
 module_param_array(reset_workaround, bool, NULL, 0444); 
 MODULE_PARM_DESC(reset_workaround, "Enable AC97 RESET workaround for some 
laptops."); 
+module_param_array(reset_workaround_2, bool, NULL, 0444); 
+MODULE_PARM_DESC(reset_workaround_2, "Enable extended AC97 RESET workaround 
for some other laptops."); 
 
 /* 
  * hw definitions 
@@ -226,6 +229,7 @@ struct snd_nm256 { 
        unsigned int coeffs_current: 1; /* coeff. table is loaded? */ 
        unsigned int use_cache: 1;      /* use one big coef. table */ 
        unsigned int reset_workaround: 1; /* Workaround for some laptops to 
avoid freeze */ 
+       unsigned int reset_workaround_2: 1; /* Extended workaround for some 
other laptops to avoid freeze */ 
 
        int mixer_base;                 /* register offset of ac97 mixer */ 
        int mixer_status_offset;        /* offset of mixer status reg. */ 
@@ -1199,8 +1203,11 @@ snd_nm256_ac97_reset(ac97_t *ac97) 
                /* Dell latitude LS will lock up by this */ 
                snd_nm256_writeb(chip, 0x6cc, 0x87); 
        } 
-       snd_nm256_writeb(chip, 0x6cc, 0x80); 
-       snd_nm256_writeb(chip, 0x6cc, 0x0); 
+       if (! chip->reset_workaround_2) { 
+               /* Dell latitude CSx will lock up by this */ 
+               snd_nm256_writeb(chip, 0x6cc, 0x80); 
+               snd_nm256_writeb(chip, 0x6cc, 0x0); 
+       } 
 } 
 
 /* create an ac97 mixer interface */ 
@@ -1542,7 +1549,7 @@ struct nm256_quirk { 
        int type; 
 }; 
 
-enum { NM_BLACKLISTED, NM_RESET_WORKAROUND }; 
+enum { NM_BLACKLISTED, NM_RESET_WORKAROUND, NM_RESET_WORKAROUND_2 }; 
 
 static struct nm256_quirk nm256_quirks[] __devinitdata = { 
        /* HP omnibook 4150 has cs4232 codec internally */ 
@@ -1551,6 +1558,8 @@ static struct nm256_quirk nm256_quirks[] 
        { .vendor = 0x104d, .device = 0x8041, .type = NM_RESET_WORKAROUND }, 
        /* Dell Latitude LS */ 
        { .vendor = 0x1028, .device = 0x0080, .type = NM_RESET_WORKAROUND }, 
+       /* Dell Latitude CSx */ 
+       { .vendor = 0x1028, .device = 0x0091, .type = NM_RESET_WORKAROUND_2 }, 
        { } /* terminator */ 
 }; 
 
@@ -1582,6 +1591,9 @@ static int __devinit snd_nm256_probe(str 
                        case NM_BLACKLISTED: 
                                printk(KERN_INFO "nm256: The device is 
blacklisted.  Loading stopped\n"); 
                                return -ENODEV; 
+                       case NM_RESET_WORKAROUND_2: 
+                               reset_workaround_2[dev] = 1; 
+                               /* Fall-through */ 
                        case NM_RESET_WORKAROUND: 
                                reset_workaround[dev] = 1; 
                                break; 
@@ -1638,6 +1650,11 @@ static int __devinit snd_nm256_probe(str 
                chip->reset_workaround = 1; 
        } 
 
+       if (reset_workaround_2[dev]) { 
+               snd_printdd(KERN_INFO "nm256: reset_workaround_2 activated\n"); 
+               chip->reset_workaround_2 = 1; 
+       } 
+ 
        if ((err = snd_nm256_pcm(chip, 0)) < 0 || 
            (err = snd_nm256_mixer(chip)) < 0) { 
                snd_card_free(card); 
- 
 
Comment 4 dean 2005-11-18 17:40:00 UTC
testing semi-applied patch as indicated in last update.. will commit incase of 
lock. next replay will indicate success/failure.. 
Comment 5 dean 2005-11-18 19:27:37 UTC
the patch *did* work. i loaded the modules with no problems, and i now have 
sound. do not know how reliable this is as i have not tried to unload it. 
please have a look at that patch, and maby include it in a future release? 
Comment 6 dean 2005-11-20 14:11:58 UTC
update... this is NOT a solution.. it made the problem intermittant is all.
Comment 7 Daniel Drake (RETIRED) gentoo-dev 2005-11-27 06:17:09 UTC
Please test vanilla-sources-2.6.15_rc2 -- this patch has already been applied there.
Comment 8 Daniel Drake (RETIRED) gentoo-dev 2005-12-29 12:09:17 UTC
This should be fixed in the recent releases as the patch was merged into linux-stable. Please reopen with new info if not.