Okay here is what happens with the patch: 1. I run a script, sleep.sh which stops hotplug and unloads all usb drivers, including usbcore - then suspends(3). 2. On resume, I manually load ehci-hcd, which now produces a trace (the modprobe returns "Segmentation Fault").
Here is the output of the unload (prior to suspend) and the reload of the drivers (after resuming): Output (USB Unload) ------------------- Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: remove, state 1 Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: roothub graceful disconnect Mar 16 13:11:05 localhost kernel: usb usb1: USB disconnect, address 1 Mar 16 13:11:05 localhost kernel: usb usb1: usb_disable_device nuking all URBs Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: shutdown urb df88e9c0 pipe 40408180 ep1in-intr Mar 16 13:11:05 localhost kernel: usb usb1: unregistering interface 1-0:1.0 Mar 16 13:11:05 localhost kernel: usb usb1: hcd_unlink_urb df88e9c0 fail -22 Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: usb usb1: unregistering device Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: stop Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: reset command 010003 (park)=0 ithresh=1 period=1024 Reset RUN Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: irq normal 0 err 0 reclaim 0 (lost 0) Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: complete 0 unlink 0 Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: ehci_stop completed status 1000 Halt Mar 16 13:11:05 localhost kernel: ehci_hcd 0000:00:1d.7: USB bus 1 deregistered Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.0: remove, state 1 Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.0: roothub graceful disconnect Mar 16 13:11:05 localhost kernel: usb usb2: USB disconnect, address 1 Mar 16 13:11:05 localhost kernel: usb usb2: usb_disable_device nuking all URBs Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.0: shutdown urb df88e540 pipe 40408180 ep1in-intr Mar 16 13:11:05 localhost kernel: usb usb2: unregistering interface 2-0:1.0 Mar 16 13:11:05 localhost kernel: usb usb2: hcd_unlink_urb df88e540 fail -22 Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: usb usb2: unregistering device Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.0: USB bus 2 deregistered Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.1: remove, state 1 Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.1: roothub graceful disconnect Mar 16 13:11:05 localhost kernel: usb usb3: USB disconnect, address 1 Mar 16 13:11:05 localhost kernel: usb usb3: usb_disable_device nuking all URBs Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.1: shutdown urb df88e140 pipe 40408180 ep1in-intr Mar 16 13:11:05 localhost kernel: usb usb3: unregistering interface 3-0:1.0 Mar 16 13:11:05 localhost kernel: usb usb3: hcd_unlink_urb df88e140 fail -22 Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: usb usb3: unregistering device Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.1: USB bus 3 deregistered Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.2: remove, state 1 Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.2: roothub graceful disconnect Mar 16 13:11:05 localhost kernel: usb usb4: USB disconnect, address 1 Mar 16 13:11:05 localhost kernel: usb usb4: usb_disable_device nuking all URBs Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.2: shutdown urb de984c40 pipe 40408180 ep1in-intr Mar 16 13:11:05 localhost kernel: usb usb4: unregistering interface 4-0:1.0 Mar 16 13:11:05 localhost kernel: usb usb4: hcd_unlink_urb de984c40 fail -22 Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: usb usb4: unregistering device Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: usb_hotplug Mar 16 13:11:05 localhost kernel: uhci_hcd 0000:00:1d.2: USB bus 4 deregistered Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: deregistering driver usbfs Mar 16 13:11:05 localhost kernel: drivers/usb/core/hub.c: hub_thread exiting Mar 16 13:11:05 localhost kernel: drivers/usb/core/usb.c: deregistering driver hub Output (Resume + modprobe ehci-hcd): ------------------------------------ Mar 16 13:11:24 localhost kernel: PM: Preparing system for suspend Mar 16 13:11:35 localhost kernel: Stopping tasks: ===================================================================| Mar 16 13:11:35 localhost kernel: hdc: start_power_step(step: 0) Mar 16 13:11:35 localhost kernel: hdc: completing PM request, suspend Mar 16 13:11:35 localhost kernel: hda: start_power_step(step: 0) Mar 16 13:11:35 localhost kernel: hda: start_power_step(step: 1) Mar 16 13:11:35 localhost kernel: hda: complete_power_step(step: 1, stat: 50, err: 0) Mar 16 13:11:35 localhost kernel: hda: completing PM request, suspend Mar 16 13:11:35 localhost kernel: PM: Entering state. Mar 16 13:11:35 localhost kernel: hwsleep-0300 [8377] acpi_enter_sleep_state: Entering sleep state [S3] Mar 16 13:11:35 localhost kernel: Back to C! Mar 16 13:11:35 localhost kernel: PM: Finishing up. Mar 16 13:11:35 localhost kernel: PCI: Setting latency timer of device 0000:00:1f.5 to 64 Mar 16 13:11:35 localhost kernel: hda: Wakeup request inited, waiting for !BSY... Mar 16 13:11:35 localhost kernel: hda: start_power_step(step: 1000) Mar 16 13:11:35 localhost kernel: hda: completing PM request, resume Mar 16 13:11:35 localhost kernel: hdc: Wakeup request inited, waiting for !BSY... Mar 16 13:11:35 localhost kernel: hdc: start_power_step(step: 1000) Mar 16 13:11:35 localhost kernel: hdc: completing PM request, resume Mar 16 13:11:35 localhost kernel: Restarting tasks...<6>e1000: eth0 NIC Link is Up 10 Mbps Half Duplex Mar 16 13:11:35 localhost kernel: done Mar 16 13:11:43 localhost su: (to root) niella on /dev/pts/35 Mar 16 13:11:43 localhost su: pam_unix2: session started for user root, service su Mar 16 13:12:01 localhost kernel: core] Mar 16 13:12:01 localhost kernel: [__crc_ide_task_ioctl+321817/2376065] usb_hcd_pci_probe+0x0/0x4e0 [usbcore] Mar 16 13:12:01 localhost kernel: [<e1afd990>] usb_hcd_pci_probe+0x0/0x4e0 [usbcore] Mar 16 13:12:01 localhost kernel: [pci_device_probe+171/416] pci_device_probe+0xab/0x1a0 Mar 16 13:12:01 localhost kernel: [<c026cf4b>] pci_device_probe+0xab/0x1a0 Mar 16 13:12:01 localhost kernel: [bus_match+59/128] bus_match+0x3b/0x80 Mar 16 13:12:01 localhost kernel: [<c02d87cb>] bus_match+0x3b/0x80 Mar 16 13:12:01 localhost kernel: [driver_attach+79/144] driver_attach+0x4f/0x90 Mar 16 13:12:01 localhost kernel: [<c02d89df>] driver_attach+0x4f/0x90 Mar 16 13:12:01 localhost kernel: [kobject_register+40/105] kobject_register+0x28/0x69 Mar 16 13:12:01 localhost kernel: [<c025f7b8>] kobject_register+0x28/0x69 Mar 16 13:12:01 localhost kernel: [bus_add_driver+141/192] bus_add_driver+0x8d/0xc0 Mar 16 13:12:01 localhost kernel: [<c02d8aad>] bus_add_driver+0x8d/0xc0 Mar 16 13:12:01 localhost kernel: [driver_register+47/64] driver_register+0x2f/0x40 Mar 16 13:12:01 localhost kernel: [<c02d902f>] driver_register+0x2f/0x40 Mar 16 13:12:01 localhost kernel: [pci_register_driver+92/176] pci_register_driver+0x5c/0xb0 Mar 16 13:12:01 localhost kernel: [<c026d1ec>] pci_register_driver+0x5c/0xb0 Mar 16 13:12:01 localhost kernel: [__crc_cap_capget+1397435/1450533] init+0x54/0x5e [ehci_hcd] Mar 16 13:12:01 localhost kernel: [<e19d8054>] init+0x54/0x5e [ehci_hcd] Mar 16 13:12:01 localhost kernel: [sys_init_module+361/5840] sys_init_module+0x169/0x16d0 Mar 16 13:12:01 localhost kernel: [<c0133fa9>] sys_init_module+0x169/0x16d0 Mar 16 13:12:01 localhost kernel: [old_mmap+306/352] old_mmap+0x132/0x160 Mar 16 13:12:01 localhost kernel: [<c010f6e2>] old_mmap+0x132/0x160 Mar 16 13:12:01 localhost kernel: [filp_close+89/160] filp_close+0x59/0xa0 Mar 16 13:12:01 localhost kernel: [<c0152889>] filp_close+0x59/0xa0 Mar 16 13:12:01 localhost kernel: [sys_close+91/144] sys_close+0x5b/0x90 Mar 16 13:12:01 localhost kernel: [<c015292b>] sys_close+0x5b/0x90 Mar 16 13:12:01 localhost kernel: [syscall_call+7/11] syscall_call+0x7/0xb Mar 16 13:12:01 localhost kernel: [<c010935b>] syscall_call+0x7/0xb Mar 16 13:12:01 localhost kernel: Mar 16 13:12:01 localhost kernel: Code: 8b 70 48 85 f6 0f 84 82 00 00 00 8d 74 26 00 8d bc 27 00 00 Mar 16 13:12:01 localhost kernel: <6>note: modprobe[1927] exited with preempt_count 1 Mar 16 13:12:01 localhost kernel: bad: scheduling while atomic! Mar 16 13:12:01 localhost kernel: Call Trace: Mar 16 13:12:01 localhost kernel: [schedule+1453/1520] schedule+0x5ad/0x5f0 Mar 16 13:12:01 localhost kernel: [<c011a80d>] schedule+0x5ad/0x5f0 Mar 16 13:12:01 localhost kernel: [unmap_page_range+441/560] unmap_page_range+0x1b9/0x230 Mar 16 13:12:01 localhost kernel: [<c01457a9>] unmap_page_range+0x1b9/0x230 Mar 16 13:12:01 localhost kernel: [unmap_vmas+564/592] unmap_vmas+0x234/0x250 Mar 16 13:12:01 localhost kernel: [<c0145a54>] unmap_vmas+0x234/0x250 Mar 16 13:12:01 localhost kernel: [exit_mmap+120/432] exit_mmap+0x78/0x1b0 Mar 16 13:12:01 localhost kernel: [<c0148138>] exit_mmap+0x78/0x1b0 Mar 16 13:12:01 localhost kernel: [mmput+97/144] mmput+0x61/0x90 Mar 16 13:12:01 localhost kernel: [<c011cdd1>] mmput+0x61/0x90 Mar 16 13:12:01 localhost kernel: [do_exit+345/2960] do_exit+0x159/0xb90 Mar 16 13:12:01 localhost kernel: [<c0120b19>] do_exit+0x159/0xb90 Mar 16 13:12:01 localhost kernel: [die+404/416] die+0x194/0x1a0 Mar 16 13:12:01 localhost kernel: [<c010a214>] die+0x194/0x1a0 Mar 16 13:12:01 localhost kernel: [do_page_fault+0/1397] do_page_fault+0x0/0x575 Mar 16 13:12:01 localhost kernel: [<c0118f00>] do_page_fault+0x0/0x575 Mar 16 13:12:01 localhost kernel: [do_page_fault+1018/1397] do_page_fault+0x3fa/0x575 Mar 16 13:12:01 localhost kernel: [<c01192fa>] do_page_fault+0x3fa/0x575 Mar 16 13:12:01 localhost kernel: [schedule+457/1520] schedule+0x1c9/0x5f0 Mar 16 13:12:01 localhost kernel: [<c011a429>] schedule+0x1c9/0x5f0 Mar 16 13:12:01 localhost kernel: [preempt_schedule+42/80] preempt_schedule+0x2a/0x50 Mar 16 13:12:01 localhost kernel: [<c011a9aa>] preempt_schedule+0x2a/0x50 Mar 16 13:12:01 localhost kernel: [d_alloc+32/480] d_alloc+0x20/0x1e0 Mar 16 13:12:01 localhost kernel: [<c016ce90>] d_alloc+0x20/0x1e0 Mar 16 13:12:01 localhost kernel: [do_page_fault+0/1397] do_page_fault+0x0/0x575 Mar 16 13:12:01 localhost kernel: [<c0118f00>] do_page_fault+0x0/0x575 Mar 16 13:12:01 localhost kernel: [error_code+45/56] error_code+0x2d/0x38 Mar 16 13:12:01 localhost kernel: [<c0109505>] error_code+0x2d/0x38 Mar 16 13:12:01 localhost kernel: [load_elf_binary+4043/5424] load_elf_binary+0xfcb/0x1530 Mar 16 13:12:01 localhost kernel: [<c018007b>] load_elf_binary+0xfcb/0x1530 Mar 16 13:12:01 localhost kernel: [__crc_xfrm4_tunnel_check_size+184316/719246] ehci_work+0x4a/0x1c0 [ehci_hcd] Mar 16 13:12:01 localhost kernel: [<e1a11fba>] ehci_work+0x4a/0x1c0 [ehci_hcd] Mar 16 13:12:01 localhost kernel: [__crc_xfrm4_tunnel_check_size+185746/719246] ehci_stop+0xe0/0x1e0 [ehci_hcd] Mar 16 13:12:01 localhost kernel: [<e1a12550>] ehci_stop+0xe0/0x1e0 [ehci_hcd] Mar 16 13:12:01 localhost kernel: [printk+330/384] printk+0x14a/0x180 Mar 16 13:12:01 localhost kernel: [<c011f02a>] printk+0x14a/0x180 Mar 16 13:12:01 localhost kernel: [__crc_ide_task_ioctl+287421/2376065] usb_disconnect+0x114/0x130 [usbcore] Mar 16 13:12:01 localhost kernel: [<e1af5334>] usb_disconnect+0x114/0x130 [usbcore] Mar 16 13:12:01 localhost kernel: [__crc_ide_task_ioctl+321574/2376065] usb_hcd_pci_remove+0xad/0x1a0 [usbcore] Mar 16 13:12:01 localhost kernel: [<e1afd89d>] usb_hcd_pci_remove+0xad/0x1a0 [usbcore] Mar 16 13:12:01 localhost kernel: [__crc_ide_task_ioctl+322895/2376065] usb_hcd_pci_probe+0x436/0x4e0 [usbcore] Mar 16 13:12:01 localhost kernel: [<e1afddc6>] usb_hcd_pci_probe+0x436/0x4e0 [usbcore] Mar 16 13:12:01 localhost kernel: [__crc_ide_task_ioctl+321817/2376065] usb_hcd_pci_probe+0x0/0x4e0 [usbcore] Mar 16 13:12:01 localhost kernel: [<e1afd990>] usb_hcd_pci_probe+0x0/0x4e0 [usbcore] Mar 16 13:12:01 localhost kernel: [pci_device_probe+171/416] pci_device_probe+0xab/0x1a0 Mar 16 13:12:01 localhost kernel: [<c026cf4b>] pci_device_probe+0xab/0x1a0 Mar 16 13:12:01 localhost kernel: [bus_match+59/128] bus_match+0x3b/0x80 Mar 16 13:12:01 localhost kernel: [<c02d87cb>] bus_match+0x3b/0x80 Mar 16 13:12:01 localhost kernel: [driver_attach+79/144] driver_attach+0x4f/0x90 Mar 16 13:12:01 localhost kernel: [<c02d89df>] driver_attach+0x4f/0x90 Mar 16 13:12:01 localhost kernel: [kobject_register+40/105] kobject_register+0x28/0x69 Mar 16 13:12:01 localhost kernel: [<c025f7b8>] kobject_register+0x28/0x69 Mar 16 13:12:01 localhost kernel: [bus_add_driver+141/192] bus_add_driver+0x8d/0xc0 Mar 16 13:12:01 localhost kernel: [<c02d8aad>] bus_add_driver+0x8d/0xc0 Mar 16 13:12:01 localhost kernel: [driver_register+47/64] driver_register+0x2f/0x40 Mar 16 13:12:01 localhost kernel: [<c02d902f>] driver_register+0x2f/0x40 Mar 16 13:12:01 localhost kernel: [pci_register_driver+92/176] pci_register_driver+0x5c/0xb0 Mar 16 13:12:01 localhost kernel: [<c026d1ec>] pci_register_driver+0x5c/0xb0 Mar 16 13:12:01 localhost kernel: [__crc_cap_capget+1397435/1450533] init+0x54/0x5e [ehci_hcd] Mar 16 13:12:01 localhost kernel: [<e19d8054>] init+0x54/0x5e [ehci_hcd] Mar 16 13:12:01 localhost kernel: [sys_init_module+361/5840] sys_init_module+0x169/0x16d0 Mar 16 13:12:01 localhost kernel: [<c0133fa9>] sys_init_module+0x169/0x16d0 Mar 16 13:12:01 localhost kernel: [old_mmap+306/352] old_mmap+0x132/0x160 Mar 16 13:12:01 localhost kernel: [<c010f6e2>] old_mmap+0x132/0x160 Mar 16 13:12:01 localhost kernel: [filp_close+89/160] filp_close+0x59/0xa0 Mar 16 13:12:01 localhost kernel: [<c0152889>] filp_close+0x59/0xa0 Mar 16 13:12:01 localhost kernel: [sys_close+91/144] sys_close+0x5b/0x90 Mar 16 13:12:01 localhost kernel: [<c015292b>] sys_close+0x5b/0x90 Mar 16 13:12:01 localhost kernel: [syscall_call+7/11] syscall_call+0x7/0xb Mar 16 13:12:01 localhost kernel: [<c010935b>] syscall_call+0x7/0xb Mar 16 13:12:01 localhost kernel: Hope this is informative and let me know if I can help in any way... Niel -----Original Message----- From: David Brownell <[EMAIL PROTECTED]> To: Niel Lambrechts <[EMAIL PROTECTED]> Date: Mon, 15 Mar 2004 07:49:28 -0800 Subject: Re: [linux-usb-devel] [2.6.4] USB malfunction on ACPI resume Niel Lambrechts wrote: > My Thinkpad R50P (Intel 82855PM with Speedstep 1.7GHz) shows the > following badness when resuming after an ACPI suspend - even if hotplug > and usb modules were never started beforehand: Well clearly (a) something _did_ start at least one module, (b) there's bogus data in the controller's PCI config space, and (c) the EHCI driver would seem to need to defend itself against such bogus data. If you "modprobe ehci_hcd" after (or during) a normal boot, rather than after ACPI suspend, does this happen? If not, that would seem to suggest that (b) is caused by ACPI. You might want to find out what makes (a) happen; it sounds like it's not expected on your system. > ... ehci_hcd 0000:00:1d.7: capability d49a4140 at 41 > ... last message repeated 1266 times ... > > This is repeated many many times -> CPU usage jumps to 100% (due to > ehci_hcd module) and klogd becomes very busy with the above nonsense. > The attached patch should address (c); please let us know. - Dave ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel