summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJesse Zhang <sen.zhang@windriver.com>2013-06-17 16:49:13 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-25 17:44:55 +0100
commitb8043be91573f85d89c4b62caa308c0efba8addd (patch)
tree2af4c16303f1a4034dd830ca8e7375448cabf92c /meta
parent3d871dc3941d06270387eb956f1217ad19100484 (diff)
downloadpoky-b8043be91573f85d89c4b62caa308c0efba8addd.tar.gz
rt-tests: fix error check in hackbench
Add a patch to fix when an unsigned number is taken as a negative error code. (From OE-Core rev: 7538a9cd0c6f0216ef95956ad86e2f88ebd4c8ea) Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch41
-rw-r--r--meta/recipes-rt/rt-tests/rt-tests.inc1
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch b/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch
new file mode 100644
index 0000000000..d17fdff455
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch
@@ -0,0 +1,41 @@
1childinfo_t is a union that contains both signed (error) and unsigned
2(threadid) members. Thus a large threadid could appear as a negative error
3value, which will cause unexpected failures.
4
5childinfo_t should be changed to a struct, but it could potentially affect the
6performance. So we keep it as a union but only check error against -1. There is
7still a chance of false alarm but it's small.
8
9Upstream-Status: Pending
10
11Signed-off-by: Song.Li <Song.Li@windriver.com>
12Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
13---
14 src/hackbench/hackbench.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c
18index 8baeb23..dc0de8f 100644
19--- a/src/hackbench/hackbench.c
20+++ b/src/hackbench/hackbench.c
21@@ -317,7 +317,7 @@ static unsigned int group(childinfo_t *child,
22 ctx->wakefd = wakefd;
23
24 child[tab_offset+i] = create_worker(ctx, (void *)(void *)receiver);
25- if( child[tab_offset+i].error < 0 ) {
26+ if( child[tab_offset+i].error == -1 ) {
27 return (i > 0 ? i-1 : 0);
28 }
29 snd_ctx->out_fds[i] = fds[1];
30@@ -332,7 +332,7 @@ static unsigned int group(childinfo_t *child,
31 snd_ctx->num_fds = num_fds;
32
33 child[tab_offset+num_fds+i] = create_worker(snd_ctx, (void *)(void *)sender);
34- if( child[tab_offset+num_fds+i].error < 0 ) {
35+ if( child[tab_offset+num_fds+i].error == -1 ) {
36 return (num_fds+i)-1;
37 }
38 }
39--
401.7.9.5
41
diff --git a/meta/recipes-rt/rt-tests/rt-tests.inc b/meta/recipes-rt/rt-tests/rt-tests.inc
index 3ae7602d7b..91e5028eda 100644
--- a/meta/recipes-rt/rt-tests/rt-tests.inc
+++ b/meta/recipes-rt/rt-tests/rt-tests.inc
@@ -8,6 +8,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git
8 file://0002-rt-tests-Break-out-install_hwlatdetect.patch \ 8 file://0002-rt-tests-Break-out-install_hwlatdetect.patch \
9 file://added-missing-dependencies.patch \ 9 file://added-missing-dependencies.patch \
10 file://cyclictest-finish-removal-of-1-second-first-loops.patch \ 10 file://cyclictest-finish-removal-of-1-second-first-loops.patch \
11 file://hackbench-fix-error-check.patch \
11" 12"
12 13
13INC_PR = "r2" 14INC_PR = "r2"