Hi,
triggered by the SET_MODULE_OWNER thread on lkml I've tried to rmmod the
hcd (ohci_hcd in this case) while there was a fs mounted from usb-storage.
This is possible because the hcd's use count remains zero regardless.
I was expecting fs damage so the fs (FAT on usbstick) was mouted RO.
Unfortunatedly it's even worse: the box starts BUGging and OOPSing!
Tried with 2.6.0-test1 - log see below.
Besides it should not oops I'm just wondering what might happen without
the oops. As said, I'd expect fs corruption. Sure, one could unplug the
storage device as well but people doing so are aware of the possible
consequences - at least if they've done before ;-)
OTOH I tend to agree with people saying module use count==0 indicates the
module is unused and thus can be safely removed. Personally I'd expect the
hcd's use count to increase with every interface claimed by client driver.
Thoughts?
Martin
------------------------------
$ modprobe ohci_hcd
ohci-hcd: 2003 Feb 24 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci-hcd: block sizes: ed 64 td 64
PCI: Found IRQ 9 for device 0000:00:01.2
ohci-hcd 0000:00:01.2: Silicon Integrated S 7001
ohci-hcd 0000:00:01.2: irq 9, pci mem cd050000
ohci-hcd 0000:00:01.2: new USB bus registered, assigned bus number 1
hub 1-0:0: USB hub found
hub 1-0:0: 2 ports detected
hub 1-0:0: debounce: port 1: delay 100ms stable 4 status 0x101
hub 1-0:0: new USB device on port 1, assigned address 2
$ mount -o ro -t vfat /dev/sda1 /mnt/usbstick
SCSI subsystem initialized
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: TwinMOS Model: Mobile Disk Rev: 1.11
Type: Direct-Access ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
drivers/usb/core/usb.c: registered new driver usb-storage
USB Mass Storage support registered.
SCSI device sda: 258048 512-byte hdwr sectors (132 MB)
sda: test WP failed, assume Write Enabled
sda: asking for cache data failed
sda: assuming drive cache: write through
/dev/scsi/host0/bus0/target0/lun0: p1
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
$ rmmod ohci_hcd
ohci-hcd 0000:00:01.2: remove, state 3
usb usb1: USB disconnect, address 1
usb 1-1: USB disconnect, address 2
ohci-hcd 0000:00:01.2: USB bus 1 deregistered
$ ls /mnt/usbstick
------------[ cut here ]------------
kernel BUG at fs/buffer.c:1165!
invalid operand: 0000 [#1]
CPU: 0
EIP: 0060:[<c015ca8a>] Not tainted
EFLAGS: 00010206
EIP is at __getblk_slow+0x4a/0xf0
eax: 00006b6a ebx: 000001f7 ecx: 0000003e edx: c88e2688
esi: 00000200 edi: cbd2aa24 ebp: 000001f7 esp: c77c7c74
ds: 007b es: 007b ss: 0068
Process bash (pid: 1560, threadinfo=c77c6000 task=c8a2e080)
Stack: 00000200 000001f7 cbd2aa24 00000000 c015cef6 cbd2aa24 000001f7 00000200
c774d49c 00000000 00000000 c015cf51 cbd2aa24 000001f7 00000200 cd0dd54f
cbd2aa24 000001f7 00000200 c77c7cc8 c7a03104 000001f7 c0364bc0 cbfb83e0
Call Trace:
[<c015cef6>] __getblk+0x26/0x30
[<c015cf51>] __bread+0x11/0x30
[<cd0dd54f>] fat__get_entry+0x9f/0x160 [fat]
[<cd0d8841>] fat_readdirx+0x2d1/0x10a0 [fat]
[<c02154ea>] soft_cursor+0x22a/0x260
[<c01e07a5>] do_con_write+0x645/0x6b0
[<c01dd3a5>] set_cursor+0x65/0x80
[<c020e8a3>] fbcon_cursor+0x353/0x370
[<c011ce16>] default_wake_function+0x16/0x20
[<c017203c>] dput+0x1c/0x280
[<c017203c>] dput+0x1c/0x280
[<c0168f13>] link_path_walk+0x843/0xa00
[<c0164696>] cp_new_stat64+0xe6/0x110
[<c015ae79>] get_empty_filp+0x49/0xf0
[<cd0d962c>] fat_readdir+0x1c/0x20 [fat]
[<c016d590>] filldir64+0x0/0x130
[<c016d2ba>] vfs_readdir+0x5a/0x70
[<c016d590>] filldir64+0x0/0x130
[<c016d724>] sys_getdents64+0x64/0xa1
[<c016d590>] filldir64+0x0/0x130
[<c0109417>] syscall_call+0x7/0xb
Code: 0f 0b 8d 04 1f f1 28 c0 8d 86 00 fe ff ff 3d 00 0e 00 00 76
$ sync
$ modprobe ohci_hcd # same oops if directly following the rmmod
ohci-hcd: 2003 Feb 24 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci-hcd: block sizes: ed 64 td 64
PCI: Found IRQ 9 for device 0000:00:01.2
ohci-hcd 0000:00:01.2: Silicon Integrated S 7001
ohci-hcd 0000:00:01.2: irq 9, pci mem cd050000
ohci-hcd 0000:00:01.2: new USB bus registered, assigned bus number 1
hub 1-0:0: USB hub found
hub 1-0:0: 2 ports detected
hub 1-0:0: debounce: port 1: delay 100ms stable 4 status 0x101
hub 1-0:0: new USB device on port 1, assigned address 2
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: TwinMOS Model: Mobile Disk Rev: 1.11
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 258048 512-byte hdwr sectors (132 MB)
sda: test WP failed, assume Write Enabled
sda: asking for cache data failed
sda: assuming drive cache: write through
Unable to handle kernel paging request at virtual address 6b6b6bd3
printing eip:
cd0a7c9a
*pde = 00000000
Oops: 0000 [#1]
CPU: 0
EIP: 0060:[<cd0a7c9a>] Not tainted
EFLAGS: 00010286
EIP is at scsi_device_get+0xa/0x50 [scsi_mod]
eax: c92bcc48 ebx: 00000001 ecx: 6b6b6b6b edx: c92bc358
esi: 6b6b6b6b edi: c928d5a4 ebp: c930829c esp: cb417adc
ds: 007b es: 007b ss: 0068
Process khubd (pid: 481, threadinfo=cb416000 task=cb7a39a0)
Stack: cd06ad60 cd0682dd 6b6b6b6b cd06ad60 cbd2a9c0 cbd2a9c0 c92bc358 c0162ade
c930829c cb417bdc cd06ad60 00000000 00000246 cb417b68 00000001 cb417ba4
00000001 00000000 cb417bdc 00000000 c0162ceb cbd2a9c0 c930829c cb417bdc
Call Trace:
[<cd0682dd>] sd_open+0x1d/0xd0 [sd_mod]
[<c0162ade>] do_open+0x2de/0x480
[<c0162ceb>] blkdev_get+0x6b/0x80
[<c0190fc2>] register_disk+0xb2/0x140
[<c01f0975>] blk_register_region+0x25/0x30
[<c01f0a02>] add_disk+0x32/0x40
[<c01f09a0>] exact_match+0x0/0x10
[<c01f09b0>] exact_lock+0x0/0x20
[<cd06961c>] sd_probe+0x26c/0x2e0 [sd_mod]
[<c01ea5f4>] bus_match+0x34/0x60
[<c01ea66b>] device_attach+0x4b/0x70
[<c01ea7ea>] bus_add_device+0x6a/0xb0
[<c01e91b0>] device_add+0xc0/0xf0
[<cd0ae1b3>] scsi_device_register+0xa3/0x140 [scsi_mod]
[<cd0ad906>] scsi_add_lun+0x386/0x3a0 [scsi_mod]
[<cd0ad9c1>] scsi_probe_and_add_lun+0xa1/0x120 [scsi_mod]
[<c018d73f>] proc_register+0xf/0xa0
[<cd0adc04>] scsi_scan_target+0x34/0x70 [scsi_mod]
[<cd0adc8b>] scsi_scan_host+0x4b/0x70 [scsi_mod]
[<cd0a7f90>] scsi_add_host+0x70/0x80 [scsi_mod]
[<cd0951ee>] storage_probe+0x13e/0x190 [usb_storage]
[<cd06d08a>] usb_device_probe+0x6a/0xa0 [usbcore]
[<c01ea5f4>] bus_match+0x34/0x60
[<c01ea66b>] device_attach+0x4b/0x70
[<c01ea7ea>] bus_add_device+0x6a/0xb0
[<c01e91b0>] device_add+0xc0/0xf0
[<cd06e3e8>] usb_new_device+0x468/0x4b0 [usbcore]
[<cd070395>] hub_port_connect_change+0x225/0x2b0 [usbcore]
[<cd070586>] hub_events+0x166/0x370 [usbcore]
[<cd0707b5>] hub_thread+0x25/0xe0 [usbcore]
[<c011ce00>] default_wake_function+0x0/0x20
[<cd070790>] hub_thread+0x0/0xe0 [usbcore]
[<c010712d>] kernel_thread_helper+0x5/0x18
Code: 8b 41 68 8b 40 5c 8b 10 85 d2 74 22 b8 00 e0 ff ff 21 e0 83
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel