HID: logitech-dj: Fix USB 3.0 issue
[firefly-linux-kernel-4.4.55.git] / drivers / hid / hid-logitech-dj.c
index a7947d8251a88af3ecb017a7e597556cd0c046ff..f45279c3b11a9f241f6b0f28d1565ef965c04587 100644 (file)
@@ -516,6 +516,14 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
        dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = (u8)timeout;
        retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
        kfree(dj_report);
+
+       /*
+        * Ugly sleep to work around a USB 3.0 bug when the receiver is still
+        * processing the "switch-to-dj" command while we send an other command.
+        * 50 msec should gives enough time to the receiver to be ready.
+        */
+       msleep(50);
+
        return retval;
 }