[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org>
Date: Tue, 11 Sep 2018 13:32:14 -0600
From: Jeffrey Hugo <jhugo@...eaurora.org>
To: rjw@...ysocki.net, linux-acpi@...r.kernel.org,
jeremy.linton@....com
Cc: linux-kernel@...r.kernel.org, vkilari@...eaurora.org,
Jeffrey Hugo <jhugo@...eaurora.org>
Subject: [PATCH] ACPI/PPTT: Handle architecturally unknown cache types
The type of a cache might not be specified by architectural mechanisms (ie
system registers), but its type might be specified in the PPTT. In this
case, following the PPTT specification, we should identify the cache as
the type specified by PPTT.
This fixes the following lscpu issue where only the cache type sysfs file
is missing which results in no output providing a poor user experience in
the above system configuration-
lscpu: cannot open /sys/devices/system/cpu/cpu0/cache/index3/type: No such
file or directory
Fixes: 2bd00bcd73e5 (ACPI/PPTT: Add Processor Properties Topology Table parsing)
Reported-by: Vijaya Kumar K <vkilari@...eaurora.org>
Signed-off-by: Jeffrey Hugo <jhugo@...eaurora.org>
---
drivers/acpi/pptt.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index d1e26cb..3c6db09 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -401,6 +401,21 @@ static void update_cache_properties(struct cacheinfo *this_leaf,
break;
}
}
+ if ((this_leaf->type == CACHE_TYPE_NOCACHE) &&
+ (found_cache->flags & ACPI_PPTT_CACHE_TYPE_VALID)) {
+ switch (found_cache->attributes & ACPI_PPTT_MASK_CACHE_TYPE) {
+ case ACPI_PPTT_CACHE_TYPE_DATA:
+ this_leaf->type = CACHE_TYPE_DATA;
+ break;
+ case ACPI_PPTT_CACHE_TYPE_INSTR:
+ this_leaf->type = CACHE_TYPE_INST;
+ break;
+ case ACPI_PPTT_CACHE_TYPE_UNIFIED:
+ case ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT:
+ this_leaf->type = CACHE_TYPE_UNIFIED;
+ break;
+ }
+ }
/*
* If the above flags are valid, and the cache type is NOCACHE
* update the cache type as well.
--
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
Powered by blists - more mailing lists