Skip to contentSkip to conversation

kernel/input: increase the number of retries in open_device

PATCH New Stanislav Kholmanskikh 2 participants 3 messages Jan 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/input: increase the number of retries in open_device

In some environments the current limit (2) is not enough, and only 3rd or 4th access will succeed. Therefore, let's increase it slightly. The new limit (10) is the same value we have in open_uinput().

---

Without this patch inputXX test cases fail with:

[root@skholman-m7 input]# ./input01

input01     0  TINFO  :  Trying to load uinput kernel module
input01     0  TINFO  :  Uinput dev not found, retrying...
input01     0  TINFO  :  Uinput dev not found, retrying...
input01     0  TINFO  :  Uinput dev not found, retrying...
input01     0  TINFO  :  Found uinput dev at /dev/uinput
input01     0  TINFO  :  Device not found, retrying...
input01     0  TINFO  :  Device not found, retrying...
input01     1  TPASS  :  Data received from eventX
input01     0  TINFO  :  Unloading uinput kernel module

in our environment (an in-house, relatively old kernel).

Can we have this patch before the release?

Thanks!

 testcases/kernel/input/input_helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/input/input_helper.c +1 -1
index 71c5dec..08fa81c 100644
@@ -72,7 +72,7 @@ static int try_open_device(void)
 int open_device(void)
 {
 	int fd;
-	int retries = 2;
+	int retries = 10;
 
 	while (retries--) {
 		fd = try_open_device();
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 kernel/input: increase the number of retries in open_device

Hi!

Quoted 3 lines

In some environments the current limit (2) is not enough, and only 3rd or 4th access will succeed. Therefore, let's increase it slightly. The new limit (10) is the same value we have in open_uinput().

Acked. Thanks for the testing :).

Signature · 2 lines
Cyril Hrubis
[email protected]
#2 lore raw

PATCH 1/1 kernel/input: increase the number of retries in open_device

Quoted 7 lines · Cyril Hrubis

Hi!

Quoted 3 lines

In some environments the current limit (2) is not enough, and only 3rd or 4th access will succeed. Therefore, let's increase it slightly. The new limit (10) is the same value we have in open_uinput().

Acked. Thanks for the testing :).

Thanks, and the example output from my message is not correct ( I mistakenly pasted it there), the correct one is:

input01     0  TINFO  :  Trying to load uinput kernel module
input01     0  TINFO  :  Uinput dev not found, retrying...
input01     0  TINFO  :  Uinput dev not found, retrying...
input01     0  TINFO  :  Uinput dev not found, retrying...
input01     0  TINFO  :  Found uinput dev at /dev/uinput
input01     0  TINFO  :  Device not found, retrying...
input01     0  TINFO  :  Device not found, retrying...
input01     1  TBROK  :  input_helper.c:85: Unable to find the input device
input01     2  TBROK  :  input_helper.c:85: Remaining cases broken

:-[

Committed.