1. 28 9月, 2011 1 次提交
    • A
      Bluetooth: use recommended LE connection parameters · 0e833915
      Anderson Lizardo 提交于
      The new connection parameters now match the recommended values for
      Proximity and Health Thermometer profiles. The previous values were
      ramdomly chosen, and are either too low or too high for most cases.
      
      New values:
      
      Scan Interval: 60 ms
      Scan Window: 30 ms
      Minimum Connection Interval: 50 ms
      Maximum Connection Interval: 70 ms
      Supervision Timeout: 420 ms
      
      See "Table 5.2: Recommended Scan Interval and Scan Window Values" and
      "Table 5.3: Recommended Connection Interval Values" for both profiles
      for details. Note that the "fast connection" parameters were chosen,
      because we do not support yet dynamically changing these parameters from
      initiator side.
      
      Additionally, the Proximity profile recommends (section "4.4 Alert on
      Link Loss"):
      
      "It is recommended that the Link Supervision Timeout (LSTO) is set to 6x
      the connection interval."
      
      Minimum_CE_Length and Maximum_CE_Length were also changed from 0x0001 to
      0x0000 because they are informational and optional, and old value was
      not reflecting reality.
      Signed-off-by: NAnderson Lizardo <anderson.lizardo@openbossa.org>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      0e833915
  2. 21 9月, 2011 1 次提交
  3. 01 7月, 2011 1 次提交
  4. 16 6月, 2011 1 次提交
  5. 14 6月, 2011 3 次提交
  6. 09 6月, 2011 6 次提交
  7. 12 5月, 2011 1 次提交
  8. 29 4月, 2011 2 次提交
  9. 28 2月, 2011 1 次提交
  10. 22 2月, 2011 2 次提交
  11. 17 2月, 2011 4 次提交
  12. 08 2月, 2011 1 次提交
  13. 20 1月, 2011 3 次提交
  14. 02 12月, 2010 1 次提交
  15. 28 7月, 2010 1 次提交
    • M
      Bluetooth: Defer SCO setup if mode change is pending · e73439d8
      Marcel Holtmann 提交于
      Certain headsets such as the Motorola H350 will reject SCO and eSCO
      connection requests while the ACL is transitioning from sniff mode
      to active mode. Add synchronization so that SCO and eSCO connection
      requests will wait until the ACL has fully transitioned to active mode.
      
      < HCI Command: Exit Sniff Mode (0x02|0x0004) plen 2
          handle 12
      > HCI Event: Command Status (0x0f) plen 4
          Exit Sniff Mode (0x02|0x0004) status 0x00 ncmd 1
      < HCI Command:  Setup Synchronous Connection (0x01|0x0028) plen 17
          handle 12 voice setting 0x0040
      > HCI Event: Command Status (0x0f) plen 4
          Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
      > HCI Event: Number of Completed Packets (0x13) plen 5
          handle 12 packets 1
      > HCI Event: Mode Change (0x14) plen 6
          status 0x00 handle 12 mode 0x00 interval 0
          Mode: Active
      > HCI Event: Synchronous Connect Complete (0x2c) plen 17
          status 0x10 handle 14 bdaddr 00:1A:0E:50:28:A4 type SCO
          Error: Connection Accept Timeout Exceeded
      Signed-off-by: NRon Shaffer <rshaffer@codeaurora.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      e73439d8
  16. 22 7月, 2010 1 次提交
  17. 09 7月, 2010 1 次提交
  18. 04 2月, 2010 1 次提交
    • N
      Bluetooth: Enter active mode before establishing a SCO link. · c390216b
      Nick Pelly 提交于
      When in sniff mode with a long interval time (1.28s) it can take 4+ seconds
      to establish a SCO link. Fix by requesting active mode before requesting
      SCO connection. This improves SCO setup time to ~500ms.
      
      Bluetooth headsets that use a long interval time, and exhibit the long
      SCO connection time include Motorola H790, HX1 and H17. They have a
      CSR 2.1 chipset.
      
      Verified this behavior and fix with host Bluetooth chipsets: BCM4329 and
      TI1271.
      
      2009-10-13 14:17:46.183722 > HCI Event: Mode Change (0x14) plen 6
          status 0x00 handle 1 mode 0x02 interval 2048
          Mode: Sniff
      2009-10-13 14:17:53.436285 < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
          handle 1 voice setting 0x0060
      2009-10-13 14:17:53.445593 > HCI Event: Command Status (0x0f) plen 4
          Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
      2009-10-13 14:17:57.788855 > HCI Event: Synchronous Connect Complete 0x2c) plen 17
          status 0x00 handle 257 bdaddr 00:1A:0E:F1:A4:7F type eSCO
          Air mode: CVSD
      Signed-off-by: NNick Pelly <npelly@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c390216b
  19. 16 11月, 2009 1 次提交
  20. 23 8月, 2009 1 次提交
    • M
      Bluetooth: Add extra device reference counting for connections · 9eba32b8
      Marcel Holtmann 提交于
      The device model itself has no real usable reference counting at the
      moment and this causes problems if parents are deleted before their
      children. The device model itself handles the memory details of this
      correctly, but the uevent order is not consistent. This causes various
      problems for systems like HAL or even X.
      
      So until device_put() does a proper cleanup, the device for Bluetooth
      connection will be protected with an extra reference counting to ensure
      the correct order of uevents when connections are terminated.
      
      This is not an automatic feature. Higher Bluetooth layers like HIDP or
      BNEP should grab this new reference to ensure that their uevents are
      send before the ones from the parent device.
      
      Based on a report by Brian Rogers <brian@xyzw.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      9eba32b8
  21. 10 5月, 2009 2 次提交
    • M
      Bluetooth: Don't use hci_acl_connect_cancel() for incoming connections · 1b0336bb
      Marcel Holtmann 提交于
      The connection setup phase takes around 2 seconds or longer and in
      that time it is possible that the need for an ACL connection is no
      longer present. If that happens then, the connection attempt will
      be canceled.
      
      This only applies to outgoing connections, but currently it can also
      be triggered by incoming connection. Don't call hci_acl_connect_cancel()
      on incoming connection since these have to be either accepted or rejected
      in this state. Once they are successfully connected they need to be
      fully disconnected anyway.
      
      Also remove the wrong hci_acl_disconn() call for SCO and eSCO links
      since at this stage they can't be disconnected either, because the
      connection handle is still unknown.
      
      Based on a report by Johan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Tested-by: NJohan Hedberg <johan.hedberg@nokia.com>
      1b0336bb
    • M
      Bluetooth: Fix wrong module refcount when connection setup fails · 384943ec
      Marcel Holtmann 提交于
      The module refcount is increased by hci_dev_hold() call in hci_conn_add()
      and decreased by hci_dev_put() call in del_conn(). In case the connection
      setup fails, hci_dev_put() is never called.
      
      Procedure to reproduce the issue:
      
        # hciconfig hci0 up
        # lsmod | grep btusb                   -> "used by" refcount = 1
      
        # hcitool cc <non-exisiting bdaddr>    -> will get timeout
      
        # lsmod | grep btusb                   -> "used by" refcount = 2
        # hciconfig hci0 down
        # lsmod | grep btusb                   -> "used by" refcount = 1
        # rmmod btusb                          -> ERROR: Module btusb is in use
      
      The hci_dev_put() call got moved into del_conn() with the 2.6.25 kernel
      to fix an issue with hci_dev going away before hci_conn. However that
      change was wrong and introduced this problem.
      
      When calling hci_conn_del() it has to call hci_dev_put() after freeing
      the connection details. This handling should be fully symmetric. The
      execution of del_conn() is done in a work queue and needs it own calls
      to hci_dev_hold() and hci_dev_put() to ensure that the hci_dev stays
      until the connection cleanup has been finished.
      
      Based on a report by Bing Zhao <bzhao@marvell.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Tested-by: NBing Zhao <bzhao@marvell.com>
      384943ec
  22. 05 5月, 2009 1 次提交
    • M
      Bluetooth: Fix issue with sysfs handling for connections · a67e899c
      Marcel Holtmann 提交于
      Due to a semantic changes in flush_workqueue() the current approach of
      synchronizing the sysfs handling for connections doesn't work anymore. The
      whole approach is actually fully broken and based on assumptions that are
      no longer valid.
      
      With the introduction of Simple Pairing support, the creation of low-level
      ACL links got changed. This change invalidates the reason why in the past
      two independent work queues have been used for adding/removing sysfs
      devices. The adding of the actual sysfs device is now postponed until the
      host controller successfully assigns an unique handle to that link. So
      the real synchronization happens inside the controller and not the host.
      
      The only left-over problem is that some internals of the sysfs device
      handling are not initialized ahead of time. This leaves potential access
      to invalid data and can cause various NULL pointer dereferences. To fix
      this a new function makes sure that all sysfs details are initialized
      when an connection attempt is made. The actual sysfs device is only
      registered when the connection has been successfully established. To
      avoid a race condition with the registration, the check if a device is
      registered has been moved into the removal work.
      
      As an extra protection two flush_work() calls are left in place to
      make sure a previous add/del work has been completed first.
      
      Based on a report by Marc Pignat <marc.pignat@hevs.ch>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Tested-by: NJustin P. Mattock <justinmattock@gmail.com>
      Tested-by: NRoger Quadros <ext-roger.quadros@nokia.com>
      Tested-by: NMarc Pignat <marc.pignat@hevs.ch>
      a67e899c
  23. 29 4月, 2009 2 次提交
    • M
      Bluetooth: Fix connection establishment with low security requirement · 3fdca1e1
      Marcel Holtmann 提交于
      The Bluetooth 2.1 specification introduced four different security modes
      that can be mapped using Legacy Pairing and Simple Pairing. With the
      usage of Simple Pairing it is required that all connections (except
      the ones for SDP) are encrypted. So even the low security requirement
      mandates an encrypted connection when using Simple Pairing. When using
      Legacy Pairing (for Bluetooth 2.0 devices and older) this is not required
      since it causes interoperability issues.
      
      To support this properly the low security requirement translates into
      different host controller transactions depending if Simple Pairing is
      supported or not. However in case of Simple Pairing the command to
      switch on encryption after a successful authentication is not triggered
      for the low security mode. This patch fixes this and actually makes
      the logic to differentiate between Simple Pairing and Legacy Pairing
      a lot simpler.
      
      Based on a report by Ville Tervo <ville.tervo@nokia.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      3fdca1e1
    • M
      Bluetooth: Add different pairing timeout for Legacy Pairing · 052b30b0
      Marcel Holtmann 提交于
      The Bluetooth stack uses a reference counting for all established ACL
      links and if no user (L2CAP connection) is present, the link will be
      terminated to save power. The problem part is the dedicated pairing
      when using Legacy Pairing (Bluetooth 2.0 and before). At that point
      no user is present and pairing attempts will be disconnected within
      10 seconds or less. In previous kernel version this was not a problem
      since the disconnect timeout wasn't triggered on incoming connections
      for the first time. However this caused issues with broken host stacks
      that kept the connections around after dedicated pairing. When the
      support for Simple Pairing got added, the link establishment procedure
      needed to be changed and now causes issues when using Legacy Pairing
      
      When using Simple Pairing it is possible to do a proper reference
      counting of ACL link users. With Legacy Pairing this is not possible
      since the specification is unclear in some areas and too many broken
      Bluetooth devices have already been deployed. So instead of trying to
      deal with all the broken devices, a special pairing timeout will be
      introduced that increases the timeout to 60 seconds when pairing is
      triggered.
      
      If a broken devices now puts the stack into an unforeseen state, the
      worst that happens is the disconnect timeout triggers after 120 seconds
      instead of 4 seconds. This allows successful pairings with legacy and
      broken devices now.
      
      Based on a report by Johan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      052b30b0
  24. 27 2月, 2009 1 次提交
    • D
      Bluetooth: Move hci_conn_del_sysfs() back to avoid device destruct too early · 2ae9a6be
      Dave Young 提交于
      The following commit introduce a regression:
      
      	commit 7d0db0a3
      	Author: Marcel Holtmann <marcel@holtmann.org>
      	Date:   Mon Jul 14 20:13:51 2008 +0200
      
      		[Bluetooth] Use a more unique bus name for connections
      
      I get panic as following (by netconsole):
      
      [ 2709.344034] usb 5-1: new full speed USB device using uhci_hcd and address 4
      [ 2709.505776] usb 5-1: configuration #1 chosen from 1 choice
      [ 2709.569207] Bluetooth: Generic Bluetooth USB driver ver 0.4
      [ 2709.570169] usbcore: registered new interface driver btusb
      [ 2845.742781] BUG: unable to handle kernel paging request at 6b6b6c2f
      [ 2845.742958] IP: [<c015515c>] __lock_acquire+0x6c/0xa80
      [ 2845.743087] *pde = 00000000
      [ 2845.743206] Oops: 0002 [#1] SMP
      [ 2845.743377] last sysfs file: /sys/class/bluetooth/hci0/hci0:6/type
      [ 2845.743742] Modules linked in: btusb netconsole snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss rfcomm l2cap bluetooth vfat fuse snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_pcm pl2303 snd_timer psmouse usbserial snd 3c59x e100 serio_raw soundcore i2c_i801 intel_agp mii agpgart snd_page_alloc rtc_cmos rtc_core thermal processor rtc_lib button thermal_sys sg evdev
      [ 2845.743742]
      [ 2845.743742] Pid: 0, comm: swapper Not tainted (2.6.29-rc5-smp #54) Dell DM051
      [ 2845.743742] EIP: 0060:[<c015515c>] EFLAGS: 00010002 CPU: 0
      [ 2845.743742] EIP is at __lock_acquire+0x6c/0xa80
      [ 2845.743742] EAX: 00000046 EBX: 00000046 ECX: 6b6b6b6b EDX: 00000002
      [ 2845.743742] ESI: 6b6b6b6b EDI: 00000000 EBP: c064fd14 ESP: c064fcc8
      [ 2845.743742]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
      [ 2845.743742] Process swapper (pid: 0, ti=c064e000 task=c05d1400 task.ti=c064e000)
      [ 2845.743742] Stack:
      [ 2845.743742]  c05d1400 00000002 c05d1400 00000001 00000002 00000000 f65388dc c05d1400
      [ 2845.743742]  6b6b6b6b 00000292 c064fd0c c0153732 00000000 00000000 00000001 f700fa50
      [ 2845.743742]  00000046 00000000 00000000 c064fd40 c0155be6 00000000 00000002 00000001
      [ 2845.743742] Call Trace:
      [ 2845.743742]  [<c0153732>] ? trace_hardirqs_on_caller+0x72/0x1c0
      [ 2845.743742]  [<c0155be6>] ? lock_acquire+0x76/0xa0
      [ 2845.743742]  [<c03e1aad>] ? skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c046c885>] ? _spin_lock_irqsave+0x45/0x80
      [ 2845.743742]  [<c03e1aad>] ? skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c03e1aad>] ? skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c03e1f94>] ? skb_queue_purge+0x14/0x20
      [ 2845.743742]  [<f8171f5a>] ? hci_conn_del+0x10a/0x1c0 [bluetooth]
      [ 2845.743742]  [<f81399c9>] ? l2cap_disconn_ind+0x59/0xb0 [l2cap]
      [ 2845.743742]  [<f81795ce>] ? hci_conn_del_sysfs+0x8e/0xd0 [bluetooth]
      [ 2845.743742]  [<f8175758>] ? hci_event_packet+0x5f8/0x31c0 [bluetooth]
      [ 2845.743742]  [<c03dfe19>] ? sock_def_readable+0x59/0x80
      [ 2845.743742]  [<c046c14d>] ? _read_unlock+0x1d/0x20
      [ 2845.743742]  [<f8178aa9>] ? hci_send_to_sock+0xe9/0x1d0 [bluetooth]
      [ 2845.743742]  [<c015388b>] ? trace_hardirqs_on+0xb/0x10
      [ 2845.743742]  [<f816fa6a>] ? hci_rx_task+0x2ba/0x490 [bluetooth]
      [ 2845.743742]  [<c0133661>] ? tasklet_action+0x31/0xc0
      [ 2845.743742]  [<c013367c>] ? tasklet_action+0x4c/0xc0
      [ 2845.743742]  [<c0132eb7>] ? __do_softirq+0xa7/0x170
      [ 2845.743742]  [<c0116dec>] ? ack_apic_level+0x5c/0x1c0
      [ 2845.743742]  [<c0132fd7>] ? do_softirq+0x57/0x60
      [ 2845.743742]  [<c01333dc>] ? irq_exit+0x7c/0x90
      [ 2845.743742]  [<c01055bb>] ? do_IRQ+0x4b/0x90
      [ 2845.743742]  [<c01333d5>] ? irq_exit+0x75/0x90
      [ 2845.743742]  [<c010392c>] ? common_interrupt+0x2c/0x34
      [ 2845.743742]  [<c010a14f>] ? mwait_idle+0x4f/0x70
      [ 2845.743742]  [<c0101c05>] ? cpu_idle+0x65/0xb0
      [ 2845.743742]  [<c045731e>] ? rest_init+0x4e/0x60
      [ 2845.743742] Code: 0f 84 69 02 00 00 83 ff 07 0f 87 1e 06 00 00 85 ff 0f 85 08 05 00 00 8b 4d cc 8b 49 04 85 c9 89 4d d4 0f 84 f7 04 00 00 8b 75 d4 <f0> ff 86 c4 00 00 00 89 f0 e8 56 a9 ff ff 85 c0 0f 85 6e 03 00
      [ 2845.743742] EIP: [<c015515c>] __lock_acquire+0x6c/0xa80 SS:ESP 0068:c064fcc8
      [ 2845.743742] ---[ end trace 4c985b38f022279f ]---
      [ 2845.743742] Kernel panic - not syncing: Fatal exception in interrupt
      [ 2845.743742] ------------[ cut here ]------------
      [ 2845.743742] WARNING: at kernel/smp.c:329 smp_call_function_many+0x151/0x200()
      [ 2845.743742] Hardware name: Dell DM051
      [ 2845.743742] Modules linked in: btusb netconsole snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss rfcomm l2cap bluetooth vfat fuse snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_pcm pl2303 snd_timer psmouse usbserial snd 3c59x e100 serio_raw soundcore i2c_i801 intel_agp mii agpgart snd_page_alloc rtc_cmos rtc_core thermal processor rtc_lib button thermal_sys sg evdev
      [ 2845.743742] Pid: 0, comm: swapper Tainted: G      D    2.6.29-rc5-smp #54
      [ 2845.743742] Call Trace:
      [ 2845.743742]  [<c012e076>] warn_slowpath+0x86/0xa0
      [ 2845.743742]  [<c015041b>] ? trace_hardirqs_off+0xb/0x10
      [ 2845.743742]  [<c0146384>] ? up+0x14/0x40
      [ 2845.743742]  [<c012e661>] ? release_console_sem+0x31/0x1e0
      [ 2845.743742]  [<c046c8ab>] ? _spin_lock_irqsave+0x6b/0x80
      [ 2845.743742]  [<c015041b>] ? trace_hardirqs_off+0xb/0x10
      [ 2845.743742]  [<c046c900>] ? _read_lock_irqsave+0x40/0x80
      [ 2845.743742]  [<c012e7f2>] ? release_console_sem+0x1c2/0x1e0
      [ 2845.743742]  [<c0146384>] ? up+0x14/0x40
      [ 2845.743742]  [<c015041b>] ? trace_hardirqs_off+0xb/0x10
      [ 2845.743742]  [<c046a3d7>] ? __mutex_unlock_slowpath+0x97/0x160
      [ 2845.743742]  [<c046a563>] ? mutex_trylock+0xb3/0x180
      [ 2845.743742]  [<c046a4a8>] ? mutex_unlock+0x8/0x10
      [ 2845.743742]  [<c015b991>] smp_call_function_many+0x151/0x200
      [ 2845.743742]  [<c010a1a0>] ? stop_this_cpu+0x0/0x40
      [ 2845.743742]  [<c015ba61>] smp_call_function+0x21/0x30
      [ 2845.743742]  [<c01137ae>] native_smp_send_stop+0x1e/0x50
      [ 2845.743742]  [<c012e0f5>] panic+0x55/0x110
      [ 2845.743742]  [<c01065a8>] oops_end+0xb8/0xc0
      [ 2845.743742]  [<c010668f>] die+0x4f/0x70
      [ 2845.743742]  [<c011a8c9>] do_page_fault+0x269/0x610
      [ 2845.743742]  [<c011a660>] ? do_page_fault+0x0/0x610
      [ 2845.743742]  [<c046cbaf>] error_code+0x77/0x7c
      [ 2845.743742]  [<c015515c>] ? __lock_acquire+0x6c/0xa80
      [ 2845.743742]  [<c0153732>] ? trace_hardirqs_on_caller+0x72/0x1c0
      [ 2845.743742]  [<c0155be6>] lock_acquire+0x76/0xa0
      [ 2845.743742]  [<c03e1aad>] ? skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c046c885>] _spin_lock_irqsave+0x45/0x80
      [ 2845.743742]  [<c03e1aad>] ? skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c03e1aad>] skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c03e1f94>] skb_queue_purge+0x14/0x20
      [ 2845.743742]  [<f8171f5a>] hci_conn_del+0x10a/0x1c0 [bluetooth]
      [ 2845.743742]  [<f81399c9>] ? l2cap_disconn_ind+0x59/0xb0 [l2cap]
      [ 2845.743742]  [<f81795ce>] ? hci_conn_del_sysfs+0x8e/0xd0 [bluetooth]
      [ 2845.743742]  [<f8175758>] hci_event_packet+0x5f8/0x31c0 [bluetooth]
      [ 2845.743742]  [<c03dfe19>] ? sock_def_readable+0x59/0x80
      [ 2845.743742]  [<c046c14d>] ? _read_unlock+0x1d/0x20
      [ 2845.743742]  [<f8178aa9>] ? hci_send_to_sock+0xe9/0x1d0 [bluetooth]
      [ 2845.743742]  [<c015388b>] ? trace_hardirqs_on+0xb/0x10
      [ 2845.743742]  [<f816fa6a>] hci_rx_task+0x2ba/0x490 [bluetooth]
      [ 2845.743742]  [<c0133661>] ? tasklet_action+0x31/0xc0
      [ 2845.743742]  [<c013367c>] tasklet_action+0x4c/0xc0
      [ 2845.743742]  [<c0132eb7>] __do_softirq+0xa7/0x170
      [ 2845.743742]  [<c0116dec>] ? ack_apic_level+0x5c/0x1c0
      [ 2845.743742]  [<c0132fd7>] do_softirq+0x57/0x60
      [ 2845.743742]  [<c01333dc>] irq_exit+0x7c/0x90
      [ 2845.743742]  [<c01055bb>] do_IRQ+0x4b/0x90
      [ 2845.743742]  [<c01333d5>] ? irq_exit+0x75/0x90
      [ 2845.743742]  [<c010392c>] common_interrupt+0x2c/0x34
      [ 2845.743742]  [<c010a14f>] ? mwait_idle+0x4f/0x70
      [ 2845.743742]  [<c0101c05>] cpu_idle+0x65/0xb0
      [ 2845.743742]  [<c045731e>] rest_init+0x4e/0x60
      [ 2845.743742] ---[ end trace 4c985b38f02227a0 ]---
      [ 2845.743742] ------------[ cut here ]------------
      [ 2845.743742] WARNING: at kernel/smp.c:226 smp_call_function_single+0x8e/0x110()
      [ 2845.743742] Hardware name: Dell DM051
      [ 2845.743742] Modules linked in: btusb netconsole snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss rfcomm l2cap bluetooth vfat fuse snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_pcm pl2303 snd_timer psmouse usbserial snd 3c59x e100 serio_raw soundcore i2c_i801 intel_agp mii agpgart snd_page_alloc rtc_cmos rtc_core thermal processor rtc_lib button thermal_sys sg evdev
      [ 2845.743742] Pid: 0, comm: swapper Tainted: G      D W  2.6.29-rc5-smp #54
      [ 2845.743742] Call Trace:
      [ 2845.743742]  [<c012e076>] warn_slowpath+0x86/0xa0
      [ 2845.743742]  [<c012e000>] ? warn_slowpath+0x10/0xa0
      [ 2845.743742]  [<c015041b>] ? trace_hardirqs_off+0xb/0x10
      [ 2845.743742]  [<c0146384>] ? up+0x14/0x40
      [ 2845.743742]  [<c012e661>] ? release_console_sem+0x31/0x1e0
      [ 2845.743742]  [<c046c8ab>] ? _spin_lock_irqsave+0x6b/0x80
      [ 2845.743742]  [<c015041b>] ? trace_hardirqs_off+0xb/0x10
      [ 2845.743742]  [<c046c900>] ? _read_lock_irqsave+0x40/0x80
      [ 2845.743742]  [<c012e7f2>] ? release_console_sem+0x1c2/0x1e0
      [ 2845.743742]  [<c0146384>] ? up+0x14/0x40
      [ 2845.743742]  [<c015b7be>] smp_call_function_single+0x8e/0x110
      [ 2845.743742]  [<c010a1a0>] ? stop_this_cpu+0x0/0x40
      [ 2845.743742]  [<c026d23f>] ? cpumask_next_and+0x1f/0x40
      [ 2845.743742]  [<c015b95a>] smp_call_function_many+0x11a/0x200
      [ 2845.743742]  [<c010a1a0>] ? stop_this_cpu+0x0/0x40
      [ 2845.743742]  [<c015ba61>] smp_call_function+0x21/0x30
      [ 2845.743742]  [<c01137ae>] native_smp_send_stop+0x1e/0x50
      [ 2845.743742]  [<c012e0f5>] panic+0x55/0x110
      [ 2845.743742]  [<c01065a8>] oops_end+0xb8/0xc0
      [ 2845.743742]  [<c010668f>] die+0x4f/0x70
      [ 2845.743742]  [<c011a8c9>] do_page_fault+0x269/0x610
      [ 2845.743742]  [<c011a660>] ? do_page_fault+0x0/0x610
      [ 2845.743742]  [<c046cbaf>] error_code+0x77/0x7c
      [ 2845.743742]  [<c015515c>] ? __lock_acquire+0x6c/0xa80
      [ 2845.743742]  [<c0153732>] ? trace_hardirqs_on_caller+0x72/0x1c0
      [ 2845.743742]  [<c0155be6>] lock_acquire+0x76/0xa0
      [ 2845.743742]  [<c03e1aad>] ? skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c046c885>] _spin_lock_irqsave+0x45/0x80
      [ 2845.743742]  [<c03e1aad>] ? skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c03e1aad>] skb_dequeue+0x1d/0x70
      [ 2845.743742]  [<c03e1f94>] skb_queue_purge+0x14/0x20
      [ 2845.743742]  [<f8171f5a>] hci_conn_del+0x10a/0x1c0 [bluetooth]
      [ 2845.743742]  [<f81399c9>] ? l2cap_disconn_ind+0x59/0xb0 [l2cap]
      [ 2845.743742]  [<f81795ce>] ? hci_conn_del_sysfs+0x8e/0xd0 [bluetooth]
      [ 2845.743742]  [<f8175758>] hci_event_packet+0x5f8/0x31c0 [bluetooth]
      [ 2845.743742]  [<c03dfe19>] ? sock_def_readable+0x59/0x80
      [ 2845.743742]  [<c046c14d>] ? _read_unlock+0x1d/0x20
      [ 2845.743742]  [<f8178aa9>] ? hci_send_to_sock+0xe9/0x1d0 [bluetooth]
      [ 2845.743742]  [<c015388b>] ? trace_hardirqs_on+0xb/0x10
      [ 2845.743742]  [<f816fa6a>] hci_rx_task+0x2ba/0x490 [bluetooth]
      [ 2845.743742]  [<c0133661>] ? tasklet_action+0x31/0xc0
      [ 2845.743742]  [<c013367c>] tasklet_action+0x4c/0xc0
      [ 2845.743742]  [<c0132eb7>] __do_softirq+0xa7/0x170
      [ 2845.743742]  [<c0116dec>] ? ack_apic_level+0x5c/0x1c0
      [ 2845.743742]  [<c0132fd7>] do_softirq+0x57/0x60
      [ 2845.743742]  [<c01333dc>] irq_exit+0x7c/0x90
      [ 2845.743742]  [<c01055bb>] do_IRQ+0x4b/0x90
      [ 2845.743742]  [<c01333d5>] ? irq_exit+0x75/0x90
      [ 2845.743742]  [<c010392c>] common_interrupt+0x2c/0x34
      [ 2845.743742]  [<c010a14f>] ? mwait_idle+0x4f/0x70
      [ 2845.743742]  [<c0101c05>] cpu_idle+0x65/0xb0
      [ 2845.743742]  [<c045731e>] rest_init+0x4e/0x60
      [ 2845.743742] ---[ end trace 4c985b38f02227a1 ]---
      [ 2845.743742] Rebooting in 3 seconds..
      
      My logitec bluetooth mouse trying connect to pc, but
      pc side reject the connection again and again. then panic happens.
      
      The reason is due to hci_conn_del_sysfs now called in hci_event_packet,
      the del work is done in a workqueue, so it's possible done before
      skb_queue_purge called.
      
      I move the hci_conn_del_sysfs after skb_queue_purge just as that before
      marcel's commit.
      
      Remove the hci_conn_del_sysfs in hci_conn_hash_flush as well due to
      hci_conn_del will deal with the work.
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      2ae9a6be