1. 27 Sep, 2012 5 commits
    • Szymon Janc's avatar
      NFC: Fix sleeping in invalid context when netlink socket is closed · 3c0cc8aa
      Szymon Janc authored
      netlink_register_notifier requires notify functions to not sleep.
      nfc_stop_poll locks device mutex and must not be called from notifier.
      Create workqueue that will handle this for all devices.
      
      BUG: sleeping function called from invalid context at kernel/mutex.c:269
      in_atomic(): 0, irqs_disabled(): 0, pid: 4497, name: neard
      1 lock held by neard/4497:
      Pid: 4497, comm: neard Not tainted 3.5.0-999-nfc+ #5
      Call Trace:
      [<ffffffff810952c5>] __might_sleep+0x145/0x200
      [<ffffffff81743dde>] mutex_lock_nested+0x2e/0x50
      [<ffffffff816ffd19>] nfc_stop_poll+0x39/0xb0
      [<ffffffff81700a17>] nfc_genl_rcv_nl_event+0x77/0xc0
      [<ffffffff8174aa8c>] notifier_call_chain+0x5c/0x120
      [<ffffffff8174abd6>] __atomic_notifier_call_chain+0x86/0x140
      [<ffffffff8174ab50>] ? notifier_call_chain+0x120/0x120
      [<ffffffff815e1347>] ? skb_dequeue+0x67/0x90
      [<ffffffff8174aca6>] atomic_notifier_call_chain+0x16/0x20
      [<ffffffff8162119a>] netlink_release+0x24a/0x280
      [<ffffffff815d7aa8>] sock_release+0x28/0xa0
      [<ffffffff815d7be7>] sock_close+0x17/0x30
      [<ffffffff811b2a7c>] __fput+0xcc/0x250
      [<ffffffff811b2c0e>] ____fput+0xe/0x10
      [<ffffffff81085009>] task_work_run+0x69/0x90
      [<ffffffff8101b951>] do_notify_resume+0x81/0xd0
      [<ffffffff8174ef22>] int_signal+0x12/0x17
      Signed-off-by: default avatarSzymon Janc <szymon.janc@tieto.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      3c0cc8aa
    • John W. Linville's avatar
      NFC: Add dummy nfc_llc_shdlc_register definition · 7d777c3d
      John W. Linville authored
      This is used when CONFIG_NFC_SHDLC is disabled.
      Reported-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      7d777c3d
    • Thierry Escande's avatar
      NFC: LLCP raw socket support · 4463523b
      Thierry Escande authored
      This adds support for socket of type SOCK_RAW to LLCP.
      sk_buff are copied and sent to raw sockets with a 2 bytes extra header:
      The first byte header contains the nfc adapter index.
      The second one contains flags:
      - 0x01 - Direction (0=RX, 1=TX)
      - 0x02-0x80 - Reserved
      A raw socket has to be explicitly bound to a nfc adapter. This is achieved
      by specifying the adapter index to be bound to in the dev_idx field of the
      sockaddr_nfc_llcp struct passed to bind().
      Signed-off-by: default avatarThierry Escande <thierry.escande@linux.intel.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      4463523b
    • Szymon Janc's avatar
      NFC: Fix missing mutex unlock in pn533_send_cmd_frame_async · ee5e8d81
      Szymon Janc authored
      If command allocation failed cmd_lock was not released and deadlock
      would occur.
      Signed-off-by: default avatarSzymon Janc <szymon.janc@tieto.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      ee5e8d81
    • Szymon Janc's avatar
      NFC: Use dynamic initialization for rwlocks · fe235b58
      Szymon Janc authored
      If rwlock is dynamically allocated but statically initialized it is
      missing proper lockdep annotation.
      
      INFO: trying to register non-static key.
      the code is fine but needs lockdep annotation.
      turning off the locking correctness validator.
      Pid: 3352, comm: neard Not tainted 3.5.0-999-nfc+ #2
      Call Trace:
      [<ffffffff810c8526>] __lock_acquire+0x8f6/0x1bf0
      [<ffffffff81739045>] ? printk+0x4d/0x4f
      [<ffffffff810c9eed>] lock_acquire+0x9d/0x220
      [<ffffffff81702bfe>] ? nfc_llcp_sock_from_sn+0x4e/0x160
      [<ffffffff81746724>] _raw_read_lock+0x44/0x60
      [<ffffffff81702bfe>] ? nfc_llcp_sock_from_sn+0x4e/0x160
      [<ffffffff81702bfe>] nfc_llcp_sock_from_sn+0x4e/0x160
      [<ffffffff817034a7>] nfc_llcp_get_sdp_ssap+0xa7/0x1b0
      [<ffffffff81706353>] llcp_sock_bind+0x173/0x210
      [<ffffffff815d9c94>] sys_bind+0xe4/0x100
      [<ffffffff8139209e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      [<ffffffff8174ea69>] system_call_fastpath+0x16/0x1b
      Signed-off-by: default avatarSzymon Janc <szymon.janc@tieto.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      fe235b58
  2. 25 Sep, 2012 10 commits
  3. 24 Sep, 2012 25 commits