1. 24 8月, 2009 1 次提交
  2. 23 8月, 2009 21 次提交
  3. 06 8月, 2009 1 次提交
  4. 04 8月, 2009 1 次提交
  5. 06 7月, 2009 1 次提交
  6. 18 6月, 2009 1 次提交
  7. 14 6月, 2009 1 次提交
  8. 08 6月, 2009 8 次提交
  9. 27 5月, 2009 1 次提交
    • D
      Bluetooth: Remove useless flush_work() causing lockdep warnings · 4c713189
      Dave Young 提交于
      The calls to flush_work() are pointless in a single thread workqueue
      and they are actually causing a lockdep warning.
      
      =============================================
      [ INFO: possible recursive locking detected ]
      2.6.30-rc6-02911-gbb803cfb #16
      ---------------------------------------------
      bluetooth/2518 is trying to acquire lock:
       (bluetooth){+.+.+.}, at: [<c0130c14>] flush_work+0x28/0xb0
      
      but task is already holding lock:
       (bluetooth){+.+.+.}, at: [<c0130424>] worker_thread+0x149/0x25e
      
      other info that might help us debug this:
      2 locks held by bluetooth/2518:
       #0:  (bluetooth){+.+.+.}, at: [<c0130424>] worker_thread+0x149/0x25e
       #1:  (&conn->work_del){+.+...}, at: [<c0130424>] worker_thread+0x149/0x25e
      
      stack backtrace:
      Pid: 2518, comm: bluetooth Not tainted 2.6.30-rc6-02911-gbb803cfb #16
      Call Trace:
       [<c03d64d9>] ? printk+0xf/0x11
       [<c0140d96>] __lock_acquire+0x7ce/0xb1b
       [<c0141173>] lock_acquire+0x90/0xad
       [<c0130c14>] ? flush_work+0x28/0xb0
       [<c0130c2e>] flush_work+0x42/0xb0
       [<c0130c14>] ? flush_work+0x28/0xb0
       [<f8b84966>] del_conn+0x1c/0x84 [bluetooth]
       [<c0130469>] worker_thread+0x18e/0x25e
       [<c0130424>] ? worker_thread+0x149/0x25e
       [<f8b8494a>] ? del_conn+0x0/0x84 [bluetooth]
       [<c0133843>] ? autoremove_wake_function+0x0/0x33
       [<c01302db>] ? worker_thread+0x0/0x25e
       [<c013355a>] kthread+0x45/0x6b
       [<c0133515>] ? kthread+0x0/0x6b
       [<c01034a7>] kernel_thread_helper+0x7/0x10
      
      Based on a report by Oliver Hartkopp <oliver@hartkopp.net>
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Tested-by: NOliver Hartkopp <oliver@hartkopp.net>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      4c713189
  10. 10 5月, 2009 3 次提交
    • M
      Bluetooth: Don't trigger disconnect timeout for security mode 3 pairing · 3d7a9d1c
      Marcel Holtmann 提交于
      A remote device in security mode 3 that tries to connect will require
      the pairing during the connection setup phase. The disconnect timeout
      is now triggered within 10 milliseconds and causes the pairing to fail.
      
      If a connection is not fully established and a PIN code request is
      received, don't trigger the disconnect timeout. The either successful
      or failing connection complete event will make sure that the timeout
      is triggered at the right time.
      
      The biggest problem with security mode 3 is that many Bluetooth 2.0
      device and before use a temporary security mode 3 for dedicated
      bonding.
      
      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>
      3d7a9d1c
    • 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
  11. 06 5月, 2009 1 次提交
    • M
      Bluetooth: Move dev_set_name() to a context that can sleep · 457ca7bb
      Marcel Holtmann 提交于
      Setting the name of a sysfs device has to be done in a context that can
      actually sleep. It allocates its memory with GFP_KERNEL. Previously it
      was a static (size limited) string and that got changed to accommodate
      longer device names. So move the dev_set_name() just before calling
      device_add() which is executed in a work queue.
      
      This fixes the following error:
      
      [  110.012125] BUG: sleeping function called from invalid context at mm/slub.c:1595
      [  110.012135] in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper
      [  110.012141] 2 locks held by swapper/0:
      [  110.012145]  #0:  (hci_task_lock){++.-.+}, at: [<ffffffffa01f822f>] hci_rx_task+0x2f/0x2d0 [bluetooth]
      [  110.012173]  #1:  (&hdev->lock){+.-.+.}, at: [<ffffffffa01fb9e2>] hci_event_packet+0x72/0x25c0 [bluetooth]
      [  110.012198] Pid: 0, comm: swapper Tainted: G        W 2.6.30-rc4-g953cdaa #1
      [  110.012203] Call Trace:
      [  110.012207]  <IRQ>  [<ffffffff8023eabd>] __might_sleep+0x14d/0x170
      [  110.012228]  [<ffffffff802cfbe1>] __kmalloc+0x111/0x170
      [  110.012239]  [<ffffffff803c2094>] kvasprintf+0x64/0xb0
      [  110.012248]  [<ffffffff803b7a5b>] kobject_set_name_vargs+0x3b/0xa0
      [  110.012257]  [<ffffffff80465326>] dev_set_name+0x76/0xa0
      [  110.012273]  [<ffffffffa01fb9e2>] ? hci_event_packet+0x72/0x25c0 [bluetooth]
      [  110.012289]  [<ffffffffa01ffc1d>] hci_conn_add_sysfs+0x3d/0x70 [bluetooth]
      [  110.012303]  [<ffffffffa01fba2c>] hci_event_packet+0xbc/0x25c0 [bluetooth]
      [  110.012312]  [<ffffffff80516eb0>] ? sock_def_readable+0x80/0xa0
      [  110.012328]  [<ffffffffa01fee0c>] ? hci_send_to_sock+0xfc/0x1c0 [bluetooth]
      [  110.012343]  [<ffffffff80516eb0>] ? sock_def_readable+0x80/0xa0
      [  110.012347]  [<ffffffff805e88c5>] ? _read_unlock+0x75/0x80
      [  110.012354]  [<ffffffffa01fee0c>] ? hci_send_to_sock+0xfc/0x1c0 [bluetooth]
      [  110.012360]  [<ffffffffa01f8403>] hci_rx_task+0x203/0x2d0 [bluetooth]
      [  110.012365]  [<ffffffff80250ab5>] tasklet_action+0xb5/0x160
      [  110.012369]  [<ffffffff8025116c>] __do_softirq+0x9c/0x150
      [  110.012372]  [<ffffffff805e850f>] ? _spin_unlock+0x3f/0x80
      [  110.012376]  [<ffffffff8020cbbc>] call_softirq+0x1c/0x30
      [  110.012380]  [<ffffffff8020f01d>] do_softirq+0x8d/0xe0
      [  110.012383]  [<ffffffff80250df5>] irq_exit+0xc5/0xe0
      [  110.012386]  [<ffffffff8020e71d>] do_IRQ+0x9d/0x120
      [  110.012389]  [<ffffffff8020c3d3>] ret_from_intr+0x0/0xf
      [  110.012391]  <EOI>  [<ffffffff80431832>] ? acpi_idle_enter_bm+0x264/0x2a6
      [  110.012399]  [<ffffffff80431828>] ? acpi_idle_enter_bm+0x25a/0x2a6
      [  110.012403]  [<ffffffff804f50d5>] ? cpuidle_idle_call+0xc5/0x130
      [  110.012407]  [<ffffffff8020a4b4>] ? cpu_idle+0xc4/0x130
      [  110.012411]  [<ffffffff805d2268>] ? rest_init+0x88/0xb0
      [  110.012416]  [<ffffffff807e2fbd>] ? start_kernel+0x3b5/0x412
      [  110.012420]  [<ffffffff807e2281>] ? x86_64_start_reservations+0x91/0xb5
      [  110.012424]  [<ffffffff807e2394>] ? x86_64_start_kernel+0xef/0x11b
      
      Based on a report by Davide Pesavento <davidepesa@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Tested-by: NHugo Mildenberger <hugo.mildenberger@namir.de>
      Tested-by: NBing Zhao <bzhao@marvell.com>
      457ca7bb