Received: by 10.223.185.116 with SMTP id b49csp829825wrg; Sat, 10 Feb 2018 21:25:34 -0800 (PST) X-Google-Smtp-Source: AH8x225XD7V4jk8WqW8jGcEA2cyX1Erd1I4VYIwQ/33h4KmxIYeoppLFv3oMmVjfiZCFiyAPzrh8 X-Received: by 10.99.149.4 with SMTP id p4mr6542358pgd.0.1518326734034; Sat, 10 Feb 2018 21:25:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518326733; cv=none; d=google.com; s=arc-20160816; b=akNis4pYIMs+G/HsX2gzTnLAuVyhkP8BZSlZ5tsRLWopAshBHasEzxLqQOBp4NsTOt PrTyGk6a41XuOsQtFTMM6Cef0+LERaONWdOxt0TjNcoBJ/GctinsMQEiNHeTvDF98nH9 LXII+x7eBXZDLOJhwQ06Rzv6uSmxaMiclj1eZIbhH0S3/BwXnwuDCQ7dYE9fNi249HPu e7UGsTsgt2+e+eZLJxDCUKejZ3TNHYhKTLtUMosHlqtUpp+5ZUMlkTvDlOZ9lnaexIRA NKpx2Ronr/aOvVr1vGU1hAYyKN4y+cuf518aXEKV377DHYlSfy/SRamVoqRdPae/+kU+ cLww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=nj2y8NdaIN5QkellLQrCn43I0qszntqK6+wbSzu4Nko=; b=LQm7e+mo0SOOpIBvTMsoAWlNItORRAptS04/PrZO1ra28zpMYto5nbyOg5JeYYwQcA e/D1O9ezbe1DzCGn296cEE1JGtccjhDroS0QnknxTOiqXUttWvs3vuSQa14okUZBN5nC iRoRMJMEPApCF+8NO0JqSWR0Oz+s0XwowWOtKUt0Jp58Sj+hThpJylBB/Mu43MHx7bGM SIqFB6GGev7r4PPlI9jNElVpIDVhLzYhuZ95rE2ntCzWyaUMqKL0Jdvyip4+RpuZzBOV PDPq2J3YldtP/6M+XaatYymUxNwzqdulv05X1ziR4aYJXhuLuedaJVqLSxppCsbjzO2k u4zA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si4007603plq.120.2018.02.10.21.25.20; Sat, 10 Feb 2018 21:25:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754217AbeBKFYO (ORCPT + 99 others); Sun, 11 Feb 2018 00:24:14 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41316 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752450AbeBKEdk (ORCPT ); Sat, 10 Feb 2018 23:33:40 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ekjKc-0002hD-5f; Sun, 11 Feb 2018 04:33:38 +0000 Received: from ben by deadeye with local (Exim 4.90) (envelope-from ) id 1ekjKX-0004Rf-0s; Sun, 11 Feb 2018 04:33:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Alexandre Belloni" Date: Sun, 11 Feb 2018 04:20:06 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 03/79] rtc: set the alarm to the next expiring timer In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.99-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Alexandre Belloni commit 74717b28cb32e1ad3c1042cafd76b264c8c0f68d upstream. If there is any non expired timer in the queue, the RTC alarm is never set. This is an issue when adding a timer that expires before the next non expired timer. Ensure the RTC alarm is set in that case. Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers") Signed-off-by: Alexandre Belloni [bwh: Backported to 3.2: open-code ktime_before()] Signed-off-by: Ben Hutchings --- drivers/rtc/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -765,7 +765,7 @@ static int rtc_timer_enqueue(struct rtc_ } timerqueue_add(&rtc->timerqueue, &timer->node); - if (!next) { + if (!next || timer->node.expires.tv64 < next->expires.tv64) { struct rtc_wkalrm alarm; int err; alarm.time = rtc_ktime_to_tm(timer->node.expires);