Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2145343yba; Sun, 5 May 2019 23:58:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqze4DUUXLHxSEAIWAnCEW9zMU86kZ3+fp2KZU5ICSjCrTwBQujklJk31JLxWXLieOKhofyk X-Received: by 2002:a63:fd08:: with SMTP id d8mr30159019pgh.141.1557125896159; Sun, 05 May 2019 23:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557125896; cv=none; d=google.com; s=arc-20160816; b=vxmThjwjomKNTCG9IDT+p5VU0e+3eSKwlJ+NPrETfRbeb+pkCgGz3YIPrZAkXfTDxb wwMbKQs7LTyb3/wQrJn2dQwex7PzSEIp/uqOte7pWmG/es0bPHMk5H2urgCusmW786Mg TJTn4wk5esGdyGD66q/8dWXEXK0KO/j/FB2uilMl0qWJUrP8MaTcwD6BNkFWH0FF7TPv c5QMWeqKZ+vzMejhr1shaDnnWWNyzlYgCtg0UTbj74/GJ9Rf/KIZa1anYaVdy2ViVo7Y n+JOvP7BBH+U607beufk+KIMoMpHP/FRypTicTlA4l6Q1Hl/e2DgdJELh/VUprbKok/G K4vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=FHPhAHUqHmlQwlBrjB+ib5l4Ur4Z53Hsrj4ZIxQq1TY=; b=F1G4p8gQV46PMQKvCfRPlCEIVt1lyILwrvonD56XNNg8zF6o1EbQXYl0dXZA+CFo0C DC2Lkkqegw+aOssINTqzoKmYlvuhsbD36E9YhIwMm+ruOulaqq9n/QN+Vqj+ETrE55Cn amVofy6acP2I1LZH05CMKyjGWqJg8+LIudxeBrBMRFb+KP2bMm10G+cJrSShqYm5OKwE C7pKiy2YQlVBjOUgOaYyLgL/lcClOWiLs3Dcdjj+gt/ZG1OGU7LnZdhwqJz68um6solS FwqzPNiOvyMPxgEx9/aEXKVHhlCywyEUSbImqaFD+STiISkCm84JDWftAASSYZJcJqde +3tQ== ARC-Authentication-Results: i=1; mx.google.com; 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 r26si5682492pgb.32.2019.05.05.23.58.00; Sun, 05 May 2019 23:58:16 -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; 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 S1726313AbfEFGzn (ORCPT + 99 others); Mon, 6 May 2019 02:55:43 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:58254 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725710AbfEFGzn (ORCPT ); Mon, 6 May 2019 02:55:43 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 721023DD45301D10986E; Mon, 6 May 2019 14:55:33 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Mon, 6 May 2019 14:55:27 +0800 From: Shaokun Zhang To: , CC: , , , Shaokun Zhang , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , Sudeep Holla , Catalin Marinas , Jeremy Linton , Will Deacon Subject: [PATCH v2 1/2] drivers: base: cacheinfo: Add variable to record max cache line size Date: Mon, 6 May 2019 14:53:56 +0800 Message-ID: <1557125637-9558-1-git-send-email-zhangshaokun@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add coherency_max_size variable to record the maximum cache line size for different cache levels. We will synchronize it with CTR_EL0.CWG reporting in cache_line_size() for arm64. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Sudeep Holla Cc: Catalin Marinas Cc: Jeremy Linton Cc: Will Deacon Signed-off-by: Shaokun Zhang --- ChangeLog since v1 -- Move coherency_max_size to drivers/base/cacheinfo.c -- Address Catalin's comments Link: https://www.spinics.net/lists/arm-kernel/msg723615.html drivers/base/cacheinfo.c | 5 +++++ include/linux/cacheinfo.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index a7359535caf5..8827c60f51e2 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -213,6 +213,8 @@ int __weak cache_setup_acpi(unsigned int cpu) return -ENOTSUPP; } +unsigned int coherency_max_size; + static int cache_shared_cpu_map_setup(unsigned int cpu) { struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); @@ -251,6 +253,9 @@ static int cache_shared_cpu_map_setup(unsigned int cpu) cpumask_set_cpu(i, &this_leaf->shared_cpu_map); } } + /* record the maximum cache line size */ + if (this_leaf->coherency_line_size > coherency_max_size) + coherency_max_size = this_leaf->coherency_line_size; } return 0; diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h index 70e19bc6cc9f..46b92cd61d0c 100644 --- a/include/linux/cacheinfo.h +++ b/include/linux/cacheinfo.h @@ -17,6 +17,8 @@ enum cache_type { CACHE_TYPE_UNIFIED = BIT(2), }; +extern unsigned int coherency_max_size; + /** * struct cacheinfo - represent a cache leaf node * @id: This cache's id. It is unique among caches with the same (type, level). -- 2.7.4