Skip to contentSkip to conversation

ARM: implement cacheinfo support (for v7/v7m)

PATCH In review Dmitry Baryshkov 4 participants 14 messages Oct 14, 2024 – Jan 15, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: implement cacheinfo support (for v7/v7m)

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

---
Changes in v2:
- Handle cores like ARM1176, which have cpu_architecture() ==
CPU_ARCH_ARMv7 (because of VMSAv7 implementation), but no CLIDR
register (because they are ARMv6) (Arnd).
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Dmitry Baryshkov (2):
ARM: add CLIDR accessor functions
ARM: implement cacheinfo support

 arch/arm/Kconfig                 |   1 +
 arch/arm/include/asm/cache.h     |   6 ++
 arch/arm/include/asm/cachetype.h |  13 +++
 arch/arm/kernel/Makefile         |   1 +
 arch/arm/kernel/cacheinfo.c      | 173 +++++++++++++++++++++++++++++++++++++++
 include/linux/cacheinfo.h        |   2 +-
 6 files changed, 195 insertions(+), 1 deletion(-)

---
base-commit: 7f773fd61baa9b136faa5c4e6555aa64c758d07c
change-id: 20231231-armv7-cacheinfo-9fa533ae371e

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>
#1 lore raw

PATCH v2 1/2 ARM: add CLIDR accessor functions

Add functions to read the CLIDR, Cache Level ID Register.

---
 arch/arm/include/asm/cachetype.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/include/asm/cachetype.h +13 -0
index b9dbe1d4c8fe..b01c59076b84 100644
@@ -83,6 +83,14 @@ static inline unsigned int read_ccsidr(void)
 	asm volatile("mrc p15, 1, %0, c0, c0, 0" : "=r" (val));
 	return val;
 }
+
+static inline unsigned int read_clidr(void)
+{
+	unsigned int val;
+
+	asm volatile("mrc p15, 1, %0, c0, c0, 1" : "=r" (val));
+	return val;
+}
 #else /* CONFIG_CPU_V7M */
 #include <linux/io.h>
 #include "asm/v7m.h"
@@ -96,6 +104,11 @@ static inline unsigned int read_ccsidr(void)
 {
 	return readl(BASEADDR_V7M_SCB + V7M_SCB_CCSIDR);
 }
+
+static inline unsigned int read_clidr(void)
+{
+	return readl(BASEADDR_V7M_SCB + V7M_SCB_CLIDR);
+}
 #endif
 
 #endif
Signature · 1 line
2.39.5
#3 lore raw

PATCH v2 2/2 ARM: implement cacheinfo support

In reply to Dmitry Baryshkov

On ARMv7 / v7m machines read CTR and CLIDR registers to provide information regarding the cache topology. Earlier machines should describe full cache topology in the device tree.

Note, this follows the ARM64 cacheinfo support and provides only minimal support required to bootstrap cache info. All useful properties should be decribed in Device Tree.

---
 arch/arm/Kconfig             |   1 +
 arch/arm/include/asm/cache.h |   6 ++
 arch/arm/kernel/Makefile     |   1 +
 arch/arm/kernel/cacheinfo.c  | 173 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/cacheinfo.h    |   2 +-
 5 files changed, 182 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
index 749179a1d162..e790543c3eaf 100644
@@ -5,6 +5,7 @@ config ARM
 	select ARCH_32BIT_OFF_T
 	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE if HAVE_KRETPROBES && FRAME_POINTER && !ARM_UNWIND
 	select ARCH_HAS_BINFMT_FLAT
+	select ARCH_HAS_CACHE_LINE_SIZE if OF
 	select ARCH_HAS_CPU_CACHE_ALIASING
 	select ARCH_HAS_CPU_FINALIZE_INIT if MMU
 	select ARCH_HAS_CURRENT_STACK_POINTER
arch/arm/include/asm/cache.h +6 -0
index e3ea34558ada..ecbc100d22a5 100644
@@ -26,4 +26,10 @@
 
 #define __read_mostly __section(".data..read_mostly")
 
+#ifndef __ASSEMBLY__
+#ifdef CONFIG_ARCH_HAS_CACHE_LINE_SIZE
+int cache_line_size(void);
+#endif
+#endif
+
 #endif
arch/arm/kernel/Makefile +1 -0
index aaae31b8c4a5..b3333d070390 100644
@@ -40,6 +40,7 @@ obj-y		+= entry-armv.o
 endif
 
 obj-$(CONFIG_MMU)		+= bugs.o
+obj-$(CONFIG_OF)		+= cacheinfo.o
 obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
 obj-$(CONFIG_ISA_DMA_API)	+= dma.o
 obj-$(CONFIG_FIQ)		+= fiq.o fiqasm.o
arch/arm/kernel/cacheinfo.c new file +173 -0

173 lines not on this page · raw message

include/linux/cacheinfo.h +1 -1
index 108060612bb8..1e7061549fc7 100644
@@ -147,7 +147,7 @@ static inline int get_cpu_cacheinfo_id(int cpu, int level)
 	return ci ? ci->id : -1;
 }
 
-#ifdef CONFIG_ARM64
+#if defined(CONFIG_ARM64) || defined(CONFIG_ARM)
 #define use_arch_cache_info()	(true)
 #else
 #define use_arch_cache_info()	(false)
Signature · 1 line
2.39.5
Reviewed-by on v2 2/2
#4 lore raw

Re: [PATCH v2 2/2] ARM: implement cacheinfo support

Quoted 9 lines · Dmitry Baryshkov

On ARMv7 / v7m machines read CTR and CLIDR registers to provide information regarding the cache topology. Earlier machines should describe full cache topology in the device tree.

Note, this follows the ARM64 cacheinfo support and provides only minimal support required to bootstrap cache info. All useful properties should be decribed in Device Tree.

It's really neat actually!

Yours,
Linus Walleij

#5 lore raw

Re: [PATCH v2 2/2] ARM: implement cacheinfo support

In reply to Dmitry Baryshkov
Quoted 90 lines · Dmitry Baryshkov

On ARMv7 / v7m machines read CTR and CLIDR registers to provide information regarding the cache topology. Earlier machines should describe full cache topology in the device tree.

Note, this follows the ARM64 cacheinfo support and provides only minimal support required to bootstrap cache info. All useful properties should be decribed in Device Tree.

---
  arch/arm/Kconfig             |   1 +
  arch/arm/include/asm/cache.h |   6 ++
  arch/arm/kernel/Makefile     |   1 +
  arch/arm/kernel/cacheinfo.c  | 173 +++++++++++++++++++++++++++++++++++++++++++
  include/linux/cacheinfo.h    |   2 +-
  5 files changed, 182 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
index 749179a1d162..e790543c3eaf 100644
@@ -5,6 +5,7 @@ config ARM
  	select ARCH_32BIT_OFF_T
  	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE if HAVE_KRETPROBES && FRAME_POINTER && !ARM_UNWIND
  	select ARCH_HAS_BINFMT_FLAT
+	select ARCH_HAS_CACHE_LINE_SIZE if OF
  	select ARCH_HAS_CPU_CACHE_ALIASING
  	select ARCH_HAS_CPU_FINALIZE_INIT if MMU
  	select ARCH_HAS_CURRENT_STACK_POINTER
arch/arm/include/asm/cache.h +6 -0
index e3ea34558ada..ecbc100d22a5 100644
@@ -26,4 +26,10 @@
 
  #define __read_mostly __section(".data..read_mostly")
 
+#ifndef __ASSEMBLY__
+#ifdef CONFIG_ARCH_HAS_CACHE_LINE_SIZE
+int cache_line_size(void);
+#endif
+#endif
+
  #endif
arch/arm/kernel/Makefile +1 -0
index aaae31b8c4a5..b3333d070390 100644
@@ -40,6 +40,7 @@ obj-y		+= entry-armv.o
  endif
 
  obj-$(CONFIG_MMU)		+= bugs.o
+obj-$(CONFIG_OF)		+= cacheinfo.o
  obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
  obj-$(CONFIG_ISA_DMA_API)	+= dma.o
  obj-$(CONFIG_FIQ)		+= fiq.o fiqasm.o
arch/arm/kernel/cacheinfo.c new file +28 -0
new file mode 100644
index 000000000000..a8eabcaa18d8
@@ -0,0 +1,173 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ *  ARM cacheinfo support
+ *
+ *  Copyright (C) 2023 Linaro Ltd.
+ *  Copyright (C) 2015 ARM Ltd.
+ *  All Rights Reserved
+ */
+
+#include <linux/bitfield.h>
+#include <linux/cacheinfo.h>
+#include <linux/of.h>
+
+#include <asm/cachetype.h>
+#include <asm/cputype.h>
+#include <asm/system_info.h>
+
+/* Ctypen, bits[3(n - 1) + 2 : 3(n - 1)], for n = 1 to 7 */
+#define CLIDR_CTYPE_SHIFT(level)	(3 * (level - 1))
+#define CLIDR_CTYPE_MASK(level)		(7 << CLIDR_CTYPE_SHIFT(level))
+#define CLIDR_CTYPE(clidr, level)	\
+	(((clidr) & CLIDR_CTYPE_MASK(level)) >> CLIDR_CTYPE_SHIFT(level))
+
+#define MAX_CACHE_LEVEL			7	/* Max 7 level supported */
+
+#define CTR_FORMAT_MASK	GENMASK(27, 24)
+#define CTR_FORMAT_ARMV6 0
+#define CTR_FORMAT_ARMV7 4

arch/arm/kernel/cacheinfo.c line 38

Quoted 10 lines
arch/arm/kernel/cacheinfo.c new file +10 -0
+#define CTR_CWG_MASK	GENMASK(27, 24)
+#define CTR_DSIZE_LEN_MASK GENMASK(13, 12)
+#define CTR_ISIZE_LEN_MASK GENMASK(1, 0)
+
+/* Also valid for v7m */
+static inline int cache_line_size_cp15(void)
+{
+	u32 ctr = read_cpuid_cachetype();
+	u32 format = FIELD_GET(CTR_FORMAT_MASK, ctr);
+

On Samsung Exynos421x (CortexA9 based) format is read as 0x3, which causes a warning later in the code. How such value should be handled to avoid warning?

Quoted 13 lines
arch/arm/kernel/cacheinfo.c new file +12 -0
+	if (format == CTR_FORMAT_ARMV7) {
+		u32 cwg = FIELD_GET(CTR_CWG_MASK, ctr);
+
+		return cwg ? 4 << cwg : ARCH_DMA_MINALIGN;
+	} else if (WARN_ON_ONCE(format != CTR_FORMAT_ARMV6)) {
+		return ARCH_DMA_MINALIGN;
+	}
+
+	return 8 << max(FIELD_GET(CTR_ISIZE_LEN_MASK, ctr),
+			FIELD_GET(CTR_DSIZE_LEN_MASK, ctr));
+}
+
Quoted 1 line
Quoted 1 line

...

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
#6 lore raw

Re: [PATCH v2 2/2] ARM: implement cacheinfo support

Quoted 97 lines · Marek Szyprowski
Quoted 96 lines · Dmitry Baryshkov

On ARMv7 / v7m machines read CTR and CLIDR registers to provide information regarding the cache topology. Earlier machines should describe full cache topology in the device tree.

Note, this follows the ARM64 cacheinfo support and provides only minimal support required to bootstrap cache info. All useful properties should be decribed in Device Tree.

---
  arch/arm/Kconfig             |   1 +
  arch/arm/include/asm/cache.h |   6 ++
  arch/arm/kernel/Makefile     |   1 +
  arch/arm/kernel/cacheinfo.c  | 173 +++++++++++++++++++++++++++++++++++++++++++
  include/linux/cacheinfo.h    |   2 +-
  5 files changed, 182 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
index 749179a1d162..e790543c3eaf 100644
@@ -5,6 +5,7 @@ config ARM
  	select ARCH_32BIT_OFF_T
  	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE if HAVE_KRETPROBES && FRAME_POINTER && !ARM_UNWIND
  	select ARCH_HAS_BINFMT_FLAT
+	select ARCH_HAS_CACHE_LINE_SIZE if OF
  	select ARCH_HAS_CPU_CACHE_ALIASING
  	select ARCH_HAS_CPU_FINALIZE_INIT if MMU
  	select ARCH_HAS_CURRENT_STACK_POINTER
arch/arm/include/asm/cache.h +6 -0
index e3ea34558ada..ecbc100d22a5 100644
@@ -26,4 +26,10 @@
 
  #define __read_mostly __section(".data..read_mostly")
 
+#ifndef __ASSEMBLY__
+#ifdef CONFIG_ARCH_HAS_CACHE_LINE_SIZE
+int cache_line_size(void);
+#endif
+#endif
+
  #endif
arch/arm/kernel/Makefile +1 -0
index aaae31b8c4a5..b3333d070390 100644
@@ -40,6 +40,7 @@ obj-y		+= entry-armv.o
  endif
 
  obj-$(CONFIG_MMU)		+= bugs.o
+obj-$(CONFIG_OF)		+= cacheinfo.o
  obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
  obj-$(CONFIG_ISA_DMA_API)	+= dma.o
  obj-$(CONFIG_FIQ)		+= fiq.o fiqasm.o
arch/arm/kernel/cacheinfo.c new file +34 -0
new file mode 100644
index 000000000000..a8eabcaa18d8
@@ -0,0 +1,173 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ *  ARM cacheinfo support
+ *
+ *  Copyright (C) 2023 Linaro Ltd.
+ *  Copyright (C) 2015 ARM Ltd.
+ *  All Rights Reserved
+ */
+
+#include <linux/bitfield.h>
+#include <linux/cacheinfo.h>
+#include <linux/of.h>
+
+#include <asm/cachetype.h>
+#include <asm/cputype.h>
+#include <asm/system_info.h>
+
+/* Ctypen, bits[3(n - 1) + 2 : 3(n - 1)], for n = 1 to 7 */
+#define CLIDR_CTYPE_SHIFT(level)	(3 * (level - 1))
+#define CLIDR_CTYPE_MASK(level)		(7 << CLIDR_CTYPE_SHIFT(level))
+#define CLIDR_CTYPE(clidr, level)	\
+	(((clidr) & CLIDR_CTYPE_MASK(level)) >> CLIDR_CTYPE_SHIFT(level))
+
+#define MAX_CACHE_LEVEL			7	/* Max 7 level supported */
+
+#define CTR_FORMAT_MASK	GENMASK(27, 24)
+#define CTR_FORMAT_ARMV6 0
+#define CTR_FORMAT_ARMV7 4
+#define CTR_CWG_MASK	GENMASK(27, 24)
+#define CTR_DSIZE_LEN_MASK GENMASK(13, 12)
+#define CTR_ISIZE_LEN_MASK GENMASK(1, 0)
+
+/* Also valid for v7m */
+static inline int cache_line_size_cp15(void)
Quoted 8 lines

arch/arm/kernel/cacheinfo.c line 38

Quoted 4 lines
arch/arm/kernel/cacheinfo.c new file +4 -0
+{
+	u32 ctr = read_cpuid_cachetype();
+	u32 format = FIELD_GET(CTR_FORMAT_MASK, ctr);
+

On Samsung Exynos421x (CortexA9 based) format is read as 0x3, which causes a warning later in the code. How such value should be handled to avoid warning?

I should be more carefull when doing c&p. I've posted the fix at
https://lore.kernel.org/r/[email protected]

Quoted 21 lines
Quoted 14 lines
arch/arm/kernel/cacheinfo.c new file +12 -0
+	if (format == CTR_FORMAT_ARMV7) {
+		u32 cwg = FIELD_GET(CTR_CWG_MASK, ctr);
+
+		return cwg ? 4 << cwg : ARCH_DMA_MINALIGN;
+	} else if (WARN_ON_ONCE(format != CTR_FORMAT_ARMV6)) {
+		return ARCH_DMA_MINALIGN;
+	}
+
+	return 8 << max(FIELD_GET(CTR_ISIZE_LEN_MASK, ctr),
+			FIELD_GET(CTR_DSIZE_LEN_MASK, ctr));
+}
+
Quoted 1 line
Quoted 1 line

...

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Signature · 2 lines
With best wishes
Dmitry
#7 lore raw
In reply to Dmitry Baryshkov
Quoted 5 lines · Dmitry Baryshkov

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

Quoted 8 lines

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

Sudeep, Ard, Arnd, Russell, I have been struggling to get reviews for this for several months. Is there a chance to hear anything? I'd really like to scratch this off my 'pending' list.

Quoted 7 lines

---
Changes in v2:
- Handle cores like ARM1176, which have cpu_architecture() ==
CPU_ARCH_ARMv7 (because of VMSAv7 implementation), but no CLIDR
register (because they are ARMv6) (Arnd).
- Link to v1: https://lore.kernel.org/r/[email protected]

Signature · 2 lines
With best wishes
Dmitry
#8 lore raw

(cc Linus)

Quoted 31 lines · Dmitry Baryshkov
Quoted 5 lines · Dmitry Baryshkov

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

Quoted 8 lines

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

Sudeep, Ard, Arnd, Russell, I have been struggling to get reviews for this for several months. Is there a chance to hear anything? I'd really like to scratch this off my 'pending' list.

Quoted 7 lines

---
Changes in v2:
- Handle cores like ARM1176, which have cpu_architecture() ==
CPU_ARCH_ARMv7 (because of VMSAv7 implementation), but no CLIDR
register (because they are ARMv6) (Arnd).
- Link to v1: https://lore.kernel.org/r/[email protected]

--
With best wishes
Dmitry

#9 lore raw
In reply to Dmitry Baryshkov

Hi Dmitry,

Quoted 10 lines · Dmitry Baryshkov

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Quoted 5 lines

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

I added my review tags to the v2 patches, can you put them into Russell's patch tracker?

Yours,
Linus Walleij

#10 lore raw
Quoted 15 lines · Linus Walleij

Hi Dmitry,

Quoted 10 lines · Dmitry Baryshkov

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Quoted 8 lines
Quoted 5 lines

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

I added my review tags to the v2 patches, can you put them into Russell's patch tracker?

Done, 9432/1 and 9433/1, thank you!

Signature · 2 lines
With best wishes
Dmitry
#11 lore raw
Quoted 20 lines · Dmitry Baryshkov
Quoted 19 lines · Linus Walleij

Hi Dmitry,

Quoted 14 lines · Dmitry Baryshkov

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I added my review tags to the v2 patches, can you put them into Russell's patch tracker?

Done, 9432/1 and 9433/1, thank you!

These patches are still in the patch tracker in the "Incoming" state.

Russell, Linus (and Sudeep, Ard, Arnd), is there anything blocking them from being accepted?

Signature · 2 lines
With best wishes
Dmitry
#12 lore raw
Quoted 26 lines · Dmitry Baryshkov
Quoted 25 lines · Dmitry Baryshkov
Quoted 23 lines · Linus Walleij

Hi Dmitry,

Quoted 10 lines · Dmitry Baryshkov

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Quoted 5 lines

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

I added my review tags to the v2 patches, can you put them into Russell's patch tracker?

Quoted 6 lines
Quoted 1 line

Done, 9432/1 and 9433/1, thank you!

These patches are still in the patch tracker in the "Incoming" state.

Russell, Linus (and Sudeep, Ard, Arnd), is there anything blocking them from being accepted?

I added my Reviewed-by, perhaps rebase them on v6.13-rc1 so Russell knows it applies cleanly? (It's pretty straight-forward to supercede a patch in the tracker.)

Yours,
Linus Walleij

#13 lore raw
Quoted 30 lines · Linus Walleij
Quoted 28 lines · Dmitry Baryshkov
Quoted 26 lines · Dmitry Baryshkov
Quoted 15 lines · Linus Walleij

Hi Dmitry,

Quoted 10 lines · Dmitry Baryshkov

Follow the ARM64 platform and implement simple cache information driver. As it reads data from CTR (ARMv6+) and CLIDR (ARMv7+) registers, it is limited to the ARMv7 / ARMv7M, providing simple fallback or just returning -EOPNOTSUPP in case of older platforms.

In theory we should be able to skip CLIDR reading and assume that Dcache and Icache (or unified L1 cache) always exist if CTR is supported and returns sensible value. However I think this better be handled by the maintainers of corresponding platforms.

Quoted 8 lines
Quoted 5 lines

Other than just providing information to the userspace, this patchset is required in order to implement L2 cache driver (and in the end CPU frequency scaling) on ARMv7-based Qualcomm devices.

I added my review tags to the v2 patches, can you put them into Russell's patch tracker?

Done, 9432/1 and 9433/1, thank you!

Quoted 8 lines
Quoted 4 lines

These patches are still in the patch tracker in the "Incoming" state.

Russell, Linus (and Sudeep, Ard, Arnd), is there anything blocking them from being accepted?

I added my Reviewed-by, perhaps rebase them on v6.13-rc1 so Russell knows it applies cleanly? (It's pretty straight-forward to supercede a patch in the tracker.)

Done, let's hope they finally get picked up by Russell.

Signature · 2 lines
With best wishes
Dmitry