From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 9330D1A1B0A for ; Wed, 8 Oct 2014 21:28:08 +1100 (EST) Received: from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5D70D1400E2 for ; Wed, 8 Oct 2014 21:28:08 +1100 (EST) Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Oct 2014 20:28:07 +1000 Content-Type: text/plain; charset=UTF-8 From: Ian Munsie To: Michael Neuling Subject: Re: [PATCH v4 13/16] cxl: Driver code for powernv PCIe based cards for userspace access In-reply-to: <1412758505-23495-14-git-send-email-mikey@neuling.org> References: <1412758505-23495-1-git-send-email-mikey@neuling.org> <1412758505-23495-14-git-send-email-mikey@neuling.org> Date: Wed, 08 Oct 2014 21:28:05 +1100 Message-Id: <1412763264-sup-2737@delenn.ozlabs.ibm.com> Cc: cbe-oss-dev , arnd , "Aneesh Kumar K.V" , greg , linux-kernel , linuxppc-dev , anton , jk List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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