summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-test/linux-serial-test/files/0001-linux-serial-test.c-fix-returned-error-code.patch62
-rw-r--r--meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb4
2 files changed, 65 insertions, 1 deletions
diff --git a/meta-oe/recipes-test/linux-serial-test/files/0001-linux-serial-test.c-fix-returned-error-code.patch b/meta-oe/recipes-test/linux-serial-test/files/0001-linux-serial-test.c-fix-returned-error-code.patch
new file mode 100644
index 0000000000..91fdcf07ad
--- /dev/null
+++ b/meta-oe/recipes-test/linux-serial-test/files/0001-linux-serial-test.c-fix-returned-error-code.patch
@@ -0,0 +1,62 @@
1From 1add8f3d228368665c3abd452640b91a86f41976 Mon Sep 17 00:00:00 2001
2From: Max Krummenacher <max.krummenacher@toradex.com>
3Date: Mon, 4 Aug 2025 14:57:22 +0200
4Subject: [PATCH 1/2] linux-serial-test.c: fix returned error code
5
6_cl_no_rx/_cl_no_rx are true in two cases, first when the relevant
7command line paramter is set and second when a rx or tx time is set
8and that time expired.
9
10This fixes the second case in a loopback test. With the change the
11application now correctly returns 125 if the number of written and
12read chars differ.
13
14E.g. `./linux-serial-test -o2 -i3 -b 115200 -p /dev/ttyS1 ; echo $?`
15returns now 0 with a loopback and 125 without, before it returned 0
16with or without a loopback.
17
18Upstream-Status: Submitted [https://github.com/cbrake/linux-serial-test/pull/61/]
19Fixes: 4e57f58c58ae ("compute error count valid when no_tx or no_rx")
20Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
21Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
22---
23 linux-serial-test.c | 6 +++++-
24 1 file changed, 5 insertions(+), 1 deletion(-)
25
26diff --git a/linux-serial-test.c b/linux-serial-test.c
27index d8f66c16c72f..c2c8882d601b 100644
28--- a/linux-serial-test.c
29+++ b/linux-serial-test.c
30@@ -55,6 +55,8 @@ int _cl_loopback = 0;
31 int _cl_dump_err = 0;
32 int _cl_no_rx = 0;
33 int _cl_no_tx = 0;
34+int _cl_no_rx_param = 0;
35+int _cl_no_tx_param = 0;
36 int _cl_rx_delay = 0;
37 int _cl_tx_delay = 0;
38 int _cl_tx_bytes = 0;
39@@ -442,9 +444,11 @@ static void process_options(int argc, char * argv[])
40 break;
41 case 'r':
42 _cl_no_rx = 1;
43+ _cl_no_rx_param = 1;
44 break;
45 case 't':
46 _cl_no_tx = 1;
47+ _cl_no_tx_param = 1;
48 break;
49 case 'l': {
50 char *endptr;
51@@ -745,7 +749,7 @@ static int diff_s(const struct timespec *t1, const struct timespec *t2)
52 static int compute_error_count(void)
53 {
54 long long int result;
55- if (_cl_no_rx == 1 || _cl_no_tx == 1)
56+ if (_cl_no_rx_param == 1 || _cl_no_tx_param == 1)
57 result = _error_count;
58 else
59 result = llabs(_write_count - _read_count) + _error_count;
60--
612.43.0
62
diff --git a/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb b/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb
index 888b13e2f6..66511bd9c3 100644
--- a/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb
+++ b/meta-oe/recipes-test/linux-serial-test/linux-serial-test_git.bb
@@ -3,7 +3,9 @@ HOMEPAGE = "https://github.com/cbrake/linux-serial-test"
3LICENSE = "MIT" 3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://LICENSES/MIT;md5=544799d0b492f119fa04641d1b8868ed" 4LIC_FILES_CHKSUM = "file://LICENSES/MIT;md5=544799d0b492f119fa04641d1b8868ed"
5 5
6SRC_URI = "git://github.com/cbrake/linux-serial-test.git;protocol=https;branch=master" 6SRC_URI = "git://github.com/cbrake/linux-serial-test.git;protocol=https;branch=master \
7 file://0001-linux-serial-test.c-fix-returned-error-code.patch \
8"
7PV = "0+git" 9PV = "0+git"
8SRCREV = "1a81f3c7be086ee01a9be8589a606426276c86d5" 10SRCREV = "1a81f3c7be086ee01a9be8589a606426276c86d5"
9 11