Re: [Bug] oops in usb_suspend_both with FTDI USB-serial-converter connected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 2, 2012 at 5:20 PM, Frank Schäfer <schaefer.frank@xxxxxxx> wrote:
> Hi,
>
> I'm getting the following kernel oops with a FTDI USB-serial-coverter
> (FT232BM) connected:
>
>
> [  256.480843] BUG: unable to handle kernel NULL pointer dereference
> at   (null)
> [  256.481035] IP: [<  (null)>]   (null)
> [  256.481035] *pdpt = 000000003642f001 *pde = 0000000000000000
> [  256.481035] Oops: 0010 [#1] PREEMPT SMP
> [  256.481035] Modules linked in: ftdi_sio usbserial xt_limit rfcomm
> bnep af_packet ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw
> xt_NOTRACK ipt_REJECT iptable_raw iptable_filter ip6table_mangle
> nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4
> nf_defrag_ipv4 ip_tables xt_conntrack nf_conntrack ip6table_filter
> ip6_tables x_tables cpufreq_conservative cpufreq_userspace
> cpufreq_powersave acpi_cpufreq mperf fuse arc4 brcmsmac mac80211 btusb
> bluetooth uvcvideo brcmutil cfg80211 snd_hda_codec_realtek
> videobuf2_core videodev videobuf2_vmalloc snd_hda_intel snd_hda_codec
> snd_hwdep snd_pcm snd_timer videobuf2_memops snd crc8 samsung_laptop
> pcspkr cordic sg bcma soundcore sky2 iTCO_wdt coretemp joydev
> snd_page_alloc iTCO_vendor_support ac battery i2c_i801 rfkill microcode
> autofs4 i915 drm_kms_helper drm i2c_algo_bit thermal video button
> processor thermal_sys
> [  256.481035]
> [  256.481035] Pid: 3226, comm: laptop_mode Not tainted
> 3.4.0-rc5-1.9-desktop+ #1 SAMSUNG ELECTRONICS CO., LTD.
> NF110/NF210/NF310          /NF110/NF210/NF310
> [  256.481035] EIP: 0060:[<00000000>] EFLAGS: 00010202 CPU: 1
> [  256.481035] EIP is at 0x0
> [  256.481035] EAX: f3b8ae00 EBX: f3b8ae00 ECX: f7ddd394 EDX: 00000402
> [  256.481035] ESI: 00000000 EDI: f28ef000 EBP: f1291e20 ESP: f1291df8
> [  256.481035]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
> [  256.481035] CR0: 8005003b CR2: 00000000 CR3: 302c5000 CR4: 000007f0
> [  256.481035] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> [  256.481035] DR6: ffff0ff0 DR7: 00000400
> [  256.481035] Process laptop_mode (pid: 3226, ti=f1290000 task=f1075260
> task.ti=f1290000)
> [  256.481035] Stack:
> [  256.481035]  c058ea70 00000001 00000000 03000286 00000001 00000402
> 00000400 f28ef000
> [  256.481035]  f28ef064 f28ef0be f1291e30 c058f5fe c058f5d0 f28ef064
> f1291e44 c053b34a
> [  256.481035]  f28ef064 00000000 f28ef0be f1291e98 c053c19c 000080d0
> f1291f00 f1075260
> [  256.481035] Call Trace:
> [  256.481035]  [<c058ea70>] ? usb_suspend_both+0x80/0x1b0
> [  256.481035]  [<c058f5fe>] usb_runtime_suspend+0x2e/0x60
> [  256.481035]  [<c058f5d0>] ? usb_probe_device+0x70/0x70
> [  256.481035]  [<c053b34a>] __rpm_callback+0x2a/0x80
> [  256.481035]  [<c053c19c>] rpm_suspend+0x26c/0x720
> [  256.481035]  [<c034addb>] ? mntput_no_expire+0x2b/0x100
> [  256.481035]  [<c053c700>] __pm_runtime_suspend+0x40/0x60
> [  256.481035]  [<c058f66e>] usb_runtime_idle+0x1e/0x30
> [  256.481035]  [<c058f650>] ? usb_runtime_resume+0x20/0x20
> [  256.481035]  [<c053b34a>] __rpm_callback+0x2a/0x80
> [  256.481035]  [<c053b7c9>] rpm_idle+0x1c9/0x260
> [  256.481035]  [<c033eaec>] ? do_filp_open+0x2c/0x80
> [  256.481035]  [<c053b8bc>] pm_runtime_allow+0x5c/0x60
> [  256.481035]  [<c0537345>] control_store+0xa5/0xb0
> [  256.481035]  [<c05372a0>] ? rtpm_suspended_time_show+0x60/0x60
> [  256.481035]  [<c052f31e>] dev_attr_store+0x1e/0x30
> [  256.481035]  [<c038b391>] sysfs_write_file+0xa1/0xf0
> [  256.481035]  [<c033156a>] vfs_write+0x8a/0x160
> [  256.481035]  [<c038b2f0>] ? sysfs_poll+0x90/0x90
> [  256.481035]  [<c0331848>] sys_write+0x38/0x70
> [  256.481035]  [<c071f38d>] syscall_call+0x7/0xb
> [  256.481035] Code:  Bad EIP value.
> [  256.481035] EIP: [<00000000>] 0x0 SS:ESP 0068:f1291df8
> [  256.481035] CR2: 0000000000000000
> [  256.606706] ---[ end trace 811b63a9261a2fbd ]---
>
>

Hi all,
Below calling sequence may cause the issue:
    usb_suspend_both()
         usb_suspend_interface()
            ...
            status = driver->suspend(intf, msg);
            ----> Invalid reference (ftdi_sio does not implement this callback)


Can following code fix the issue?
====================================
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 9a56635..60aa897 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1676,6 +1676,10 @@ int usb_runtime_suspend(struct device *dev)
        if (autosuspend_check(udev) != 0)
                return -EAGAIN;

+       device_lock(&udev->dev);
+       unbind_no_pm_drivers_interfaces(udev);
+       device_unlock(&udev->dev);
+
        status = usb_suspend_both(udev, PMSG_AUTO_SUSPEND);
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux