Bug 7481

Summary: oops after rmmod pcmcia and find /sys
Product: Drivers Reporter: Pavol Gono (Palo.Gono)
Component: PCMCIAAssignee: linux-pcmcia
Status: RESOLVED CODE_FIX    
Severity: normal    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.18.2 Subsystem:
Regression: --- Bisected commit-id:
Attachments: pcmcia-ds-rmmod-unregister.patch

Description Pavol Gono 2006-11-09 19:49:17 UTC
Distribution: Debian etch

Hardware Environment:
Lifebook E8110
http://www.fujitsu-siemens.com/products/mobile/notebooks/lifebook_e.html
http://vilpublic.fujitsu-siemens.com/vil/pc/vil/datenblaetter/mobile/en/ds_lifebook_e8110_e8210.pdf
http://www.o2micro.com/products/prod_4in1.html
lspci:
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT
Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML
Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express
Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition
Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1
(rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2
(rev 02)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3
(rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI
Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge
(rev 02)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller
(rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA
Storage Controller IDE (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8055 PCI-E Gigabit
Ethernet Controller (rev 12)
05:00.0 Ethernet controller: Atheros Communications, Inc. Unknown device 001c
(rev 01)
08:03.0 CardBus bridge: O2 Micro, Inc. OZ711MP1/MS1 MemoryCardBus Controller
(rev 21)
08:03.1 CardBus bridge: O2 Micro, Inc. OZ711MP1/MS1 MemoryCardBus Controller
(rev 21)
08:03.2 Generic system peripheral [0805]: O2 Micro, Inc. Integrated MMC/SD
Controller (rev 01)
08:03.3 Bridge: O2 Micro, Inc. Integrated MS/xD Controller (rev 01)
08:03.4 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02)

Software Environment:
scripts/ver_linux:
Linux pgnotas 2.6.18.2-n05 #1 SMP Fri Nov 10 03:26:42 CET 2006 i686 GNU/Linux
Gnu C                  4.1.2
Gnu make               3.81
binutils               2.17
util-linux             2.12r
mount                  2.12r
module-init-tools      3.2.2
e2fsprogs              1.40-WIP
reiserfsprogs          3.6.19
PPP                    2.4.4
Linux C Library        2.3.6
Dynamic linker (ldd)   2.3.6
Procps                 3.2.7
Net-tools              1.60
Console-tools          0.2.3
Sh-utils               5.97
udev                   100
Modules Loaded         thermal button processor ac battery mousedev
firmware_class psmouse yenta_socket rsrc_nonstatic pcmcia_core

Problem Description:
BUG: unable to handle kernel paging request at virtual address f00471a8
 printing eip:
b0190d64
*pde = 018d1067
*pte = 00000000
Oops: 0000 [#1]
SMP
Modules linked in: thermal button processor ac battery mousedev firmware_class
psmouse yenta_socket rsrc_nonstatic pcmcia_core
CPU:    0
EIP:    0060:[<b0190d64>]    Not tainted VLI
EFLAGS: 00010246   (2.6.18.2-n05 #1)
EIP is at sysfs_get_name+0x44/0x60
eax: f00471a8   ebx: ee8fff5c   ecx: ee2dd538   edx: 00000004
esi: ee8fff58   edi: 00000996   ebp: ed7d3f6c   esp: ed7d3f30
ds: 007b   es: 007b   ss: 0068
Process find (pid: 1596, ti=ed7d2000 task=b194aa70 task.ti=ed7d2000)
Stack: b019280a 00000003 00000000 00000996 0000000a ee8ff388 b016bfc0 ed7d3f98
       ee23c5c0 ee2dd538 eedfe260 00000009 b02c1300 ee23c5c0 eef4c840 ed7d3f8c
       b016c1c0 ed7d3f98 b016bfc0 eef4c8b4 00001000 0805f7fc ee23c5c0 ed7d3fb4
Call Trace:
 [<b016c1c0>] vfs_readdir+0x70/0x90
 [<b016c24d>] sys_getdents64+0x6d/0xd0
 [<b0102e69>] sysenter_past_esp+0x56/0x79
 [<a7f19410>] 0xa7f19410
Code: fa 08 90 8d 74 26 00 74 1e 83 fa 20 74 19 5d 31 c0 c3 90 8d 74 26 00 83 fa
02 75 f2 8b 40 20 5d 8b 40 24 c3 8d 76 00 8b 40 14 5d <8b> 00 c3 0f 0b be 00 8a
f3 2d b0 eb bd eb 0d 90 90 90 90 90 90
EIP: [<b0190d64>] sysfs_get_name+0x44/0x60 SS:ESP 0068:ed7d3f30

Steps to reproduce:
I found two alternatives how to generate oops

a)
if pcmcia module not loaded
  modprobe pcmcia
rmmod pcmcia
find /sys

b)
if pcmcia module not loaded
  modprobe pcmcia
rmmod pcmcia
reboot or poweroff
(oops from this alternative is not saved)

Notes:
- oops is reproducible with vanilla kernel 2.6.18.2, 2.6.17-2-686 from debian
distro, and 2.6.17-gentoo-r8
- reproducible also on older lifebook with 1 CPU
- the latest normal output of find is:
/sys/devices/pci0000:00/0000:00:1e.0/0000:08:03.2/uevent
/sys/devices/pci0000:00/0000:00:1e.0/0000:08:03.1
/sys/devices/pci0000:00/0000:00:1e.0/0000:08:03.1/1.0
- after oops, the system remains usable except of freezing poweroff
- I have no pcmcia/pccard cards, so I can't say anything about pcmcia functionality

After
modprobe -r pcmcia ; modprobe pcmcia
the following kernel messages appear:
pcmcia: registering new device pcmcia1.0
kobject_add failed for 1.0 with -EEXIST, don't try to register things with the
same name in the same directory.
 [<b0104025>] show_trace_log_lvl+0x185/0x1a0
 [<b0104722>] show_trace+0x12/0x20
 [<b0104899>] dump_stack+0x19/0x20
 [<b01fdd70>] kobject_add+0x120/0x1b0
 [<b0242991>] device_add+0xa1/0x300
 [<b0242c02>] device_register+0x12/0x20
 [<f01bef9d>] pcmcia_device_add+0x1bd/0x270 [pcmcia]
 [<f01bf11b>] pcmcia_card_add+0xab/0xc0 [pcmcia]
 [<f01bf733>] ds_event+0x73/0xb0 [pcmcia]
 [<f002f41d>] send_event+0x7d/0xf0 [pcmcia_core]
 [<f002f5f8>] pccard_register_pcmcia+0x78/0x80 [pcmcia_core]
 [<f01bf680>] pcmcia_bus_add_socket+0x80/0xc0 [pcmcia]
 [<b02459a5>] class_interface_register+0x85/0xb0
 [<f003e029>] init_pcmcia_bus+0x29/0x2d [pcmcia]
 [<b0136787>] sys_init_module+0x137/0x1a30
 [<b0102e69>] sysenter_past_esp+0x56/0x79
 [<a7fd9410>] 0xa7fd9410

.config, lspci -vvv, dmesg and some files from /proc are at
http://student.fiit.stuba.sk/~gono00/bug_pcmcia_2.6.18.2.tar.bz2
Comment 1 Daniel Ritz 2006-11-16 15:23:54 UTC
Created attachment 9539 [details]
pcmcia-ds-rmmod-unregister.patch

patch that fixes the problem
Comment 2 Andrew Morton 2006-11-16 15:43:58 UTC
Added pcmcia-fix-rmmod-pcmcia-with-unbound-devices.patch to -mm.