From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758996Ab0EYSjF (ORCPT ); Tue, 25 May 2010 14:39:05 -0400 Received: from www.tglx.de ([62.245.132.106]:42193 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756457Ab0EYSjB (ORCPT ); Tue, 25 May 2010 14:39:01 -0400 Date: Tue, 25 May 2010 20:37:40 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds cc: Jeff Chua , Johannes Berg , Arjan van de Ven , "johnstul@us.ibm.com" , Ingo Molnar , Andrew Morton , Intel Linux Wireless , "John W. Linville" , Frans Pop , "Chatre, Reinette" , lkml Subject: Re: Wireless IBSS on Linux-2.6.34 broken by commit 3bbb9ec946428b96657126768f65487a48dd090c In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 May 2010, Linus Torvalds wrote: > > On Mon, 24 May 2010, Jeff Chua wrote: > > > > - expires_limit = expires + timer->slack; > > + expires_limit = expires; > > > > - if (timer->slack < 0) /* auto slack: use 0.4% */ > > + if (timer->slack > -1) > > + expires_limit = expires + timer->slack; > > + else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */ > > expires_limit = expires + (expires - jiffies)/256; > > Please don't reload 'jiffies' twice. It's volatile, and the compiler will > do a crap job of it. Grr, it's even worse. If jiffies increment between the time_after() check and (expires - jiffies) we might run into the same problem as before. Sigh, did not notice when I picked it up. ENOTENOUGHCOFFEE. > Also, '0' is a normal number, but '-1' is a rather odd value. Please just > test for non-negative by doing ">= 0" rather than "> -1" Will fix, thanks, tglx