Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp312906imm; Thu, 26 Jul 2018 04:09:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpewtu0SMUPb+tYFDWOGT4beLb3jaVXyTmvkFlpCSidan/3fjV+OpgZfSt2XhWVDPxZJiSXC X-Received: by 2002:a17:902:b08d:: with SMTP id p13-v6mr1613864plr.0.1532603394458; Thu, 26 Jul 2018 04:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532603394; cv=none; d=google.com; s=arc-20160816; b=zrlcgAQWlmOuqqn3jrZmjod5scBFK6NOpdDvvYGq3dlfuvED4RaAv4XatvAqLVG1V+ C7bJsTO5+jjykNufgUUHk2r25nS4KcnzYSGmPyhQoQlh25axA0kQWqavsDvMaWyki+7O a1leShe5OHmZnBIClNLcIwzkYc2xOpMfPpjcXI7bckDIcvnH7C+0oLk7uOkpbar10yXf WJBgvnHn5yAWw7Az6LvMME77IEWsqzdRjZEEwBip+yy7pk71GAgEKttMr9ND5SoWJ5hQ JIR9EOgmX+rUNykG2L5VOQnXa1RThTePD3ksMvMC1sfxIAuABLMFxpxucTE3V4sfjR5G RIFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=jtGFFqqSe+VdmAuUCCfP8gkkfbWCAkVVCmGN1bA7NNo=; b=uPXXkG+0mJLyKkrDwL2YjicCSw4g29L2hwsOx8L+eYZ4GAFBI2+HorbC9Zw85zScaw 2EUHCTWDNQhLe+JIyT3Fez1Ne1Y8EBaviqw2f9l37+vUH+uQoQaz1RS3u4ENMPTSwsiR YUqD9MFuwfxF5b6M9AlUCxZ32kUjFeUgwT/oCtVt2Hrt/mSnqEgg5LkOM0AAECZOh6cc 2Via6QTPaBjEtBjTDVt94YweB8bfGQDiWJItANT86YyUms0V2VNK+8AlHrQ2ED3dRMvu JnrcX8HPU52+6VygfyyH0Gil7Qhb9rlHWxfJQcDxLvRcbT2iZK3pzc6B/5BiWUJlbO7/ tspw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=MmCFWUrl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40-v6si977177pla.470.2018.07.26.04.09.39; Thu, 26 Jul 2018 04:09:54 -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=@synopsys.com header.s=mail header.b=MmCFWUrl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729395AbeGZMZK (ORCPT + 99 others); Thu, 26 Jul 2018 08:25:10 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:56583 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729074AbeGZMZK (ORCPT ); Thu, 26 Jul 2018 08:25:10 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 95D6424E1260; Thu, 26 Jul 2018 04:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1532603329; bh=KMtM9l4/iOD6HkzJItyrJuwiy2ZLwIaDJEQTEhwJPMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MmCFWUrlJhMvx4RHaz6cBBkKRZXQl718tr0IninDSpsxEqlfG1Q1J4KR39kW3oDlx Qujx9vkpaIbTdyOmlgVOUISKxIoRB+jsCJdltQ3N96QoPWR9/E1DcEew/0QXdXYi+4 Zhbo1vRSLdOuAnDCgHG1wvu09Jzz9S7oi0nDQF0RAWmh1HZoVGGxm5FzpIl4EyigN1 SJSEg8b2EXQJor8QJu92mikaxkkngWZqXmhx5LzFrhalneInRFQFpS+cHe0ZJQZc3t hEN9bNwLrMWQeU6w4LxhdwKmT38bwMFHxbl0QXsV3JDQ3o+ydQ8fEWOek0A/9INYir 1krPNGRcTR57g== Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.8.86]) by mailhost.synopsys.com (Postfix) with ESMTP id EA25352D0; Thu, 26 Jul 2018 04:08:47 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Vineet Gupta , Alexey Brodkin , Eugeniy Paltsev Subject: [PATCH 2/2] ARC: add SMP_CACHE_BYTES value validate Date: Thu, 26 Jul 2018 14:08:39 +0300 Message-Id: <20180726110839.1915-2-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180726110839.1915-1-Eugeniy.Paltsev@synopsys.com> References: <20180726110839.1915-1-Eugeniy.Paltsev@synopsys.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check that SMP_CACHE_BYTES (and hence ARCH_DMA_MINALIGN) is larger or equal to any cache line length by comparing it with values previously read from ARC cache BCR registers. Signed-off-by: Eugeniy Paltsev --- arch/arc/mm/cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c index 9dbe645ee127..b95365e1253a 100644 --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c @@ -1246,6 +1246,16 @@ void __init arc_cache_init_master(void) } } + /* + * Check that SMP_CACHE_BYTES (and hence ARCH_DMA_MINALIGN) is larger + * or equal to any cache line length. + */ + BUILD_BUG_ON_MSG(L1_CACHE_BYTES > SMP_CACHE_BYTES, + "SMP_CACHE_BYTES must be >= any cache line length"); + if (is_isa_arcv2() && (l2_line_sz > SMP_CACHE_BYTES)) + panic("L2 Cache line [%d] > kernel Config [%d]\n", + l2_line_sz, SMP_CACHE_BYTES); + /* Note that SLC disable not formally supported till HS 3.0 */ if (is_isa_arcv2() && l2_line_sz && !slc_enable) arc_slc_disable(); -- 2.14.4