bluetooth: fix the concurrency issue while reading from SMD
The function used to read from SMD was causing a deadlock
as it can only be used in interrupt context. As we have
now added tasklet support, we are now reading in tasklet
context, and this patch uses the correct read function
to avoid deadlock.
CRs-Fixed: 314659
Change-Id: I66d1769ada884042169f486ca2aadabde9713b22
Signed-off-by: Ankur Nandwani <ankurn@codeaurora.org>
diff --git a/drivers/bluetooth/hci_smd.c b/drivers/bluetooth/hci_smd.c
index f3e0f6c..2ecddcf 100644
--- a/drivers/bluetooth/hci_smd.c
+++ b/drivers/bluetooth/hci_smd.c
@@ -147,7 +147,7 @@
goto out_data;
}
- rc = smd_read_from_cb(hsmd->data_channel, (void *)buf, len);
+ rc = smd_read(hsmd->data_channel, (void *)buf, len);
if (rc < len) {
BT_ERR("Error in reading from the channel");
goto out_data;
@@ -220,7 +220,7 @@
rc = -ENOMEM;
goto out_event;
}
- rc = smd_read_from_cb(hsmd->event_channel, (void *)buf, len);
+ rc = smd_read(hsmd->event_channel, (void *)buf, len);
if (rc < len) {
BT_ERR("Error in reading from the event channel");
goto out_event;