From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id B8737B70B8 for ; Wed, 1 Jul 2009 10:12:32 +1000 (EST) Received: from mail-qy0-f188.google.com (mail-qy0-f188.google.com [209.85.221.188]) by ozlabs.org (Postfix) with ESMTP id 4A78DDDF58 for ; Wed, 1 Jul 2009 01:02:52 +1000 (EST) Received: by qyk26 with SMTP id 26so232820qyk.17 for ; Tue, 30 Jun 2009 08:02:51 -0700 (PDT) MIME-Version: 1.0 Sender: timur.tabi@gmail.com In-Reply-To: <20090629234035.12475.58493.stgit@localhost.localdomain> References: <20090629234035.12475.58493.stgit@localhost.localdomain> Date: Tue, 30 Jun 2009 10:02:49 -0500 Message-ID: Subject: Re: [PATCH] powerpc: Fix spin_event_timeout() to be robust over context switches From: Timur Tabi To: Grant Likely , Benjamin Herrenschmidt Content-Type: text/plain; charset=ISO-8859-1 Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Jun 29, 2009 at 6:40 PM, Grant Likely wr= ote: > From: Grant Likely > > Current implementation of spin_event_timeout can be interrupted by an > IRQ or context switch after testing the condition, but before checking > the timeout. =A0This can cause the loop to report a timeout when the > condition actually became true in the middle. > > This patch adds one final check of the condition upon exit of the loop > if the last test of the condition was still false. > > Signed-off-by: Grant Likely Acked-by: Timur Tabi Ben, please pick this up for the next rc of 2.6.31. --=20 Timur Tabi Linux kernel developer at Freescale