# kernel BUG at drivers/pci/msi.c:152[SOLVED]

## Fadoksi

Hello people.

I am getting the following kernel bug every time I shut down my computer.

```

sd 1:0:0:0:0 [sdb] Synchronizing SCSI cache

sd 1:0:0:0:0 [sdb] Stopping disk

sd 0:0:0:0:0 [sda] Synchronizing SCSI cache

sd 0:0:0:0:0 [sda] Stopping disk

Disabling non-boot CPUs ...

kvm: disabling virtualization on CPU1

-----------[ cut here ] -----------

kernel BUG at drivers/pci/msi.c:152

invalid opcode: 0000 [#1]

SMP

Modules linked in: bridge llc hwmon i2c_dev xt_tcpudp xt_state iptable_filter ipt_log ipt_iprange

iptable_nat nf_nat nf_conntrack ipt_tables fglrx(P)

CPU: 1

EIP: 0060:[<c02540a1>] Tainted: P   VLI

EFLAGS: 00010093 (2.6.23-gentoo-r3 #1)

EIP is at read_msi_msg+0xb1/0xb8

eax: 00000000 ebx: 00006c80 ecx: c0117d44 edx: da185f80

esi: e0da8780 edi: da175f80 rbp: 00000001 esp: da185f64

ds: 007b es: 007b fs: 00d8 gs: 0000 ss: 0068

Process kstopmachine (pid 21865, ti=da184000 task=afc1d540 task.ti=da184000)

Stack: 000000d9 00000082 00006c80 000000d9 00000042 00000001 c0117d63 c0117a25

       00000016 01000000 00006c80 000000d9 00000001 00000000 c0105a0e c051fee4

       c0115725 00000001 00000001 dcf45e1c 0000556a c0115ba0 00000001 00000020

Call Trace:

[<c0117d63>] set_msi_irq_affinity+0x1f/0x57

[<c0117a25>] set_ioapic_affinity_irq+0x4a/0x81

[<c0105a0e>] fixup_irqs+0x5a/0xa4

[<c0115725>] remove_siblinginfo+0x6d/0xa4

[<c0115ba0>] __cpu_disable+0x51/0x5e

[<c013bfbd>] take_cpu_down+0x17/0x23

[<c0143d11>] do_stop+0xab/0xf2

[<c0143c66>] do_stop+0x0/0xf2

[<c0132087>] kthread+0x38/0x5d

[<c013204f>] kthread+0x0/0x5d

[<c01049fb>] kernel_thread_helper+0x7/0x10

Code: 64 ff ef 0f b7 44 24 06 eb 17 0f b7 46 02 c1 e0 04 03 46 14 8b 50 04 89 57 04 8b 40 08 89 47 08 59 5b 5e 5f 5d c3 <0f> 0b eb fe 90 90 90 56

89 c6 53 89 d3 31 d2 8b 4c 96 20 81 f9

EIP[<c02540a1>] read_msi_msg+0xb1/0xb8 ss: ESP 0068 da:185f64

```

Does anyone know what is the cause to this? And some fix or workaround.

There maybe typos or something, since there was no way to copy-paste this. I had to write it to a paper and then to computer.

P.S The error doesn't come if I reboot my computer, only when I shut down.

Thank you  :Smile: Last edited by Fadoksi on Mon Feb 11, 2008 5:47 am; edited 1 time in total

----------

## OmSai

Googling drivers/pci/msi.c:152 gave one result in the French Gentoo forum  :Razz: 

The translation said it's related to sound configuration.

Are you using kernel sound or alsa-driver?

Are you having any trouble with your sound?

Regardless, to find why that's happening, please post your output of emerge --info and aadebug

----------

## Fadoksi

Thanks for your reply.

I am using the kernel's sound drivers. And I don't have any problems with sound.

My emerge --info

```

Portage 2.1.3.19 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo-r3 i686)

=================================================================

System uname: 2.6.23-gentoo-r3 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 4800+

Timestamp of tree: Sat, 09 Feb 2008 09:46:01 +0000

distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p17-r1

dev-java/java-config: 1.3.7, 2.1.4

dev-lang/python:     2.4.4-r6

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.10-r5

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.23-r3

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=k8 -pipe -fomit-frame-pointer -O2"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-march=k8 -pipe -fomit-frame-pointer -O2"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/ "

LANG="fi_FI@euro"

LC_ALL="fi_FI@euro"

MAKEOPTS="-j4"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X a52 aac acl acpi alsa berkdb bitmap-fonts bluetooth bzip2 cairo cdr cli cracklib crypt cups dbus dri dvd dvdr fbcon ffmpeg flac fortran ftp gdbm gif glitz gmp gpm gstreamer gtk hal iconv ipv6 isdnlog java joystick jpeg kde midi mmap mmx mmxext mng mp3 mpeg mplayer msn mudflap ncurses nls nptl nptlonly ogg opengl openmp oss pam pcre perl png pppd python qt3 qt4 readline reflection ruby samba sdl session spl sse sse2 ssl svg syslog tcl tcpd tk truetype-fonts type1-fonts unicode win32codecs x86 xcomposite xinerama xorg xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="radeon fglrx"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

And the output of aadebug:

```

ALSA Audio Debug v0.1.0 - Sun Feb 10 21:37:12 EET 2008

http://alsa.opensrc.org/aadebug

http://www.gnu.org/licenses/gpl.txt

Kernel ----------------------------------------------------

Linux lousku 2.6.23-gentoo-r3 #1 SMP Wed Jan 23 19:42:32 Local time zone must be

 set--see zic  i686 AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ AuthenticAMD

GNU/Linux

Loaded Modules --------------------------------------------

snd_seq_oss            29824  0

snd_seq_midi_event      9600  1 snd_seq_oss

snd_seq                44624  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          9996  2 snd_seq_oss,snd_seq

snd_pcm_oss            38048  0

snd_mixer_oss          16640  1 snd_pcm_oss

snd_hda_intel         256668  0

snd_pcm                64516  2 snd_pcm_oss,snd_hda_intel

snd_timer              20228  2 snd_seq,snd_pcm

snd                    42468  8 snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,s

nd_mixer_oss,snd_hda_intel,snd_pcm,snd_timer

snd_page_alloc         11272  2 snd_hda_intel,snd_pcm

Proc Config -----------------------------------------------

CONFIG_SOUND=y

# CONFIG_SND is not set

# CONFIG_SOUND_PRIME is not set

Modprobe Conf ---------------------------------------------

alias char-major-10-116 snd

alias char-major-14-* soundcore

alias char-major-116-* snd

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

options snd cards_limit=1

Proc Asound -----------------------------------------------

Advanced Linux Sound Architecture Driver Version 1.0.14 (Fri Jul 20 09:12:58 200

7 UTC).

 0 [NVidia         ]: HDA-Intel - HDA NVidia

                      HDA NVidia at 0xfeaf4000 irq 17

  0: [ 0]   : control

  1:        : sequencer

 16: [ 0- 0]: digital audio playback

 24: [ 0- 0]: digital audio capture

 26: [ 0- 2]: digital audio capture

 33:        : timer

cat: /proc/asound/hwdep: No such file or directory

00-02: ALC883 Analog : ALC883 Analog : capture 2

00-00: ALC883 Analog : ALC883 Analog : playback 1 : capture 2

Client info

  cur  clients : 2

  peak clients : 2

  max  clients : 192

Client   0 : "System" [Kernel]

  Port   0 : "Timer" (Rwe-)

  Port   1 : "Announce" (R-e-)

    Connecting To: 15:0

Client  15 : "OSS sequencer" [Kernel]

  Port   0 : "Receiver" (-we-)

    Connected From: 0:1

Dev Snd ---------------------------------------------------

controlC0  pcmC0D0c  pcmC0D0p  pcmC0D2c  seq  timer

CPU -------------------------------------------------------

model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 4800+

cpu MHz         : 2500.000

model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 4800+

cpu MHz         : 2500.000

RAM -------------------------------------------------------

MemTotal:      2074500 kB

SwapTotal:     1951856 kB

Hardware --------------------------------------------------

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

```

----------

## OmSai

 *Fadoksi wrote:*   

> Thanks for your reply.
> 
> I am using the kernel's sound drivers. And I don't have any problems with sound.
> 
> My emerge --info
> ...

   :Shocked: 

I believe you're supposed to do an x86_64 install (also called amd64) for the X2 4800+, not an i686

Perhaps that's what is causing the problem

But then, unfortunately, to switch to x86_64 requires a re-install.

Also why are you using MAKEOPTS="-j4" when you have 2 cores?  It should be "-j3"

----------

## Fadoksi

Im using 32bit system, since flash player and some other programs don't work in 64bit.

The makeopts is probably a typing error since I did the make.conf and others in hurry when I was installing  :Razz:  I fixed it now, but AFAIK it shouldn't affect anything other than the performance in compiling?

----------

## OmSai

 *Fadoksi wrote:*   

> Im using 32bit system, since flash player and some other programs don't work in 64bit.

 A 64-bit profile install is by default a multi-lib install, so you have complete backwards compatibility with 32-bits.

I use 32-bit firefox (firefox-bin) on my amd64 3800.

Back on topic -

Line 152 in /usr/src/linux/drivers/pci/msi.c corresponds to the read_msi_msg() function

Try upgrading your kernel to the testing versions and see if the problem is fixed.

Upstream acknowledges that that function is a bit buggy.

So if upgrading your kernel to the latest doesn't solve things, file a bug report at bugs.gentoo.org

----------

## Fadoksi

I solved the problem!

I recompiled the kernel without the KVM Virtualization and now I can shut down "cleanly"

Thanks for your help, I appreciate it.

I guess I'll do a 64bit installation when I have time for it.

----------

## OmSai

Fadoksi,

Could you please file your situation as a kernel bug at bugs.gentoo.org?

Perhaps it could be related to a bigger problem.

KVM Virtualization has been included in the kernel since 2.6.20 so the devs might be interested in taking a poke at it or sending it upstream.

----------

## DiamondDog

I recompiled the kernel without the KVM Virtualization and it didnt fixed the problem.

so please "unsolve" this topic.

----------

## OmSai

DiamondDog, Fadoksi can you both please ompload your /usr/src/linux/.config

DiamondDog, then you can diff the configurations and see what option is enabled in your config that needs to be disabled:

```
diff -y --suppress-common-lines -W 100 /path/to/diamonds/.config /path/to/fadoskis/.config | grep -v \> | grep -v \<
```

----------

## amk

Observed the problem with Lenovo T60 after upgrade from 2.6.20 to 2.6.24.

Removed CONFIG_PCI_MSI from .config. It does not appear missing.

Menuconfig help is also not really sure of the benefits:

"If you don't know what to do here, say N."

----------

