From patchwork Sat Aug 5 00:11:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 109468 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp1999859obb; Fri, 4 Aug 2017 17:12:07 -0700 (PDT) X-Received: by 10.99.175.1 with SMTP id w1mr3950796pge.392.1501891927313; Fri, 04 Aug 2017 17:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501891927; cv=none; d=google.com; s=arc-20160816; b=reqmWuiRcbHrMIsEh2XyNOz2MfvmsYqayr5zoWWSwdR+mCgOB83wcL6Gwgj+KLTzq9 vbC4aEj66Fj1PQlafm4BtDnG5kkRCnyl5zcAqezaWeGWwucaxy6Cr8Gor+cWaEda5+49 8lYIUJz94213Mhqbn8zkm8EBlLLfE8fNepb5t6J/uKJUXydjxGYe5sTp5nC4T9ZTMe/y +pll9ShefGxKzsm/PlOSF0s5fibF8IjiFpvR9DG0rapTJm6AM8WWLxYQXj4vCxiUiWC7 j/8FRECViw83JrjC7dKfpnBcxVwXJoCxjHyp8cJGhdU06fbAXqVsMW/NIQW+FLmMeky9 RJ4A== 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:arc-authentication-results; bh=VG3J19qf21w4rdr27aHyNrn+vDqBteF1PVdmFaxvur8=; b=QOzC9lu+Z4+9mBIxOYDWEuV/KxnKYMjjhVpfUNo8C/qPYpueFNh3CGaKTaC4PLR+ms zuh1zZdJ87MpmKnznvuQZv0svVQXpF5Iut0ocRT/CdZOWf8FQyMJ0zaI/SgnIRb9uKCe RkusmAxITHi6yDmsJZlyUsGiXH11oFV+tqnhJpSJhqhqwwov28Kqd2At4OsVb2xLjOmZ vGtkdTNRVpUgPxzMsnilIAAkEHRgJ0D/y1s0CZEVfARH5hCHOGGLPcNywWSnSFOj4Z1P ex0PPuxZasoGXokeGzsYqOlTEFjoaY4fKEDZgJ0fDnAINld8yLan7kMazNWEaX8TjQDe NH7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 a59si1847411plc.837.2017.08.04.17.12.07; Fri, 04 Aug 2017 17:12:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbdHEAMD (ORCPT + 7 others); Fri, 4 Aug 2017 20:12:03 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:32980 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753318AbdHEAMB (ORCPT ); Fri, 4 Aug 2017 20:12:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 84ED115A2; Fri, 4 Aug 2017 17:12:01 -0700 (PDT) Received: from beelzebub.ast.arm.com (beelzebub.austin.arm.com [10.118.12.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 28EAA3F592; Fri, 4 Aug 2017 17:12:01 -0700 (PDT) From: Jeremy Linton To: linux-arm-kernel@lists.infradead.org Cc: linux-acpi@vger.kernel.org, sudeep.holla@arm.com, hanjun.guo@linaro.org, lorenzo.pieralisi@arm.com, will.deacon@arm.com, catalin.marinas@arm.com Subject: [RFC 1/4] drivers: base: cacheinfo: Add support for ACPI based firmware tables Date: Fri, 4 Aug 2017 19:11:56 -0500 Message-Id: <20170805001159.12769-2-jeremy.linton@arm.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170805001159.12769-1-jeremy.linton@arm.com> References: <20170805001159.12769-1-jeremy.linton@arm.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The /sys cache entries should support ACPI/PPTT generated cache topology information. Lets detect ACPI systems and call an arch specific cache_setup_acpi() routine to update the hardware probed cache topology. Signed-off-by: Jeremy Linton --- drivers/base/cacheinfo.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.9.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index eb3af27..44fa374 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -215,6 +215,11 @@ static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, } #endif +int __weak cache_setup_acpi(unsigned int cpu) +{ + return -ENOTSUPP; +} + static int cache_shared_cpu_map_setup(unsigned int cpu) { struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); @@ -225,11 +230,11 @@ static int cache_shared_cpu_map_setup(unsigned int cpu) if (this_cpu_ci->cpu_map_populated) return 0; - if (of_have_populated_dt()) + if (!acpi_disabled) + ret = cache_setup_acpi(cpu); + else if (of_have_populated_dt()) ret = cache_setup_of_node(cpu); - else if (!acpi_disabled) - /* No cache property/hierarchy support yet in ACPI */ - ret = -ENOTSUPP; + if (ret) return ret; @@ -286,7 +291,7 @@ static void cache_shared_cpu_map_remove(unsigned int cpu) static void cache_override_properties(unsigned int cpu) { - if (of_have_populated_dt()) + if (acpi_disabled && of_have_populated_dt()) return cache_of_override_properties(cpu); }