From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Cox Subject: Re: [PATCH] Block on access to temporarily unavailable pci device Date: Wed, 18 Oct 2006 17:05:02 +0100 Message-ID: <1161187503.9363.75.camel@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.osdl.org Errors-To: linux-pm-bounces@lists.osdl.org To: Alan Stern Cc: Brian King , Matthew Wilcox , linux-pci@atrey.karlin.mff.cuni.cz, linux-pm@lists.osdl.org, linux-kernel@vger.kernel.org, Adam Belay List-Id: linux-pm@vger.kernel.org Ar Mer, 2006-10-18 am 11:52 -0400, ysgrifennodd Alan Stern: > Don't you want the user process to wait in TASK_INTERRUPTIBLE? It would = > require only a very simple change. That just makes the problem even worse, to go with the kernel driver "what the hell do do if.." we get a user space one thats based around incompatibility with the existing behaviour. There are much saner ways to sort that out without breaking the API If its going to be a bounded short wait -> pause If its might be a long wait -> cached If its gone for good then error If the user specified O_NDELAY then -EWOULDBLOCK not wait That way you don't break anything and you get sensible Unix semantics. The wait queue Matthew added also means select() can be fitted up to do the right thing for the O_NDELAY case. Alan