linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeffrey Hugo <jhugo@codeaurora.org>
To: rjw@rjwysocki.net, linux-acpi@vger.kernel.org, jeremy.linton@arm.com
Cc: linux-kernel@vger.kernel.org, vkilari@codeaurora.org,
	Jeffrey Hugo <jhugo@codeaurora.org>
Subject: [PATCH] ACPI/PPTT: Handle architecturally unknown cache types
Date: Tue, 11 Sep 2018 13:32:14 -0600	[thread overview]
Message-ID: <1536694334-5811-1-git-send-email-jhugo@codeaurora.org> (raw)

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@codeaurora.org>
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.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.


             reply	other threads:[~2018-09-11 19:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 19:32 Jeffrey Hugo [this message]
2018-09-11 20:16 ` [PATCH] ACPI/PPTT: Handle architecturally unknown cache types Jeremy Linton
2018-09-11 20:38   ` Jeffrey Hugo
2018-09-11 21:25     ` Jeremy Linton
2018-09-12 14:41       ` Jeffrey Hugo
2018-09-12 15:27         ` Sudeep Holla
2018-09-12 15:38           ` Sudeep Holla
2018-09-12 15:57             ` Jeffrey Hugo
2018-09-12 16:15               ` Sudeep Holla
2018-09-12 16:25                 ` Jeffrey Hugo
2018-09-12 15:39         ` Jeremy Linton
2018-09-12 16:06           ` Jeffrey Hugo
2018-09-12 10:49     ` Sudeep Holla
2018-09-12 14:48       ` Jeffrey Hugo
2018-09-12 15:32         ` Sudeep Holla
2018-09-13  5:51       ` Brice Goglin
2018-09-13  9:39         ` James Morse
2018-09-13 10:35           ` Sudeep Holla
2018-09-13 11:53             ` Brice Goglin
2018-09-13 15:10               ` Jeffrey Hugo
2018-09-13 15:16               ` Sudeep Holla
2018-09-12 10:37   ` Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536694334-5811-1-git-send-email-jhugo@codeaurora.org \
    --to=jhugo@codeaurora.org \
    --cc=jeremy.linton@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=vkilari@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).