>From swetland@google.com Sat Nov 10 02:04:08 2007 Return-Path: X-Original-To: swetland@frotz.net Delivered-To: swetland@frotz.net Received: from smtp-out.google.com (smtp-out.google.com [216.239.45.13]) by mumble.frotz.net (Postfix) with ESMTP id 1BC002500D for ; Sat, 10 Nov 2007 02:04:08 -0800 (PST) Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35]) by smtp-out.google.com with ESMTP id lAAA5hUj030761; Sat, 10 Nov 2007 02:05:43 -0800 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=received:from:to:cc:subject:date:message-id:x-mailer; b=g2B628wRsJJahlIpNw3mgNDqOQKNMcUCPOurvqj+3fO6qLH+vpBS0ZwN1lLv6BnC7 w4QLOotDo7t+nI2KgZDVQ== Received: from bulgaria (bulgaria.corp.google.com [172.18.102.38]) by zps35.corp.google.com with ESMTP id lAAA5e22002202; Sat, 10 Nov 2007 02:05:42 -0800 Received: by bulgaria (Postfix, from userid 1000) id 613018F45E; Sat, 10 Nov 2007 02:05:25 -0800 (PST) From: swetland@google.com To: swetland@frotz.net Cc: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= Subject: [PATCH] hrtimer: Add timer back to pending list if it was reactivated and has already expired again. Date: Sat, 10 Nov 2007 02:05:25 -0800 Message-Id: <1194689125-21319-1-git-send-email-swetland@google.com> X-Mailer: git-send-email 1.5.3.5 X-SpamProbe: GOOD 0.0000099 b892c7c5c469d044f28ab48846487cf5 X-SpamCheck: OKAY Status: RO Content-Length: 983 Lines: 33 From: Arve Hjønnevåg This avoids problems with timer hardware that does not respond to timers set in the past. Signed-off-by: Brian Swetland --- kernel/hrtimer.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 22a2514..7c60769 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1149,8 +1149,14 @@ static void run_hrtimer_softirq(struct softirq_action *h) * If the timer was rearmed on another CPU, reprogram * the event device. */ - if (timer->base->first == &timer->node) - hrtimer_reprogram(timer, timer->base); + if (timer->base->first == &timer->node) { + if(hrtimer_reprogram(timer, timer->base)) { + __remove_hrtimer(timer, timer->base, + HRTIMER_STATE_PENDING, 0); + list_add_tail(&timer->cb_entry, + &cpu_base->cb_pending); + } + } } } spin_unlock_irq(&cpu_base->lock); -- 1.5.3.5