From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: Linux 2.6.16-rc3 Date: Fri, 17 Feb 2006 22:30:32 -0700 Message-ID: <20060218053032.GU12822@parisc-linux.org> References: <1140054960.3037.5.camel@mulgrave.il.steeleye.com> <20060216171200.GD29443@flint.arm.linux.org.uk> <1140112653.3178.9.camel@mulgrave.il.steeleye.com> <20060216180939.GF29443@flint.arm.linux.org.uk> <1140113671.3178.16.camel@mulgrave.il.steeleye.com> <20060216181803.GG29443@flint.arm.linux.org.uk> <1140116969.3178.24.camel@mulgrave.il.steeleye.com> <20060216200138.GA4203@suse.de> <1140223363.3231.9.camel@mulgrave.il.steeleye.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-usb-devel-admin@lists.sourceforge.net Errors-To: linux-usb-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Roland Dreier Cc: James Bottomley , Jens Axboe , Russell King , Greg KH , Andrew Morton , Linus Torvalds , linux-kernel@vger.kernel.org, "Brown, Len" , "David S. Miller" , linux-acpi@vger.kernel.org, linux-usb-devel@lists.sourceforge.net, "Yu, Luming" , Ben Castricum , sanjoy@mrao.cam.ac.uk, Helge Hafting , "Carlo E. Prelz" , Gerrit Bruchh?user , Nicolas.Mailhot@LaPoste.net, Jaroslav Kysela , Takashi Iwai , Patrizio Bassi , Bj?rn Nilsson , Andrey Borzenkov , "P. Christeas" , ghrt , jinhong List-Id: linux-acpi@vger.kernel.org On Fri, Feb 17, 2006 at 06:12:04PM -0800, Roland Dreier wrote: > > +int execute_in_process_context(void (*fn)(void *data), void *data, > > + struct execute_work *ew) > > +{ > > + if (!in_interrupt()) { > > + fn(data); > > + return 0; > > + } > > Is testing in_interrupt() really sufficient to make this work? I seem > to remember that (at least) with CONFIG_PREEMPT disabled, there are > contexts where it is not safe to sleep but where both in_interrupt() > and in_atomic() still return 0. That's correct -- in process context, with PREEMPT disabled and a spinlock held, it's unsafe to call this function. It works well for the SCSI usage (where it's called either in interrupt context or in user context with no spinlocks held), but it's not *always* safe. I think this needs to be documented in the kerneldoc. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel