05 Oct, 2012
1 commit
-
Validation of userspace input shouldn't trigger dmesg spamming.
Signed-off-by: Dave Jones
Signed-off-by: David S. Miller
03 Oct, 2012
1 commit
-
The network merge brought in a few users of functions that got
deprecated by the workqueue cleanups: the 'system_nrt_wq' is now the
same as the regular system_wq, since all workqueues are now non-
reentrant.Similarly, remove one use of flush_work_sync() - the regular
flush_work() has become synchronous, and the "_sync()" version is thus
deprecated as being superfluous.Signed-off-by: Linus Torvalds
28 Sep, 2012
1 commit
-
…wireless-next into for-davem
Conflicts:
net/nfc/netlink.cSigned-off-by: John W. Linville <linville@tuxdriver.com>
27 Sep, 2012
5 commits
-
nfc_llcp_socket_release is calling lock_sock/release_sock while holding
write lock for rwlock. Use bh_lock/unlock_sock instead.BUG: sleeping function called from invalid context at net/core/sock.c:2138
in_atomic(): 1, irqs_disabled(): 0, pid: 56, name: kworker/1:1
4 locks held by kworker/1:1/56:
Pid: 56, comm: kworker/1:1 Not tainted 3.5.0-999-nfc+ #7
Call Trace:
[] __might_sleep+0x145/0x200
[] lock_sock_nested+0x36/0xa0
[] ? _raw_write_lock+0x49/0x50
[] ? nfc_llcp_socket_release+0x30/0x200 [nfc]
[] nfc_llcp_socket_release+0x52/0x200 [nfc]
[] nfc_llcp_mac_is_down+0x20/0x30 [nfc]
[] nfc_dep_link_down+0xaa/0xf0 [nfc]
[] nfc_llcp_timeout_work+0x15/0x20 [nfc]
[] process_one_work+0x197/0x7c0
[] ? process_one_work+0x136/0x7c0
[] ? __schedule+0x419/0x9c0
[] ? nfc_llcp_build_gb+0x1b0/0x1b0 [nfc]
[] worker_thread+0x190/0x4c0
[] ? rescuer_thread+0x2a0/0x2a0
[] kthread+0xae/0xc0
[] ? trace_hardirqs_on+0xd/0x10
[] kernel_thread_helper+0x4/0x10
[] ? retint_restore_args+0x13/0x13
[] ? flush_kthread_worker+0x150/0x150
[] ? gs_change+0x13/0x13Signed-off-by: Szymon Janc
Signed-off-by: Samuel Ortiz -
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:
[] __might_sleep+0x145/0x200
[] mutex_lock_nested+0x2e/0x50
[] nfc_stop_poll+0x39/0xb0
[] nfc_genl_rcv_nl_event+0x77/0xc0
[] notifier_call_chain+0x5c/0x120
[] __atomic_notifier_call_chain+0x86/0x140
[] ? notifier_call_chain+0x120/0x120
[] ? skb_dequeue+0x67/0x90
[] atomic_notifier_call_chain+0x16/0x20
[] netlink_release+0x24a/0x280
[] sock_release+0x28/0xa0
[] sock_close+0x17/0x30
[] __fput+0xcc/0x250
[] ____fput+0xe/0x10
[] task_work_run+0x69/0x90
[] do_notify_resume+0x81/0xd0
[] int_signal+0x12/0x17Signed-off-by: Szymon Janc
Signed-off-by: Samuel Ortiz -
This is used when CONFIG_NFC_SHDLC is disabled.
Reported-by: Randy Dunlap
Signed-off-by: John W. Linville
Signed-off-by: Samuel Ortiz -
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: Thierry Escande
Signed-off-by: Samuel Ortiz -
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:
[] __lock_acquire+0x8f6/0x1bf0
[] ? printk+0x4d/0x4f
[] lock_acquire+0x9d/0x220
[] ? nfc_llcp_sock_from_sn+0x4e/0x160
[] _raw_read_lock+0x44/0x60
[] ? nfc_llcp_sock_from_sn+0x4e/0x160
[] nfc_llcp_sock_from_sn+0x4e/0x160
[] nfc_llcp_get_sdp_ssap+0xa7/0x1b0
[] llcp_sock_bind+0x173/0x210
[] sys_bind+0xe4/0x100
[] ? trace_hardirqs_on_thunk+0x3a/0x3f
[] system_call_fastpath+0x16/0x1bSigned-off-by: Szymon Janc
Signed-off-by: Samuel Ortiz
25 Sep, 2012
22 commits
-
Signed-off-by: Waldemar Rymarkiewicz
Signed-off-by: Samuel Ortiz -
During processing incoming RSET frame chip, possibly due to
its internal timout, can retrnasmit an another RSET which
is next queued for processing in shdlc layer.In case when we accept processed RSET skip those remaining on
the rcv queue until chip will send it's first S or I frame.
This will mean the chip completed connection as well.Signed-off-by: Waldemar Rymarkiewicz
Signed-off-by: Samuel Ortiz -
As queue_work() does not guarantee immediate execution of sm_work it
can happen in crossover RSET usecase that connect timer will constantly
change the shdlc state from NEGOTIATING to CONNECTING before shdlc has
chance to handle incoming frame.Signed-off-by: Waldemar Rymarkiewicz
Acked-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
After fixing the LLC Makefile, we no longer need those exports.
Signed-off-by: Samuel Ortiz
-
The previous shdlc HCI driver and its header are removed from the tree.
PN544 now registers directly with HCI and passes the name of the llc it
requires (shdlc).
HCI instantiation now allocates the required llc instance. The llc is
started when the HCI device is brought up.Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
This is used by HCI drivers such as the one for the pn544 which require
communications between HCI and the chip to use shdlc.Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
This is a passthrough llc. It can be used by HCI drivers that don't
need link layer control. HCI will then write directly to the driver, and
driver will deliver incoming frames directly to HCI without any
processing.Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
The LLC layer manages modules that control the link layer protocol (such
as shdlc) between HCI and an HCI driver. The driver must simply specify
the required llc when it registers with HCI.Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
This enables the completion callback to be called from a different
context, preventing a possible deadlock if the callback resulted in the
invocation of a nested call to the currently locked nfc_dev.
This is also more in line with the im_transceive nfc_ops for NFC Core or
NCI drivers which already behave asynchronously.Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
This method initiates execution of an HCI cmd. Result will be delivered
through an asynchronous callback.Signed-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
Make it match the data_exchange_cb_t so that it can be used directly in
the implementation of an asynchronous hci_transceiveSigned-off-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
Driver must handle its data added to the frame, so at this point
removeing control field of shdlc frame is enough.Signed-off-by: Waldemar Rymarkiewicz
Acked-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
Checksum is specific for a chip spcification and it varies
(in size and type) between different hardware. It should be
handled in the driver then.Moreover, shdlc spec doesn't mention crc as a part of the frame.
Update pn544_hci driver as well.
Signed-off-by: Waldemar Rymarkiewicz
Acked-by: Eric Lapuyade
Signed-off-by: Samuel Ortiz -
nfc_llcp_build_tlv() malloced the memory and should be free in
nfc_llcp_build_gb() after used, and the same in the error handling
case, otherwise it will cause memory leak.spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)Signed-off-by: Wei Yongjun
Signed-off-by: Samuel Ortiz -
Signed-off-by: Wei Yongjun
Signed-off-by: Samuel Ortiz -
NFC is using a number of custom ordered workqueues w/ WQ_MEM_RECLAIM.
WQ_MEM_RECLAIM is unnecessary unless NFC is gonna be used as transport
for storage device, and all use cases match one work item to one
ordered workqueue - IOW, there's no actual ordering going on at all
and using system_nrt_wq gives the same behavior.There's nothing to be gained by using custom workqueues. Use
system_nrt_wq instead and drop all the custom ones.Signed-off-by: Tejun Heo
Signed-off-by: Samuel Ortiz -
This patch remove the repeated code for checking llcp_sock &
llcp_sock->dev against NULL.Signed-off-by: Syam Sidhardhan
Signed-off-by: Samuel Ortiz -
During NFC-DEP target activation, store the remote
general bytes to be used later in dep_link_up.
When dep_link_up is called, activate the NFC-DEP target,
and forward the remote general bytes.
When dep_link_down is called, deactivate the target.Signed-off-by: Ilan Elias
Signed-off-by: Samuel Ortiz -
Signed-off-by: Ilan Elias
Signed-off-by: Samuel Ortiz -
If initiator protocol is NFC-DEP, set the local general bytes
in nci_start_poll.Signed-off-by: Ilan Elias
Signed-off-by: Samuel Ortiz
11 Sep, 2012
1 commit
-
It is a frequent mistake to confuse the netlink port identifier with a
process identifier. Try to reduce this confusion by renaming fields
that hold port identifiers portid instead of pid.I have carefully avoided changing the structures exported to
userspace to avoid changing the userspace API.I have successfully built an allyesconfig kernel with this change.
Signed-off-by: "Eric W. Biederman"
Acked-by: Stephen Hemminger
Signed-off-by: David S. Miller
21 Jul, 2012
1 commit
-
…wireless-next into for-davem
18 Jul, 2012
1 commit
13 Jul, 2012
3 commits
-
Signed-off-by: Dave Jones
Signed-off-by: Samuel Ortiz
Signed-off-by: John W. Linville -
Without the discovered target nfcid1 and its length set properly, type 2
tags detection fails with the pn544 as it checks for them from
pn544_hci_complete_target_discovered().Signed-off-by: Eric Lapuyade
Reported-by: Mathias Jeppsson
Signed-off-by: Samuel Ortiz
Signed-off-by: John W. Linville -
…wireless-next into for-davem
11 Jul, 2012
1 commit
-
Conflicts:
net/batman-adv/bridge_loop_avoidance.c
net/batman-adv/bridge_loop_avoidance.h
net/batman-adv/soft-interface.c
net/mac80211/mlme.cWith merge help from Antonio Quartulli (batman-adv) and
Stephen Rothwell (drivers/net/usb/qmi_wwan.c).The net/mac80211/mlme.c conflict seemed easy enough, accounting for a
conversion to some new tracing macros.Signed-off-by: David S. Miller
10 Jul, 2012
3 commits
-
The HCP message should be added to transmit queue, not the other way around.
Signed-off-by: Mathias Jeppsson
Signed-off-by: Samuel Ortiz
Signed-off-by: John W. Linville -
list_first_entry() will never return NULL. Instead use
list_for_each_entry_safe() to iterate through the list.Signed-off-by: Mathias Jeppsson
Signed-off-by: Samuel Ortiz
Signed-off-by: John W. Linville -
They both can potentially be NULL.
Signed-off-by: Samuel Ortiz