]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | Subject: Don't block until the read buffer is full |
2 | From: Jeremy Kerr <jk@ozlabs.org> | |
3 | References: 447133 - LTC50070 | |
4 | ||
5 | Currently, read() on the sputrace buffer will only return data when | |
6 | the user buffer is exhausted. This may mean that we never see the | |
7 | end of the event log, unless we read() with exactly the right-sized | |
8 | buffer. | |
9 | ||
10 | This change makes sputrace_read not block if we have data ready to | |
11 | return. | |
12 | ||
13 | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> | |
14 | Signed-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) |