blob: 3b3de6c7ee5b6116e769bf93261eb1b163d52155 [file] [log] [blame]
arnd@arndb.de0afacde2006-10-24 18:31:18 +02001#define DEBUG
2
Arnd Bergmannce8ab852006-01-04 20:31:29 +01003#include <linux/wait.h>
4#include <linux/ptrace.h>
5
6#include <asm/spu.h>
Jeremy Kerrc6730ed2006-11-20 18:45:10 +01007#include <asm/spu_priv1.h>
8#include <asm/io.h>
Dave Jonescfff5b22006-03-31 23:53:09 -05009#include <asm/unistd.h>
Arnd Bergmannce8ab852006-01-04 20:31:29 +010010
11#include "spufs.h"
12
13/* interrupt-level stop callback function. */
14void spufs_stop_callback(struct spu *spu)
15{
16 struct spu_context *ctx = spu->ctx;
17
Jeremy Kerrd6ad39b2007-12-20 16:39:59 +090018 /*
19 * It should be impossible to preempt a context while an exception
20 * is being processed, since the context switch code is specially
21 * coded to deal with interrupts ... But, just in case, sanity check
22 * the context pointer. It is OK to return doing nothing since
23 * the exception will be regenerated when the context is resumed.
24 */
25 if (ctx) {
26 /* Copy exception arguments into module specific structure */
27 ctx->csa.class_0_pending = spu->class_0_pending;
28 ctx->csa.dsisr = spu->dsisr;
29 ctx->csa.dar = spu->dar;
30
31 /* ensure that the exception status has hit memory before a
32 * thread waiting on the context's stop queue is woken */
33 smp_wmb();
34
35 wake_up_all(&ctx->stop_wq);
36 }
37
38 /* Clear callback arguments from spu structure */
39 spu->class_0_pending = 0;
40 spu->dsisr = 0;
41 spu->dar = 0;
Arnd Bergmannce8ab852006-01-04 20:31:29 +010042}
43
Bob Nelson36aaccc2007-07-20 21:39:52 +020044static inline int spu_stopped(struct spu_context *ctx, u32 *stat)
Arnd Bergmannce8ab852006-01-04 20:31:29 +010045{
46 struct spu *spu;
47 u64 pte_fault;
48
49 *stat = ctx->ops->status_read(ctx);
Bob Nelson36aaccc2007-07-20 21:39:52 +020050
Arnd Bergmannce8ab852006-01-04 20:31:29 +010051 spu = ctx->spu;
Bob Nelson36aaccc2007-07-20 21:39:52 +020052 if (ctx->state != SPU_STATE_RUNNABLE ||
53 test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags))
54 return 1;
Jeremy Kerrd6ad39b2007-12-20 16:39:59 +090055 pte_fault = ctx->csa.dsisr &
Arnd Bergmannce8ab852006-01-04 20:31:29 +010056 (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED);
Jeremy Kerrd6ad39b2007-12-20 16:39:59 +090057 return (!(*stat & SPU_STATUS_RUNNING) || pte_fault || ctx->csa.class_0_pending) ?
Sebastian Siewiorbe703172007-06-29 10:57:50 +100058 1 : 0;
Arnd Bergmannce8ab852006-01-04 20:31:29 +010059}
60
Jeremy Kerrc6730ed2006-11-20 18:45:10 +010061static int spu_setup_isolated(struct spu_context *ctx)
62{
63 int ret;
64 u64 __iomem *mfc_cntl;
65 u64 sr1;
66 u32 status;
67 unsigned long timeout;
68 const u32 status_loading = SPU_STATUS_RUNNING
69 | SPU_STATUS_ISOLATED_STATE | SPU_STATUS_ISOLATED_LOAD_STATUS;
70
Christoph Hellwig7ec18ab2007-04-23 21:08:12 +020071 ret = -ENODEV;
Jeremy Kerrc6730ed2006-11-20 18:45:10 +010072 if (!isolated_loader)
Jeremy Kerrc6730ed2006-11-20 18:45:10 +010073 goto out;
74
Christoph Hellwig7ec18ab2007-04-23 21:08:12 +020075 /*
76 * We need to exclude userspace access to the context.
77 *
78 * To protect against memory access we invalidate all ptes
79 * and make sure the pagefault handlers block on the mutex.
80 */
81 spu_unmap_mappings(ctx);
82
Jeremy Kerrc6730ed2006-11-20 18:45:10 +010083 mfc_cntl = &ctx->spu->priv2->mfc_control_RW;
84
85 /* purge the MFC DMA queue to ensure no spurious accesses before we
86 * enter kernel mode */
87 timeout = jiffies + HZ;
88 out_be64(mfc_cntl, MFC_CNTL_PURGE_DMA_REQUEST);
89 while ((in_be64(mfc_cntl) & MFC_CNTL_PURGE_DMA_STATUS_MASK)
90 != MFC_CNTL_PURGE_DMA_COMPLETE) {
91 if (time_after(jiffies, timeout)) {
92 printk(KERN_ERR "%s: timeout flushing MFC DMA queue\n",
93 __FUNCTION__);
94 ret = -EIO;
Christoph Hellwig7ec18ab2007-04-23 21:08:12 +020095 goto out;
Jeremy Kerrc6730ed2006-11-20 18:45:10 +010096 }
97 cond_resched();
98 }
99
100 /* put the SPE in kernel mode to allow access to the loader */
101 sr1 = spu_mfc_sr1_get(ctx->spu);
102 sr1 &= ~MFC_STATE1_PROBLEM_STATE_MASK;
103 spu_mfc_sr1_set(ctx->spu, sr1);
104
105 /* start the loader */
106 ctx->ops->signal1_write(ctx, (unsigned long)isolated_loader >> 32);
107 ctx->ops->signal2_write(ctx,
108 (unsigned long)isolated_loader & 0xffffffff);
109
110 ctx->ops->runcntl_write(ctx,
111 SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
112
113 ret = 0;
114 timeout = jiffies + HZ;
115 while (((status = ctx->ops->status_read(ctx)) & status_loading) ==
116 status_loading) {
117 if (time_after(jiffies, timeout)) {
118 printk(KERN_ERR "%s: timeout waiting for loader\n",
119 __FUNCTION__);
120 ret = -EIO;
121 goto out_drop_priv;
122 }
123 cond_resched();
124 }
125
126 if (!(status & SPU_STATUS_RUNNING)) {
127 /* If isolated LOAD has failed: run SPU, we will get a stop-and
128 * signal later. */
129 pr_debug("%s: isolated LOAD failed\n", __FUNCTION__);
130 ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
131 ret = -EACCES;
Christoph Hellwig7ec18ab2007-04-23 21:08:12 +0200132 goto out_drop_priv;
133 }
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100134
Christoph Hellwig7ec18ab2007-04-23 21:08:12 +0200135 if (!(status & SPU_STATUS_ISOLATED_STATE)) {
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100136 /* This isn't allowed by the CBEA, but check anyway */
137 pr_debug("%s: SPU fell out of isolated mode?\n", __FUNCTION__);
138 ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_STOP);
139 ret = -EINVAL;
Christoph Hellwig7ec18ab2007-04-23 21:08:12 +0200140 goto out_drop_priv;
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100141 }
142
143out_drop_priv:
144 /* Finished accessing the loader. Drop kernel mode */
145 sr1 |= MFC_STATE1_PROBLEM_STATE_MASK;
146 spu_mfc_sr1_set(ctx->spu, sr1);
147
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100148out:
149 return ret;
150}
151
Bob Nelson36aaccc2007-07-20 21:39:52 +0200152static int spu_run_init(struct spu_context *ctx, u32 *npc)
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100153{
Luke Browningcc210b32007-12-20 16:39:59 +0900154 unsigned long runcntl;
155
Andre Detsch27ec41d2007-07-20 21:39:33 +0200156 spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
157
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100158 if (ctx->flags & SPU_CREATE_ISOLATE) {
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200159
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100160 if (!(ctx->ops->status_read(ctx) & SPU_STATUS_ISOLATED_STATE)) {
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200161 int ret = spu_setup_isolated(ctx);
Christoph Hellwig7ec18ab2007-04-23 21:08:12 +0200162 if (ret)
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200163 return ret;
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100164 }
165
166 /* if userspace has set the runcntrl register (eg, to issue an
167 * isolated exit), we need to re-set it here */
168 runcntl = ctx->ops->runcntl_read(ctx) &
169 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
170 if (runcntl == 0)
171 runcntl = SPU_RUNCNTL_RUNNABLE;
Christoph Hellwig2eb1b122007-02-13 21:54:29 +0100172 } else {
Luke Browningcc210b32007-12-20 16:39:59 +0900173 unsigned long privcntl;
174
Benjamin Herrenschmidt05169232007-06-04 15:15:37 +1000175 if (test_thread_flag(TIF_SINGLESTEP))
Luke Browningcc210b32007-12-20 16:39:59 +0900176 privcntl = SPU_PRIVCNTL_MODE_SINGLE_STEP;
177 else
178 privcntl = SPU_PRIVCNTL_MODE_NORMAL;
179 runcntl = SPU_RUNCNTL_RUNNABLE;
180
181 ctx->ops->npc_write(ctx, *npc);
182 ctx->ops->privcntl_write(ctx, privcntl);
Christoph Hellwig2eb1b122007-02-13 21:54:29 +0100183 }
Jeremy Kerrc6730ed2006-11-20 18:45:10 +0100184
Luke Browningcc210b32007-12-20 16:39:59 +0900185 ctx->ops->runcntl_write(ctx, runcntl);
186
Andre Detsch27ec41d2007-07-20 21:39:33 +0200187 spuctx_switch_state(ctx, SPU_UTIL_USER);
188
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200189 return 0;
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100190}
191
Bob Nelson36aaccc2007-07-20 21:39:52 +0200192static int spu_run_fini(struct spu_context *ctx, u32 *npc,
193 u32 *status)
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100194{
195 int ret = 0;
196
197 *status = ctx->ops->status_read(ctx);
198 *npc = ctx->ops->npc_read(ctx);
Andre Detsch27ec41d2007-07-20 21:39:33 +0200199
200 spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED);
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100201 spu_release(ctx);
202
203 if (signal_pending(current))
204 ret = -ERESTARTSYS;
Masato Noguchi2ebb2472006-11-20 18:45:04 +0100205
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100206 return ret;
207}
208
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200209static int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc,
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100210 u32 *status)
211{
212 int ret;
213
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200214 ret = spu_run_fini(ctx, npc, status);
215 if (ret)
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100216 return ret;
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200217
218 if (*status & (SPU_STATUS_STOPPED_BY_STOP | SPU_STATUS_STOPPED_BY_HALT))
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100219 return *status;
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200220
221 ret = spu_acquire_runnable(ctx, 0);
222 if (ret)
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100223 return ret;
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200224
Andre Detschada83da2007-08-21 10:06:22 +0800225 spuctx_switch_state(ctx, SPU_UTIL_USER);
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100226 return 0;
227}
228
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100229/*
230 * SPU syscall restarting is tricky because we violate the basic
231 * assumption that the signal handler is running on the interrupted
232 * thread. Here instead, the handler runs on PowerPC user space code,
233 * while the syscall was called from the SPU.
234 * This means we can only do a very rough approximation of POSIX
235 * signal semantics.
236 */
Sebastian Siewior12388192007-09-19 14:38:12 +1000237static int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret,
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100238 unsigned int *npc)
239{
240 int ret;
241
242 switch (*spu_ret) {
243 case -ERESTARTSYS:
244 case -ERESTARTNOINTR:
245 /*
246 * Enter the regular syscall restarting for
247 * sys_spu_run, then restart the SPU syscall
248 * callback.
249 */
250 *npc -= 8;
251 ret = -ERESTARTSYS;
252 break;
253 case -ERESTARTNOHAND:
254 case -ERESTART_RESTARTBLOCK:
255 /*
256 * Restart block is too hard for now, just return -EINTR
257 * to the SPU.
258 * ERESTARTNOHAND comes from sys_pause, we also return
259 * -EINTR from there.
260 * Assume that we need to be restarted ourselves though.
261 */
262 *spu_ret = -EINTR;
263 ret = -ERESTARTSYS;
264 break;
265 default:
266 printk(KERN_WARNING "%s: unexpected return code %ld\n",
267 __FUNCTION__, *spu_ret);
268 ret = 0;
269 }
270 return ret;
271}
272
Sebastian Siewior12388192007-09-19 14:38:12 +1000273static int spu_process_callback(struct spu_context *ctx)
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100274{
275 struct spu_syscall_block s;
276 u32 ls_pointer, npc;
Akinobu Mita9e2fe2c2007-04-23 21:08:22 +0200277 void __iomem *ls;
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100278 long spu_ret;
279 int ret;
280
281 /* get syscall block from local store */
Akinobu Mita9e2fe2c2007-04-23 21:08:22 +0200282 npc = ctx->ops->npc_read(ctx) & ~3;
283 ls = (void __iomem *)ctx->ops->get_ls(ctx);
284 ls_pointer = in_be32(ls + npc);
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100285 if (ls_pointer > (LS_SIZE - sizeof(s)))
286 return -EFAULT;
Akinobu Mita9e2fe2c2007-04-23 21:08:22 +0200287 memcpy_fromio(&s, ls + ls_pointer, sizeof(s));
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100288
289 /* do actual syscall without pinning the spu */
290 ret = 0;
291 spu_ret = -ENOSYS;
292 npc += 4;
293
294 if (s.nr_ret < __NR_syscalls) {
295 spu_release(ctx);
296 /* do actual system call from here */
297 spu_ret = spu_sys_callback(&s);
298 if (spu_ret <= -ERESTARTSYS) {
299 ret = spu_handle_restartsys(ctx, &spu_ret, &npc);
300 }
301 spu_acquire(ctx);
302 if (ret == -ERESTARTSYS)
303 return ret;
304 }
305
306 /* write result, jump over indirect pointer */
Akinobu Mita9e2fe2c2007-04-23 21:08:22 +0200307 memcpy_toio(ls + ls_pointer, &spu_ret, sizeof(spu_ret));
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100308 ctx->ops->npc_write(ctx, npc);
309 ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
310 return ret;
311}
312
Jeremy Kerr50af32a2007-07-20 21:39:42 +0200313long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100314{
315 int ret;
Bob Nelson36aaccc2007-07-20 21:39:52 +0200316 struct spu *spu;
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200317 u32 status;
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100318
Christoph Hellwige45d48a32007-04-23 21:08:17 +0200319 if (mutex_lock_interruptible(&ctx->run_mutex))
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100320 return -ERESTARTSYS;
321
Masato Noguchic25620d2007-12-05 13:49:31 +1100322 spu_enable_spu(ctx);
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200323 ctx->event_return = 0;
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200324
Christoph Hellwig2cf2b3b2007-06-29 10:57:55 +1000325 spu_acquire(ctx);
326 if (ctx->state == SPU_STATE_SAVED) {
327 __spu_update_sched_info(ctx);
Christoph Hellwig9d785922007-07-25 21:31:09 +1000328 spu_set_timeslice(ctx);
Christoph Hellwig2cf2b3b2007-06-29 10:57:55 +1000329
330 ret = spu_activate(ctx, 0);
331 if (ret) {
332 spu_release(ctx);
333 goto out;
334 }
335 } else {
336 /*
337 * We have to update the scheduling priority under active_mutex
338 * to protect against find_victim().
Christoph Hellwig9d785922007-07-25 21:31:09 +1000339 *
340 * No need to update the timeslice ASAP, it will get updated
341 * once the current one has expired.
Christoph Hellwig2cf2b3b2007-06-29 10:57:55 +1000342 */
343 spu_update_sched_info(ctx);
344 }
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200345
346 ret = spu_run_init(ctx, npc);
347 if (ret) {
348 spu_release(ctx);
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100349 goto out;
Christoph Hellwigaa45e252007-04-23 21:08:27 +0200350 }
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100351
352 do {
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200353 ret = spufs_wait(ctx->stop_wq, spu_stopped(ctx, &status));
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100354 if (unlikely(ret))
355 break;
Bob Nelson36aaccc2007-07-20 21:39:52 +0200356 spu = ctx->spu;
357 if (unlikely(test_and_clear_bit(SPU_SCHED_NOTIFY_ACTIVE,
358 &ctx->sched_flags))) {
359 if (!(status & SPU_STATUS_STOPPED_BY_STOP)) {
360 spu_switch_notify(spu, ctx);
361 continue;
362 }
363 }
Andre Detsch27ec41d2007-07-20 21:39:33 +0200364
365 spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
366
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200367 if ((status & SPU_STATUS_STOPPED_BY_STOP) &&
368 (status >> SPU_STOP_STATUS_SHIFT == 0x2104)) {
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100369 ret = spu_process_callback(ctx);
370 if (ret)
371 break;
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200372 status &= ~SPU_STATUS_STOPPED_BY_STOP;
Arnd Bergmann2dd14932006-03-23 00:00:09 +0100373 }
Arnd Bergmann57dace22007-04-23 21:08:15 +0200374 ret = spufs_handle_class1(ctx);
375 if (ret)
376 break;
377
Jeremy Kerrd6ad39b2007-12-20 16:39:59 +0900378 ret = spufs_handle_class0(ctx);
379 if (ret)
380 break;
381
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100382 if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) {
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200383 ret = spu_reacquire_runnable(ctx, npc, &status);
Christoph Hellwig37901802007-06-29 10:57:51 +1000384 if (ret)
Masato Noguchi2ebb2472006-11-20 18:45:04 +0100385 goto out2;
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100386 continue;
387 }
Jeremy Kerrd6ad39b2007-12-20 16:39:59 +0900388
389 if (signal_pending(current))
390 ret = -ERESTARTSYS;
391
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100392
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200393 } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP |
Benjamin Herrenschmidt05169232007-06-04 15:15:37 +1000394 SPU_STATUS_STOPPED_BY_HALT |
395 SPU_STATUS_SINGLE_STEP)));
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100396
Christoph Hellwige9f8a0b2007-06-29 10:58:03 +1000397 if ((status & SPU_STATUS_STOPPED_BY_STOP) &&
Christoph Hellwigfe2f8962007-06-29 10:58:07 +1000398 (((status >> SPU_STOP_STATUS_SHIFT) & 0x3f00) == 0x2100) &&
399 (ctx->state == SPU_STATE_RUNNABLE))
Christoph Hellwige9f8a0b2007-06-29 10:58:03 +1000400 ctx->stats.libassist++;
401
Andre Detsch27ec41d2007-07-20 21:39:33 +0200402
Masato Noguchic25620d2007-12-05 13:49:31 +1100403 spu_disable_spu(ctx);
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200404 ret = spu_run_fini(ctx, npc, &status);
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100405 spu_yield(ctx);
406
Masato Noguchi2ebb2472006-11-20 18:45:04 +0100407out2:
408 if ((ret == 0) ||
409 ((ret == -ERESTARTSYS) &&
410 ((status & SPU_STATUS_STOPPED_BY_HALT) ||
Benjamin Herrenschmidt05169232007-06-04 15:15:37 +1000411 (status & SPU_STATUS_SINGLE_STEP) ||
Masato Noguchi2ebb2472006-11-20 18:45:04 +0100412 ((status & SPU_STATUS_STOPPED_BY_STOP) &&
413 (status >> SPU_STOP_STATUS_SHIFT != 0x2104)))))
414 ret = status;
415
Benjamin Herrenschmidt05169232007-06-04 15:15:37 +1000416 /* Note: we don't need to force_sig SIGTRAP on single-step
417 * since we have TIF_SINGLESTEP set, thus the kernel will do
418 * it upon return from the syscall anyawy
419 */
Arnd Bergmannc2b22262006-11-27 19:18:53 +0100420 if ((status & SPU_STATUS_STOPPED_BY_STOP)
421 && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) {
422 force_sig(SIGTRAP, current);
423 ret = -ERESTARTSYS;
Masato Noguchi2ebb2472006-11-20 18:45:04 +0100424 }
425
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100426out:
Arnd Bergmann9add11d2006-10-04 17:26:14 +0200427 *event = ctx->event_return;
Christoph Hellwige45d48a32007-04-23 21:08:17 +0200428 mutex_unlock(&ctx->run_mutex);
Arnd Bergmannce8ab852006-01-04 20:31:29 +0100429 return ret;
430}