All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI/PPTT: Add variable to record max cache line size
@ 2019-04-26  1:40 Shaokun Zhang
  2019-04-26  1:40 ` [PATCH 2/2] arm64: cacheinfo: Update cache_line_size detected from PPTT Shaokun Zhang
  2019-04-26 17:02 ` [PATCH 1/2] ACPI/PPTT: Add variable to record max cache line size Jeremy Linton
  0 siblings, 2 replies; 12+ messages in thread
From: Shaokun Zhang @ 2019-04-26  1:40 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Catalin Marinas, john.garry, Rafael J. Wysocki, Jeremy Linton,
	Shaokun Zhang, qiuzhenfa, guohanjun, Len Brown

Add coherency_max_size variable to record the maximum cache line size
detected from PPTT information for different cache levels. We will
synchronize it with CTR_EL0.CWG reporting in cache_line_size() for arm64.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Jeremy Linton <jeremy.linton@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
To: linux-acpi@vger.kernel.org
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
 drivers/acpi/pptt.c  | 7 ++++++-
 include/linux/acpi.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index 065c4fc245d1..3998621e00ce 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -341,6 +341,8 @@ static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *ta
 	return found;
 }
 
+unsigned int coherency_max_size;
+
 /**
  * update_cache_properties() - Update cacheinfo for the given processor
  * @this_leaf: Kernel cache info structure being updated
@@ -360,8 +362,11 @@ static void update_cache_properties(struct cacheinfo *this_leaf,
 	this_leaf->fw_token = cpu_node;
 	if (found_cache->flags & ACPI_PPTT_SIZE_PROPERTY_VALID)
 		this_leaf->size = found_cache->size;
-	if (found_cache->flags & ACPI_PPTT_LINE_SIZE_VALID)
+	if (found_cache->flags & ACPI_PPTT_LINE_SIZE_VALID) {
 		this_leaf->coherency_line_size = found_cache->line_size;
+		coherency_max_size = this_leaf->coherency_line_size > coherency_max_size ?
+			this_leaf->coherency_line_size : coherency_max_size;
+	}
 	if (found_cache->flags & ACPI_PPTT_NUMBER_OF_SETS_VALID)
 		this_leaf->number_of_sets = found_cache->number_of_sets;
 	if (found_cache->flags & ACPI_PPTT_ASSOCIATIVITY_VALID)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d5dcebd7aad3..199cde875d5b 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -315,6 +315,7 @@ static inline bool acpi_sci_irq_valid(void)
 
 extern int sbf_port;
 extern unsigned long acpi_realmode_flags;
+extern unsigned int coherency_max_size;
 
 int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-30  2:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-26  1:40 [PATCH 1/2] ACPI/PPTT: Add variable to record max cache line size Shaokun Zhang
2019-04-26  1:40 ` [PATCH 2/2] arm64: cacheinfo: Update cache_line_size detected from PPTT Shaokun Zhang
2019-04-26 17:18   ` Jeremy Linton
2019-04-27 16:12     ` Catalin Marinas
2019-04-29 11:12       ` Sudeep Holla
2019-04-29 11:06     ` Sudeep Holla
2019-04-27 16:16   ` Catalin Marinas
2019-04-30  1:32     ` Zhangshaokun
2019-04-26 17:02 ` [PATCH 1/2] ACPI/PPTT: Add variable to record max cache line size Jeremy Linton
2019-04-29 11:26   ` Sudeep Holla
2019-04-30  2:19     ` Zhangshaokun
2019-04-30  2:13   ` Zhangshaokun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.