Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2523066yba; Mon, 15 Apr 2019 13:31:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqySubU1uh494ps86J/SI6MN001vWp+Z5wzFatNTcJM6VtDQoUYcUYZvsvDMD3P4jd0vMFO/ X-Received: by 2002:aa7:943b:: with SMTP id y27mr53764776pfo.59.1555360294145; Mon, 15 Apr 2019 13:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555360294; cv=none; d=google.com; s=arc-20160816; b=bUf8HbkaL5mEq/aBiv4tptJmspBS1RF5G6GBXFRwRy416gVedOlQcSKfexbLwO5kdE 6sPexwzOeMvtqYi00I7RE0Z52I5hhA0fK8LbTeFxO+PG1iXfOTOJL5bc9jEG1RpX9c4f 0NrFV2wPGrK21qsYGOMry8zDpB2/ar9Bfh9NywIYb8BCk0gxJ/vBwGrDb+YuUGBObXaV Vu+wFye9AcxgmuL02dAfADcA4IKnZOY+ubA+3zYFbwKrdzf8LJwM4X4DJtETBPxTyfW8 5+7W1ean29zfJS6Agncp5IdURX7fEQkhe/bmBlqT6IXoyBuuLQ5xDWwmbMc618IEYmnA QZ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1hmJvCWTRe9qR666+nz2JhKZ8t0xLjQsce4ErcZz1Ug=; b=O/v5UFAqKlydLxTnbJ8fpbdRcZ+v+GWqmeflFzSP6h3z8sCFBOF8t5Mau/EpCzi1c0 ZgdE+g+wxLECshRPTBEALMMqoLjtY5RPMF/7+0ojPe2SJoLyQT0dC/cEQe1qrF7VHXDN mJGeorsHtISikbTnNu26paPtbWMm9QJCFvxCMFsgPZvKAgPoy6vqlCZJdNlip4HP+ONR 99p6txDNOlg2mUjMFzC0iOy3CQsNxi5Tlj1SoEhn2AAMHyt0hP1XfnK45JDj6Cuy9prc W0rmdnj9ywWslAnFftpRDBgm9lz4JciLW/GMidVqoksOL/pdFrnySjmVyQSFnZ2agbyp kxKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GSHkstbN; 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 z8si44250424pgu.217.2019.04.15.13.31.17; Mon, 15 Apr 2019 13:31:34 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=GSHkstbN; 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 S1729803AbfDOTIG (ORCPT + 99 others); Mon, 15 Apr 2019 15:08:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:43222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730363AbfDOTIC (ORCPT ); Mon, 15 Apr 2019 15:08:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 080FC218A1; Mon, 15 Apr 2019 19:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355281; bh=8rRQHwobng+aZa9UIy3jd+ANvm5R4fXjvQ7dzLT+bWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSHkstbN5wXfDW5cunLfAZzLqTyt4U6osYg5CPykQIkFpnZnIxHJgPHLoVRHv3S63 q2FEsJqU73FM1vf51qjP5zOmj3pFwy0c+nyhYgdsQpuHjrYcHUIBYXnmqAkqkfzn9l QfcCaIsBCQ4TRQjsj84nCjbkH2lX4v2AIMSqi3gQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrei Vagin , Thomas Gleixner , Mukesh Ojha , Stephen Boyd , John Stultz Subject: [PATCH 4.19 059/101] alarmtimer: Return correct remaining time Date: Mon, 15 Apr 2019 20:58:57 +0200 Message-Id: <20190415183743.631262943@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Vagin commit 07d7e12091f4ab869cc6a4bb276399057e73b0b3 upstream. To calculate a remaining time, it's required to subtract the current time from the expiration time. In alarm_timer_remaining() the arguments of ktime_sub are swapped. Fixes: d653d8457c76 ("alarmtimer: Implement remaining callback") Signed-off-by: Andrei Vagin Signed-off-by: Thomas Gleixner Reviewed-by: Mukesh Ojha Cc: Stephen Boyd Cc: John Stultz Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20190408041542.26338-1-avagin@gmail.com Signed-off-by: Greg Kroah-Hartman --- kernel/time/alarmtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -597,7 +597,7 @@ static ktime_t alarm_timer_remaining(str { struct alarm *alarm = &timr->it.alarm.alarmtimer; - return ktime_sub(now, alarm->node.expires); + return ktime_sub(alarm->node.expires, now); } /**