From patchwork Thu Dec 22 14:09:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 708231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tkth30X6cz9sxN for ; Fri, 23 Dec 2016 01:09:55 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cK449-0005lO-F6; Thu, 22 Dec 2016 14:09:53 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cK446-0005W1-Fc for linux-snps-arc@lists.infradead.org; Thu, 22 Dec 2016 14:09:51 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id A073C24E222B; Thu, 22 Dec 2016 06:09:33 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 8AED31EB; Thu, 22 Dec 2016 06:09:33 -0800 (PST) Received: from abrodkin-7440l.internal.synopsys.com (abrodkin-7440l.internal.synopsys.com [10.121.8.73]) by mailhost.synopsys.com (Postfix) with ESMTP id 8CDC61C5; Thu, 22 Dec 2016 06:09:31 -0800 (PST) From: Alexey Brodkin To: linux-snps-arc@lists.infradead.org Subject: [PATCH 2/2] arc: Fix xCCM size check Date: Thu, 22 Dec 2016 17:09:10 +0300 Message-Id: <1482415750-5471-3-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482415750-5471-1-git-send-email-abrodkin@synopsys.com> References: <1482415750-5471-1-git-send-email-abrodkin@synopsys.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161222_060950_647328_5DB38C39 X-CRM114-Status: UNSURE ( 7.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.47.9 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , Alexey Brodkin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Igor Guryanov MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org CONFIG_ARC_ICCM_SZ in menuconfig is specified in kB while "cpu->Xccm.sz" contains value in bytes thus direct comparison fails leading to boot-time panic like that: ----------------------->8--------------------- IDENTITY : ARCVER [0x52] ARCNUM [0x1] CHIPID [ 0x0] processor [1] : ARC HS38 R2.1 (ARCv2 ISA) Timers : Timer0 Timer1 Local-64-bit-Ctr (not used) ISA Extn : atomic ll64 unalign (not used) : mpy[opt 9] div_rem norm barrel-shift swap minmax swape BPU : full match, cache:2048, Predict Table:16384 MMU [v0] : 0k PAGE, JTLB 0 (0x0), uDTLB 0, uITLB 0 I-Cache : N/A D-Cache : N/A Peripherals : 0xf0000000, IO-Coherency (disabled) Vector Table : 0x80000000 FPU : SP DP DEBUG : ActionPoint smaRT RTT Extn [CCM] : DCCM @ e0000000, 256 KB / ICCM: @ 60000000, 256 KB OS ABI [v4] : 64-bit data any register aligned Extn [SMP] : ARConnect (v2): 2 cores with IPI IDU DEBUG GFRC Kernel panic - not syncing: Linux built with incorrect DCCM Size ---[ end Kernel panic - not syncing: Linux built with incorrect DCCM Size ----------------------->8--------------------- Signed-off-by: Alexey Brodkin Cc: Igor Guryanov Cc: stable@vger.kernel.org --- arch/arc/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c index ee574f37f365..601dab6fe5e0 100644 --- a/arch/arc/kernel/setup.c +++ b/arch/arc/kernel/setup.c @@ -333,12 +333,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 != TO_KB(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 != TO_KB(cpu->iccm.sz)) panic("Linux built with incorrect ICCM Size\n"); #endif