]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.arch/ppc-spufs-04-sputrace-Don-t-block-until-the-read.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / ppc-spufs-04-sputrace-Don-t-block-until-the-read.patch
CommitLineData
2cb7cef9
BS
1Subject: Don't block until the read buffer is full
2From: Jeremy Kerr <jk@ozlabs.org>
3References: 447133 - LTC50070
4
5Currently, read() on the sputrace buffer will only return data when
6the user buffer is exhausted. This may mean that we never see the
7end of the event log, unless we read() with exactly the right-sized
8buffer.
9
10This change makes sputrace_read not block if we have data ready to
11return.
12
13Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14Signed-off-by: Olaf Hering <olh@suse.de>
15---
16 arch/powerpc/platforms/cell/spufs/sputrace.c | 5 +++++
17 1 file changed, 5 insertions(+)
18
19--- a/arch/powerpc/platforms/cell/spufs/sputrace.c
20+++ b/arch/powerpc/platforms/cell/spufs/sputrace.c
21@@ -80,6 +80,11 @@ static ssize_t sputrace_read(struct file
22 char tbuf[128];
23 int width;
24
25+ /* If we have data ready to return, don't block waiting
26+ * for more */
27+ if (cnt > 0 && sputrace_used() == 0)
28+ break;
29+
30 error = wait_event_interruptible(sputrace_wait,
31 sputrace_used() > 0);
32 if (error)