Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755945AbbFOQ4h (ORCPT ); Mon, 15 Jun 2015 12:56:37 -0400 Received: from www.linutronix.de ([62.245.132.108]:41003 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754427AbbFOQ42 (ORCPT ); Mon, 15 Jun 2015 12:56:28 -0400 Date: Mon, 15 Jun 2015 18:56:29 +0200 (CEST) From: Thomas Gleixner To: Mason cc: LKML , Ingo Molnar , Peter Zijlstra , Andrew Morton Subject: Re: [Semaphore API] down_interruptible_timeout In-Reply-To: <557E9030.6080901@free.fr> Message-ID: References: <557E9030.6080901@free.fr> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-132698379-1434387392=:4120" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1280 Lines: 33 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-132698379-1434387392=:4120 Content-Type: TEXT/PLAIN; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Mon, 15 Jun 2015, Mason wrote: > A) process-context kernel thread fills a FIFO and calls down(&fifo_empty); > B) ISR handles the FIFO-empty interrupt with up(&fifo_empty); > > However, in case something goes wrong and the interrupt never fires, > I don't want the process to be stuck in an uninterruptible sleep. > > Perhaps I can set a tiny timeout (e.g. 10 ?s) and not worry about > the interruptible part for such a small duration? (Hmm, __down_common > calls schedule_timeout, which is jiffies-based. I don't think there > is a hrtimers flavor. So ?s timeouts would be off the table?) > > Or I could use the interruptible version, and let the user kill the > operation if necessary. Use a completion. Thanks, tglx --8323329-132698379-1434387392=:4120-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/