HID: intel-ish-hid: ipc: use msleep_interrupt() for wait
authorEven Xu <even.xu@intel.com>
Fri, 11 Nov 2016 01:40:33 +0000 (09:40 +0800)
committerJiri Kosina <jkosina@suse.cz>
Wed, 16 Nov 2016 10:42:39 +0000 (11:42 +0100)
set_current_task() must be called before schedule_timeout(), for this
driver, in order to avoid incorrect usage, use msleep_interrupt()
instead.

Signed-off-by: Even Xu <even.xu@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/intel-ish-hid/ipc/ipc.c

index 3d46cc0eec70cd9f5e4e9fd9657ad4514a9cefae..b9bf04a3f267df40dccdb25eea9e4e2df86043b0 100644 (file)
@@ -539,6 +539,8 @@ static int ish_fw_reset_handler(struct ishtp_device *dev)
        return  0;
 }
 
+#define TIMEOUT_FOR_HW_RDY_MS                  300
+
 /**
  * ish_fw_reset_work_fn() - FW reset worker function
  * @unused: not used
@@ -552,7 +554,7 @@ static void fw_reset_work_fn(struct work_struct *unused)
        rv = ish_fw_reset_handler(ishtp_dev);
        if (!rv) {
                /* ISH is ILUP & ISHTP-ready. Restart ISHTP */
-               schedule_timeout(HZ / 3);
+               msleep_interruptible(TIMEOUT_FOR_HW_RDY_MS);
                ishtp_dev->recvd_hw_ready = 1;
                wake_up_interruptible(&ishtp_dev->wait_hw_ready);