From patchwork Fri Nov 11 01:40:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xu, Even" X-Patchwork-Id: 9422355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB8F760512 for ; Fri, 11 Nov 2016 01:40:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6C222986A for ; Fri, 11 Nov 2016 01:40:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBB382986C; Fri, 11 Nov 2016 01:40:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBE602986B for ; Fri, 11 Nov 2016 01:40:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936298AbcKKBkO (ORCPT ); Thu, 10 Nov 2016 20:40:14 -0500 Received: from mga03.intel.com ([134.134.136.65]:28419 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935107AbcKKBkN (ORCPT ); Thu, 10 Nov 2016 20:40:13 -0500 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP; 10 Nov 2016 17:40:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,620,1473145200"; d="scan'208";a="29958614" Received: from ubuntu-kabylake-client-platform.sh.intel.com ([10.239.154.111]) by fmsmga006.fm.intel.com with ESMTP; 10 Nov 2016 17:40:11 -0800 From: Even Xu To: jikos@kernel.org Cc: linux-input@vger.kernel.org, srinivas.pandruvada@intel.com, Even Xu Subject: [PATCH 3/3] hid: intel-ish-hid: ipc: use msleep_interrupt() for wait Date: Fri, 11 Nov 2016 09:40:33 +0800 Message-Id: <1478828433-31779-1-git-send-email-even.xu@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/hid/intel-ish-hid/ipc/ipc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c index 8194c35..86a36eb 100644 --- a/drivers/hid/intel-ish-hid/ipc/ipc.c +++ b/drivers/hid/intel-ish-hid/ipc/ipc.c @@ -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);