From patchwork Fri Jun 19 14:34:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 224018 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEAF5C433DF for ; Fri, 19 Jun 2020 15:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92FE620786 for ; Fri, 19 Jun 2020 15:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592581030; bh=qb7f3W7ksEM5G51wSix1O2GVlf8dyfkMJi+JkWqJbPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fRLRrdn3eAeFpyVWLild+Ntk25MleJboeA10gntuyAJLWclDui1fZ9JYZXzlEIW/O 5IMy5Xpi9+3yLXfFaGFKcWb2r/rG5z1N1iEofI2L5gGwRMufRt2eBYfW6KfWSrml1n rrlKssA03i065bf9NH6CAGfQGjfZ+QyJABA0fCtI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393741AbgFSPaj (ORCPT ); Fri, 19 Jun 2020 11:30:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:34556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391297AbgFSPai (ORCPT ); Fri, 19 Jun 2020 11:30:38 -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 2A29B20757; Fri, 19 Jun 2020 15:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580637; bh=qb7f3W7ksEM5G51wSix1O2GVlf8dyfkMJi+JkWqJbPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S61UN0VsmHDeSd+QiKl6aaGRimfvBInIaFsPFrBeFqqcdz3ryUlN+oauI/f6kxm0j 6Rn6PGL2kLJT4jk6C2yjFaEEp5zJfCOPMz73MpTsSgGGqlG+itPrY1C+c5GeUwWUn+ HRLb71RmS8714trJkH8ibS133aICGJp8h1HzdEtk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bernard Zhao , Lukasz Luba , Krzysztof Kozlowski Subject: [PATCH 5.7 326/376] memory: samsung: exynos5422-dmc: Fix tFAW timings alignment Date: Fri, 19 Jun 2020 16:34:04 +0200 Message-Id: <20200619141725.764504538@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bernard Zhao commit 4bff7214d263b5235263136cb53147a759b3f3ab upstream. Aligning of tFAW timing with standard was using wrong argument as minimum acceptable value. This could lead to wrong timing if provided timings and clock period do not match the standard. Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422") Cc: Signed-off-by: Bernard Zhao Reviewed-by: Lukasz Luba Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- drivers/memory/samsung/exynos5422-dmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/memory/samsung/exynos5422-dmc.c +++ b/drivers/memory/samsung/exynos5422-dmc.c @@ -1091,7 +1091,7 @@ static int create_timings_aligned(struct /* power related timings */ val = dmc->timings->tFAW / clk_period_ps; val += dmc->timings->tFAW % clk_period_ps ? 1 : 0; - val = max(val, dmc->min_tck->tXP); + val = max(val, dmc->min_tck->tFAW); reg = &timing_power[0]; *reg_timing_power |= TIMING_VAL2REG(reg, val);