Received: by 10.192.165.148 with SMTP id m20csp575564imm; Wed, 25 Apr 2018 04:32:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx483AOtG9Iq79zpdHfjb2RASpeglBDHzd2cKLUPSaHYW0QiUUgiJXUR71ciWO5sMfBPUAIqj X-Received: by 10.101.99.206 with SMTP id n14mr6947076pgv.316.1524655960034; Wed, 25 Apr 2018 04:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655960; cv=none; d=google.com; s=arc-20160816; b=ep+iB48y1vxfaBBmR3rhh/9heYLiAXWsGby3Qx0zf3wC8mBf/xPE/aKAgtpjBTD58E j+feQ7vQBnE1K0cYbQ5LQBKHbyp6YaBZMh3Pz9+k85bPzAzJ49CwLPkbXFov5g8GPvjm ZzzUsuqVrGxqldPWSiH935loeg+HIEUNBzynZHQ80RFtWQ4E5S32AN8pMpibpx9rxMgw SSSX0RNzsj5Gqt46jFgLNByQH6kdtQRzYZQKKq3siCpquIP/BpEOfi2lvjeCG7n/leGe TubvoAhFzmy6dSGGXzKW+p6yYLs5RwF54neYHv8Z6pVIS2mwhR0GM7BCl0tOtGTbYGdG v6cw== 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=QP6JOS8b+KAJj9cpuajv9ngrqLOUYllyEpRkpWebD/w=; b=j0hjVi0u3gu/OOQOgFmtoBwzHiV58rhPFxRYb8kVk05KHJnRWqic2MWOx+Vc1w3qag Z8PHBpccfWZzxrX3mjuOsc359YuOJu66TkBKiGif0H0Wwp+JyGcScNO0J1MDKmFXEan9 K3m2/xm3mvvtlyIId8RPjJTxuK2w+H0a+FjweeH1a8Ko2KvBvRS7Pgo8VzsFbXEy0Sl0 xbUUB5N+I+V2XVebBTO51rj4cLGrtermkPs9EzR7Rw8RqAAoSC6sdACaRhgtYha3G+JR yyrozDOBQ25bccOdE3KpSj+XN8Nb+TRktvApEPfGZgzZ0zhGVgFV1BpxQhHpk5y6/7zB 3mWg== 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 j10-v6si16044596plg.396.2018.04.25.04.32.25; Wed, 25 Apr 2018 04:32:39 -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 S1753125AbeDYLbW (ORCPT + 99 others); Wed, 25 Apr 2018 07:31:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51232 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336AbeDYKhy (ORCPT ); Wed, 25 Apr 2018 06:37:54 -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 7E36641C; Wed, 25 Apr 2018 10:37:53 +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.14 004/183] clocksource/imx-tpm: Correct -ETIME return condition check Date: Wed, 25 Apr 2018 12:33:44 +0200 Message-Id: <20180425103242.784677410@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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.14-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)