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

Ian Munsie imunsie at au1.ibm.com
Wed Oct 8 21:28:05 EST 2014


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



More information about the Linuxppc-dev mailing list