aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@collabora.com>2016-06-16 14:25:20 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2016-07-06 04:02:07 -0400
commite3e0258839a01f793a8a0c0885e8ad387681cdc6 (patch)
treec4f6ae156e587151679ee6cab49da4a8d0c09f3b
parent256f3ee3d1468660ca3b10ad3beab7e8f6cbd969 (diff)
NFC: port100: Don't send a new command if one is still pending
This patch ensures that a command is not still in process before sending a new one to the device. This can happen when neard is in constant polling mode: the configure_hw command can be sent when neard restarts polling after a LLCP SYMM timeout but before the device has returned in timeout from the last DEP frame sent. Signed-off-by: Thierry Escande <thierry.escande@collabora.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/nfc/port100.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
index 2d4bbe3fad57..14a3cc2d0fd6 100644
--- a/drivers/nfc/port100.c
+++ b/drivers/nfc/port100.c
@@ -809,6 +809,12 @@ static int port100_send_cmd_async(struct port100 *dev, u8 cmd_code,
809 PORT100_FRAME_MAX_PAYLOAD_LEN + 809 PORT100_FRAME_MAX_PAYLOAD_LEN +
810 PORT100_FRAME_TAIL_LEN; 810 PORT100_FRAME_TAIL_LEN;
811 811
812 if (dev->cmd) {
813 nfc_err(&dev->interface->dev,
814 "A command is still in process\n");
815 return -EBUSY;
816 }
817
812 resp = alloc_skb(resp_len, GFP_KERNEL); 818 resp = alloc_skb(resp_len, GFP_KERNEL);
813 if (!resp) 819 if (!resp)
814 return -ENOMEM; 820 return -ENOMEM;