Thread (26 messages) flat view 26 messages, 3 authors, 2014-10-09

Re: [PATCH v4 13/16] cxl: Driver code for powernv PCIe based cards for userspace access

From: Ian Munsie <hidden>
Date: 2014-10-08 10:28:09
Also in: lkml

Excerpts from Michael Neuling's message of 2014-10-08 19:55:02 +1100:
+static ssize_t afu_read(struct file *file, char __user *buf, size_t count,
+            loff_t *off)
...
+    for (;;) {
+        prepare_to_wait(&ctx->wq, &wait, TASK_INTERRUPTIBLE);
+        if (ctx_event_pending(ctx))
+            break;
+
+        spin_unlock_irqrestore(&ctx->lock, flags);
+        if (file->f_flags & O_NONBLOCK)
+            return -EAGAIN;
+
+        if (signal_pending(current))
+            return -ERESTARTSYS;
Looks like I mucked this up while refactoring - these two cases no
longer call finish_wait() which can lead to a crash if something later
wakes up the ctx->wq... I'll post a fix in a separate patch shortly.

-Ian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help