Received: by 10.192.165.148 with SMTP id m20csp522277imm; Wed, 25 Apr 2018 03:36:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+It7G/ueXT6qs5Z/Dh1XLIUefcEOUvFoDrf2uGNaVYAm4SNFJlbV6cJNXyJPN08J6lUHb+ X-Received: by 2002:a17:902:be06:: with SMTP id r6-v6mr22932374pls.158.1524652579865; Wed, 25 Apr 2018 03:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524652579; cv=none; d=google.com; s=arc-20160816; b=Oi2bzPCszuGwLWyplTe0HREmFr4GFrAc/suJf+WdhiUw4esaklyPRt0XuCtUTLeOLW 17tNwqLQFruHj1QmLCVZ42YAQfPK+NWn8+4CGfpJz0rz/BYoPdokGIB+D7jS24WxsUxP Tz0/3OuJDICAGqZvklPIPw+vAGT5K9kSMPhy0NBHutiuQWoIW0CIVfZJ9ks7OZyq6/wW +G9c1AmmUkJqBpETE7NzI3RILpQWqXIISm0EseqEI6Zb6QKXbuLq3FnS9iiHdNDa0N3k wpv1A7shY++EHjY/mXcwwZMhAXpB+XeaOg0+H5oEcg0JIcY3TMana3zSk1hX9QaG6K8l yCiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=bl4gRxZaqYpTzTDZYjo1LPSTI5LI88ttKK8EaJNO9EI=; b=FLoOfOvd9dFyFeQKRIxIxtZfGOvAmdCe8A9ZhPPNCYXOgiaVVjXK+QxcV6gF3cy1bX HuOGtUzmmu/yRtMnDLHqxHycq7lU8hv/xrsoTvb1lmyLpjp2PgjhCs65KBVfLpGBuTmE 9B2PtiPOS5HNRzOF5Md+9KCCm7HuMYg2QEOfo7jKqeOLXJRI//lx4RNeeEWe9T5gReD/ RimzFGH/WKMn1VWonO1OaG50d/ZRH1PyCS/7Of1Swi6M1/MrkO+XorOujPnW9GfbCVNa dWxfucy3NpwF3JZl9nuGnsQkyyi150pP7MJO6JQ6VrwpLbSjFCSDxX4q2JgzR4miMb8q Hnxw== 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 m1si9199213pfe.79.2018.04.25.03.36.05; Wed, 25 Apr 2018 03:36:19 -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; 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 S1752913AbeDYKe5 (ORCPT + 99 others); Wed, 25 Apr 2018 06:34:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50966 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752700AbeDYKew (ORCPT ); Wed, 25 Apr 2018 06:34:52 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5582449F; Wed, 25 Apr 2018 10:34:51 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anson Huang , Thomas Gleixner , Dong Aisheng , daniel.lezcano@linaro.org, Linux-imx@nxp.com Subject: [PATCH 4.16 06/26] clocksource/imx-tpm: Correct -ETIME return condition check Date: Wed, 25 Apr 2018 12:33:15 +0200 Message-Id: <20180425103315.108418382@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103314.842517924@linuxfoundation.org> References: <20180425103314.842517924@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anson Huang commit 7407188489c62a7b5694bc75a6db2b82af94c9a5 upstream. The additional brakects added to tpm_set_next_event's return value computation causes (int) forced type conversion NOT taking effect, and the incorrect value return will cause various system timer issue, like RCU stall etc.. Remove the additional brackets to make sure tpm_set_next_event always returns correct value. Fixes: 059ab7b82eec ("clocksource/drivers/imx-tpm: Add imx tpm timer support") Signed-off-by: Anson Huang Signed-off-by: Thomas Gleixner Acked-by: Dong Aisheng Cc: stable@vger.kernel.org Cc: daniel.lezcano@linaro.org Cc: Linux-imx@nxp.com Link: https://lkml.kernel.org/r/1524117883-2484-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/clocksource/timer-imx-tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/clocksource/timer-imx-tpm.c +++ b/drivers/clocksource/timer-imx-tpm.c @@ -105,7 +105,7 @@ static int tpm_set_next_event(unsigned l * of writing CNT registers which may cause the min_delta event got * missed, so we need add a ETIME check here in case it happened. */ - return (int)((next - now) <= 0) ? -ETIME : 0; + return (int)(next - now) <= 0 ? -ETIME : 0; } static int tpm_set_state_oneshot(struct clock_event_device *evt)