Skip to contentSkip to conversation

input: add kernel version check

PATCH New Xiao Yang 2 participants 5 messages Feb 19, 2016 – Mar 31, 2016

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/1 input: add kernel version check

In this test case, the functionality of input has been improved by following patch:
'commit 4369c64c79a2 ("Input: Send events one packet at a time")'. So it's not appropriate for testing on kernels that are lower than 3.7.0 anymore.

---
 testcases/kernel/input/input04.c | 5 +++++
 testcases/kernel/input/input05.c | 5 +++++
 2 files changed, 10 insertions(+)
testcases/kernel/input/input04.c +5 -0
index 4b16ca7..153a47f 100644
@@ -75,6 +75,11 @@ int main(int ac, char **av)
 
 static void setup(void)
 {
+	if ((tst_kvercmp(3, 7, 0)) < 0) {
+		tst_brkm(TCONF, NULL, "This test can run successfully on "
+			 "kernels that are 3.7.0 and higher");
+	}
+
 	tst_require_root();
 
 	fd = open_uinput();
testcases/kernel/input/input05.c +5 -0
index 5ca01d8..6769e95 100644
@@ -79,6 +79,11 @@ int main(int ac, char **av)
 
 static void setup(void)
 {
+	if ((tst_kvercmp(3, 7, 0)) < 0) {
+		tst_brkm(TCONF, NULL, "This test can run successfully on "
+			 "kernels that are 3.7.0 and higher");
+	}
+
 	tst_require_root();
 
 	fd = open_uinput();
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 input: add kernel version check

Hi!

Quoted 5 lines

In this test case, the functionality of input has been improved by following patch:
'commit 4369c64c79a2 ("Input: Send events one packet at a time")'. So it's not appropriate for testing on kernels that are lower than 3.7.0 anymore.

Are you sure that you have pointed out right commit? The commit description does not seem relevant.

Also can you please describe why the testcases fail before 3.7.0 and how? Does kernel send empty sync events?

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

PATCH 1/1 input: add kernel version check

Quoted 6 lines · Cyril Hrubis

Hi!

Quoted 5 lines

In this test case, the functionality of input has been improved by following patch:
'commit 4369c64c79a2 ("Input: Send events one packet at a time")'. So it's not appropriate for testing on kernels that are lower than 3.7.0 anymore.

Quoted 6 lines

Are you sure that you have pointed out right commit? The commit description does not seem relevant.

Also can you please describe why the testcases fail before 3.7.0 and how? Does kernel send empty sync events?

Hi !
I'm so sorry to reply this email late.
kernel will send empty sync evnets when there are no new events, because sync(boolean type)
is set ture when there are no new events. if mouse isn't moving, i think that nothing is received
in /dev/input/eventX. this patch imporved this function. that's right?

author
#3 lore raw

PATCH 1/1 input: add kernel version check

In reply to Cyril Hrubis
Quoted 6 lines · Cyril Hrubis

Hi!

Quoted 5 lines

In this test case, the functionality of input has been improved by following patch:
'commit 4369c64c79a2 ("Input: Send events one packet at a time")'. So it's not appropriate for testing on kernels that are lower than 3.7.0 anymore.

Quoted 6 lines

Are you sure that you have pointed out right commit? The commit description does not seem relevant.

Also can you please describe why the testcases fail before 3.7.0 and how? Does kernel send empty sync events?

Hi!
When we run input04 on RHEL 5.11GA and 6.7GA, it still fails. It gives error message like this:

input04 0 TINFO : Found uinput dev at /dev/uinput input04 0 TINFO : Unexpected ev type=0 code=0 value=0 input04 1 TFAIL : input04.c:65: Data received /dev/inputX

This failure is because kernel sends empty events. i.e
If we only send EV_SYN to input device, nothing should be received in /dev/input/eventX.
Actually, data is received in /dev/input/eventX. This investigation shows that it may be
improved by following patch:
'commit 4369c64c79a2 ("Input: Send events one packet at a time")'.

Do you think so ?

Regards,
Xiao Yang

#4 lore raw

PATCH 1/1 input: add kernel version check

Hi!

Quoted 27 lines
Quoted 11 lines
Quoted 5 lines

In this test case, the functionality of input has been improved by following patch:
'commit 4369c64c79a2 ("Input: Send events one packet at a time")'. So it's not appropriate for testing on kernels that are lower than 3.7.0 anymore.

Are you sure that you have pointed out right commit? The commit description does not seem relevant.

Also can you please describe why the testcases fail before 3.7.0 and how? Does kernel send empty sync events?

Hi!
When we run input04 on RHEL 5.11GA and 6.7GA, it still fails. It gives error message like this:

input04 0 TINFO : Found uinput dev at /dev/uinput input04 0 TINFO : Unexpected ev type=0 code=0 value=0 input04 1 TFAIL : input04.c:65: Data received /dev/inputX

This failure is because kernel sends empty events. i.e
If we only send EV_SYN to input device, nothing should be received in /dev/input/eventX.
Actually, data is received in /dev/input/eventX. This investigation shows that it may be
improved by following patch:
'commit 4369c64c79a2 ("Input: Send events one packet at a time")'.

Quoted 1 line

Do you think so ?

How did you figured out that this exact commit changes the behavior? Have you bisected it? Have you asked kernel developers?

I've looked at the input core for a while now and at the patch as well but it's not clear to me that this commit changed the behavior in this way. It may have, but I'm just not familiar enough with the code to say it for certain.

Signature · 2 lines
Cyril Hrubis
[email protected]