From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ew0-f165.google.com (mail-ew0-f165.google.com [209.85.219.165]) by ozlabs.org (Postfix) with ESMTP id 3FDEFDDF00 for ; Thu, 12 Mar 2009 06:15:03 +1100 (EST) Received: by ewy9 with SMTP id 9so122952ewy.9 for ; Wed, 11 Mar 2009 12:14:59 -0700 (PDT) MIME-Version: 1.0 Sender: timur.tabi@gmail.com In-Reply-To: <49B7EC27.3030305@freescale.com> References: <1236723118-3577-1-git-send-email-timur@freescale.com> <49B6EAA4.9000803@freescale.com> <20090310223753.GB26415@zod.rchland.ibm.com> <1236729551.7086.26.camel@pasglop> <49B7EC27.3030305@freescale.com> Date: Wed, 11 Mar 2009 14:14:59 -0500 Message-ID: Subject: Re: [PATCH v5] introduce macro spin_event_timeout() From: Timur Tabi To: Scott Wood Content-Type: text/plain; charset=ISO-8859-1 Cc: linuxppc-dev@ozlabs.org, Roland Dreier List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, Mar 11, 2009 at 11:51 AM, Scott Wood wrote: > One jiffy is fine, but two is just too long? Any number of jiffies is *not* too long if a timeout occurs. However, I think even one jiffy is too long if that's the normal condition. Unfortunately, the driver may not have any choice in some circumstances. If the hardware is just too slow to respond, and it doesn't provide interrupts, but the code is running in atomic context, and the function what else can it do? > Disallow that, enforced with a call to might_sleep(). I think we need to be able to allow this function to work in atomic context. Is jiffies updated in atomic context? > Alternatively, do something with get_cycles(), and have some sort of #define > by which arches can say if get_cycles actually works. In the absence of a > working get_cycles() or equivalent, timeouts with interrupts disabled aren't > going to happen whether we abstract it with a macro or not. I think I can live with that. -- Timur Tabi Linux kernel developer at Freescale