Commit 6cfeba4f authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Marcel Holtmann

[Bluetooth] Replace schedule_timeout() with msleep()

Use msleep() instead of schedule_timeout() to guarantee the task
delays at least the desired time amount.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 94ae4fb0
......@@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
......@@ -776,8 +777,7 @@ int bluecard_open(bluecard_info_t *info)
outb(0x80, iobase + 0x30);
/* Wait some time */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ / 100);
msleep(10);
/* Turn FPGA on */
outb(0x00, iobase + 0x30);
......@@ -823,8 +823,7 @@ int bluecard_open(bluecard_info_t *info)
outb((0x0f << RTS_LEVEL_SHIFT_BITS) | 1, iobase + REG_RX_CONTROL);
/* Timeout before it is safe to send the first HCI packet */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout((HZ * 5) / 4); // or set it to 3/2
msleep(1250);
/* Register HCI device */
if (hci_register_dev(hdev) < 0) {
......
......@@ -25,12 +25,11 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
......@@ -639,8 +638,7 @@ int bt3c_open(bt3c_info_t *info)
}
/* Timeout before it is safe to send the first HCI packet */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
msleep(1000);
/* Register HCI device */
err = hci_register_dev(hdev);
......
......@@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
......@@ -545,8 +546,7 @@ int btuart_open(btuart_info_t *info)
btuart_change_speed(info, DEFAULT_BAUD_RATE);
/* Timeout before it is safe to send the first HCI packet */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
msleep(1000);
/* Register HCI device */
if (hci_register_dev(hdev) < 0) {
......
......@@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
......@@ -524,8 +525,7 @@ int dtl1_open(dtl1_info_t *info)
spin_unlock_irqrestore(&(info->lock), flags);
/* Timeout before it is safe to send the first HCI packet */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ * 2);
msleep(2000);
/* Register HCI device */
if (hci_register_dev(hdev) < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment