From patchwork Mon Nov 28 17:28:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aniroop Mathur X-Patchwork-Id: 9449779 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 BB9E86074E for ; Mon, 28 Nov 2016 17:18:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA7E527F7F for ; Mon, 28 Nov 2016 17:18:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E07327F82; Mon, 28 Nov 2016 17:18:40 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 DCEF927F7F for ; Mon, 28 Nov 2016 17:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754521AbcK1RSi (ORCPT ); Mon, 28 Nov 2016 12:18:38 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33719 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754278AbcK1RSh (ORCPT ); Mon, 28 Nov 2016 12:18:37 -0500 Received: by mail-pg0-f65.google.com with SMTP id 3so13660166pgd.0; Mon, 28 Nov 2016 09:18:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=/2cX+b5YAOPIfj6d1IMcmQLGKrCaJyVUa0XA6L/LEAA=; b=htJPNjYN/H7KzTDYehPqrW05ATqrc4j3mvoKHmCMJjK06L3n/YNjj8fSk1ey0pB1j4 Y/mMNVjKE/E5VqOXbaTNAFGpv/fajuwKzU8y8QiEq4SSm1uRW1XBrSi2I+7G+2zQ2UgB ITTHbRIeHbHr+2MkXda65jtO2afc8Gb+WFMQWc+SENgj1YDsDfw//b6Mub8vweIKOTd9 NqLMETtnwd/No0z1L0q6m1ilHOS3jEiY/2wriAynHlRbu/2lCYfvHRFpWHPx1K2P+jNI GDjOg3Ud6BLkf/9CAa+VJSKriZwOdyPagdMgN2uv4SLOBAwybr4RWagYJ8rpW9aLNGJa iY5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=/2cX+b5YAOPIfj6d1IMcmQLGKrCaJyVUa0XA6L/LEAA=; b=VtIqu/am4QO+uCAoTlacJ6iHA6MeszIDlNf1zCLpoNmlbvAqSErHfik9WGrSirdfni ZX58P2xXmV3pXNrGdLvO5rzjc9sjX0nLQmkGuHw10u7Ide4Dek4Ypj6aOeJG18hGhgA1 Wui2gfmXXfIaznV/vj/H0yDIr4Xs/uAeQ+MGj/ExLuDTAtn77gnIYy8lF/Lq+yfc0zG1 96h1zbCCKVWxBkdR2BE81DHznqQI8eP24sZMULY0rd4KGGBe3fTgV5Zv5Z5YEMrkuVMJ /3Pp3OxuteeecqlXCNwmwtP7r+OVsNGNRqOnUcF60jA7CBMSnc6TL/9M3i4Y6wYSvJ2B 4Qjg== X-Gm-Message-State: AKaTC03slrurooyhr2wFsAsa6dwpOR7xHMc/ivR6brScn1pX1j0tApanDr9kHiNjWHPRMw== X-Received: by 10.98.166.136 with SMTP id r8mr22856259pfl.113.1480353517014; Mon, 28 Nov 2016 09:18:37 -0800 (PST) Received: from Aniroops-MacBook-Pro.local.name ([110.172.168.122]) by smtp.gmail.com with ESMTPSA id 24sm88693953pfh.41.2016.11.28.09.18.33 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Nov 2016 09:18:36 -0800 (PST) From: Aniroop Mathur To: lost.distance@yahoo.com, dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: s.samuel@samsung.com, r.mahale@samsung.com, aniroop.mathur@gmail.com, Aniroop Mathur Subject: [PATCH] Input: mouse: navpoint - Change msleep to usleep_range for small msecs Date: Mon, 28 Nov 2016 22:58:05 +0530 Message-Id: <1480354085-1885-1-git-send-email-a.mathur@samsung.com> X-Mailer: git-send-email 2.6.2 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 msleep(1~20) may not do what the caller intends, and will often sleep longer. (~20 ms actual sleep for any value given in the 1~20ms range) This is not the desired behaviour for many cases like device resume time, device suspend time, device enable time, retry logic, etc. Thus, change msleep to usleep_range for precise wakeups. Signed-off-by: Aniroop Mathur --- drivers/input/mouse/navpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c index d6e8f58..2ede00b 100644 --- a/drivers/input/mouse/navpoint.c +++ b/drivers/input/mouse/navpoint.c @@ -166,7 +166,7 @@ static void navpoint_up(struct navpoint *navpoint) for (timeout = 100; timeout != 0; --timeout) { if (!(pxa_ssp_read_reg(ssp, SSSR) & SSSR_CSS)) break; - msleep(1); + usleep_range(1000, 1100); } if (timeout == 0)