From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 1658FC2D0F3 for ; Thu, 2 Apr 2020 17:54:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC3322078B for ; Thu, 2 Apr 2020 17:54:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="iAI14Xp7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389066AbgDBRye (ORCPT ); Thu, 2 Apr 2020 13:54:34 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:49586 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388971AbgDBRye (ORCPT ); Thu, 2 Apr 2020 13:54:34 -0400 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 6C68DC1019; Thu, 2 Apr 2020 17:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1585850073; bh=A6dv7G90AhKWjf3KYGvIpGmSKXRCP5AsEJzU1ocQAr0=; h=From:To:Cc:Subject:Date:From; b=iAI14Xp7CVsv8UiCjv7hmFQeL/cgN74d88K+zZ62nL/dCg3abStvz+23MzKa/oJdC T2BsFTGFEx2oCEtKJK55ACJnzpXzx+gdHWA3WJR43h8+NNbDR63CmWuC9NU3T43kxY WZs2E0v8g7AnstXzWQWtpOOPOLSAWd0sY+wwXuqPiU8mujCHyxIrhsGZIkNUqO6Opy y5N7eq0vrcPkh29vnzosB598D7CNKk8KLti4THiZY6GXR+O+KPI3XKhnvinA6EHAlJ 9np7ZBXohxoGnQIKxzfW0CdN8ccfPgfMryUZ3I9T5Fik2im0/v2O9GPhjP2SN9zLkn WVe1acC4kOgiw== Received: from paltsev-e7480.internal.synopsys.com (ru20-e7250.internal.synopsys.com [10.225.50.89]) by mailhost.synopsys.com (Postfix) with ESMTP id F26EAA005C; Thu, 2 Apr 2020 17:54:30 +0000 (UTC) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, Vineet Gupta Cc: linux-kernel@vger.kernel.org, Alexey Brodkin , Eugeniy Paltsev Subject: [PATCH] ARC: Fix ICCM & DCCM runtime size checks Date: Thu, 2 Apr 2020 20:54:28 +0300 Message-Id: <20200402175428.18823-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As of today the ICCM and DCCM size checks are incorrectly using mismatched units (KiB checked against bytes). The CONFIG_ARC_DCCM_SZ and CONFIG_ARC_ICCM_SZ are in KiB, but the size calculated in runtime and stored in cpu->dccm.sz and cpu->iccm.sz is in bytes. Fix that. Reported-by: Paul Greco Signed-off-by: Eugeniy Paltsev --- arch/arc/kernel/setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index aa41af6ef4ac..efdedf83b954 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -409,12 +410,12 @@ static void arc_chk_core_config(void) if ((unsigned int)__arc_dccm_base != cpu->dccm.base_addr) panic("Linux built with incorrect DCCM Base address\n"); - if (CONFIG_ARC_DCCM_SZ != cpu->dccm.sz) + if (CONFIG_ARC_DCCM_SZ * SZ_1K != cpu->dccm.sz) panic("Linux built with incorrect DCCM Size\n"); #endif #ifdef CONFIG_ARC_HAS_ICCM - if (CONFIG_ARC_ICCM_SZ != cpu->iccm.sz) + if (CONFIG_ARC_ICCM_SZ * SZ_1K != cpu->iccm.sz) panic("Linux built with incorrect ICCM Size\n"); #endif -- 2.21.1