Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2189511ybm; Thu, 23 May 2019 12:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtHfA22kZPQB9Pp9K1kdvEE4JN6NCQh7aU2lxQP69MbYTHRMEjxI6ftTNqonOosC5Uth6R X-Received: by 2002:a63:eb55:: with SMTP id b21mr71011375pgk.67.1558641046746; Thu, 23 May 2019 12:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558641046; cv=none; d=google.com; s=arc-20160816; b=ESmbU4f3s0zo7syBfGSbN575VcfMuQ1R0f8MS4INlNUOQjOWtwsmOJJ+F4qJTn+FCl AmuTAEvSr7UTgSPVbnmekoRjWPFsdeLKiDR1zsBDg+hax9sdHlTVEfCzN/pQDW0zXAvZ gTU9buaLF/bqTFntPky4v+PFDx6W5itUFWqw7pESRjOo8U8ozvmLTHHkx1u5EGKrQJwI wVU3bF8Y7TwIgmWff979pyw1I22o4YyDdW1CsuuTwo545KdV8Hkf86YwkSPjh6AQoPPa aMyi4Jkrbi/f9Lv/cKppVaSBHzy54Xlp/+TCzzHLe5FuX1hPU2JJmU5TU/byc+cQlFdB c3eQ== 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=axxVVcYYmbKxoISAd9hRiP2bIZRnwZCgJj+44DH4Fqc=; b=kWgbMWWqShWJPJcycfSvwHYjHNLmpvsZ+nhBcE9YoHNSKPUrRA0VRVK9Nl/PbEWBkr oDEH6qg1UCJfIgxk+WPgbELUG9MV9xs0jSbSVquqEnSHt5Li1ZN0+RK0axn91HLc12va Iz3gHE9V2BU2DIvEmfB2T93D15NahYLzuXtxFfEdAT3UqCWSbGbx/LCIxGvKEu5SJOxb YvTRDL5p7ziN7Lbu+Y3fhW+XEuu7fAjOL1W2pQpq6ktdr1v7QaTOzum+M/M2Wexz+kz1 JBIRI+RdYY0Y7w+nL1SWUH/xmpIF+NeJrr18rqjqiU8m0/Uu1Moyo6HuyITRxoU0F3LA cPcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cZg4LqKi; 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 v20si455525pjr.70.2019.05.23.12.50.31; Thu, 23 May 2019 12:50:46 -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=cZg4LqKi; 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 S2388395AbfEWTMN (ORCPT + 99 others); Thu, 23 May 2019 15:12:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:45932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387571AbfEWTMM (ORCPT ); Thu, 23 May 2019 15:12:12 -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 B5E62217D7; Thu, 23 May 2019 19:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638732; bh=Wpgw0TDUGZYsGHzCIymzJWbj9GHxVRPuswZba+0s04s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cZg4LqKic+UsNQOa83Cx/kDP79PN7UR+xj4ZaWEknjwAlsF3FsawVw5ZZTp8mx4Je 9+BZpQTsEdUgxChaX+ErQjFp+kKhA9SZbDEAlCMnP34yHPWTC7D8PlHHCnGvRypjDT yS3TmWTBUAzEJEvaHe2M+ZLPrCQHoI9+l3fLO/FQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Osipenko , Thierry Reding Subject: [PATCH 4.14 36/77] memory: tegra: Fix integer overflow on tick value calculation Date: Thu, 23 May 2019 21:05:54 +0200 Message-Id: <20190523181725.198933109@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@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: Dmitry Osipenko commit b906c056b6023c390f18347169071193fda57dde upstream. Multiplying the Memory Controller clock rate by the tick count results in an integer overflow and in result the truncated tick value is being programmed into hardware, such that the GR3D memory client performance is reduced by two times. Cc: stable Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding Signed-off-by: Greg Kroah-Hartman --- drivers/memory/tegra/mc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/memory/tegra/mc.c +++ b/drivers/memory/tegra/mc.c @@ -72,7 +72,7 @@ static int tegra_mc_setup_latency_allowa u32 value; /* compute the number of MC clock cycles per tick */ - tick = mc->tick * clk_get_rate(mc->clk); + tick = (unsigned long long)mc->tick * clk_get_rate(mc->clk); do_div(tick, NSEC_PER_SEC); value = readl(mc->regs + MC_EMEM_ARB_CFG);