From: Nicholas Mc Guire <hofrat@osadl.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@bitmath.org>,
Dudley Du <dudl@cypress.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Nicholas Mc Guire <hofrat@osadl.org>
Subject: [PATCH] Input: cyapa_gen3: use msleep() for long delay
Date: Sun, 15 Jan 2017 12:13:07 +0100 [thread overview]
Message-ID: <1484478787-13178-1-git-send-email-hofrat@osadl.org> (raw)
ulseep_range() uses hrtimers and provides no advantage over msleep()
for larger delays. Fix up the 50ms delays here to use msleep() and
reduce the load on the hrtimer subsystem.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
Problem found by coccinelle script
As the needed delay is specified in the comment as being "at least 50ms"
the msleep(50) should be fine here.
Note that cyapa_gen3_bl_exit() is returning -EAGAIN in cases where it was
not yet ready to process the request, but the calling side
cyapa_gen3_do_operational_check() does not check for -EAGAIN so in case of
the noted increased delay "...can take up to an additional 2 seconds. If
the device power is running low, this may take even longer", maybe
cyapa_gen3_do_operational_check() may need a retry loop on -EAGAIN ?
Patch was compile tested with: x86_64_defconfig + CONFIG_MOUSE_CYAPA=m
Patch is against 4.10-rc3 (localversion-next is next-20170113)
drivers/input/mouse/cyapa_gen3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/mouse/cyapa_gen3.c b/drivers/input/mouse/cyapa_gen3.c
index f9600753..6e9ecb0 100644
--- a/drivers/input/mouse/cyapa_gen3.c
+++ b/drivers/input/mouse/cyapa_gen3.c
@@ -562,7 +562,7 @@ static int cyapa_gen3_bl_exit(struct cyapa *cyapa)
* Wait for bootloader to exit, and operation mode to start.
* Normally, this takes at least 50 ms.
*/
- usleep_range(50000, 100000);
+ msleep(50);
/*
* In addition, when a device boots for the first time after being
* updated to new firmware, it must first calibrate its sensors, which
--
2.1.4
next reply other threads:[~2017-01-15 11:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-15 11:13 Nicholas Mc Guire [this message]
2017-01-15 23:20 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484478787-13178-1-git-send-email-hofrat@osadl.org \
--to=hofrat@osadl.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dudl@cypress.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@bitmath.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®