<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi Tvrtko,</p>
<p>It seems without cacheflush.h being included, when I build for
arm64 or x86, it stills pulls in cacheflush.h:</p>
<div style="font-family: 'Liberation Mono', monospace; white-space: pre"><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">./.</span><span style="color: #705050; background: #3f3f3f; font-weight: bold; font-style: normal; text-decoration: none">drm_cache</span><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">.o.cmd:838: include/linux/cacheflush.h \ </span></div><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">./.</span><span style="color: #705050; background: #3f3f3f; font-weight: bold; font-style: normal; text-decoration: none">drm_cache</span><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">.o.cmd:839: arch/x86/include/asm/cacheflush.h \ </span></div><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">./.</span><span style="color: #705050; background: #3f3f3f; font-weight: bold; font-style: normal; text-decoration: none">drm_cache</span><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">.o.cmd:920: include/asm-generic/cacheflush.h \ </span></div><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">
</span></div><div>
<div style="font-family: 'Liberation Mono', monospace; white-space: pre"><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">./.</span><span style="color: #705050; background: #3f3f3f; font-weight: bold; font-style: normal; text-decoration: none">drm_cache</span><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">.o.cmd:830: include/linux/cacheflush.h \ </span></div><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">./.</span><span style="color: #705050; background: #3f3f3f; font-weight: bold; font-style: normal; text-decoration: none">drm_cache</span><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">.o.cmd:831: arch/arm64/include/asm/cacheflush.h \ </span></div><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">./.</span><span style="color: #705050; background: #3f3f3f; font-weight: bold; font-style: normal; text-decoration: none">drm_cache</span><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">.o.cmd:1085: include/asm-generic/cacheflush.h \ </span></div><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">
</span></div><div>So it seems without including it, cacheflush.h stills get pulled in, </div><div>I think its because its a required kernel source to build the kernel </div><div>per specific architecture, but please correct if I am wrong,as I am still</div><div>trying to understand how things works!</div><div>
</div><div>Michael Cheng
<span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none"></span></div></div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none"></span></div><div><span style="color: #dcdccc; background: #3f3f3f; font-weight: normal; font-style: normal; text-decoration: none">
</span></div></div>
<div class="moz-cite-prefix">On 2022-02-25 8:28 a.m., Tvrtko Ursulin
wrote:<br>
</div>
<blockquote type="cite" cite="mid:011a236d-7ed4-0d48-e8a6-c9bd98740d5b@linux.intel.com">
<br>
On 25/02/2022 03:24, Michael Cheng wrote:
<br>
<blockquote type="cite">Add arm64 support for
drm_clflush_virt_range. caches_clean_inval_pou
<br>
performs a flush by first performing a clean, follow by an
invalidation
<br>
operation.
<br>
<br>
v2 (Michael Cheng): Use correct macro for cleaning and
invalidation the
<br>
dcache. Thanks Tvrtko for the suggestion.
<br>
<br>
v3 (Michael Cheng): Replace asm/cacheflush.h with
linux/cacheflush.h
<br>
<br>
v4 (Michael Cheng): Arm64 does not export dcache_clean_inval_poc
as a
<br>
symbol that could be use by other modules, thus use
<br>
caches_clean_inval_pou instead. Also this version
<br>
removes include for cacheflush, since its
already
<br>
included base on architecture type.
<br>
</blockquote>
<br>
What does it mean that it is included based on architecture type?
Some of the other header already pulls it in?
<br>
<br>
Regards,
<br>
<br>
Tvrtko
<br>
<br>
<blockquote type="cite">Signed-off-by: Michael Cheng
<a class="moz-txt-link-rfc2396E" href="mailto:michael.cheng@intel.com"><michael.cheng@intel.com></a>
<br>
Reviewed-by: Matt Roper <a class="moz-txt-link-rfc2396E" href="mailto:matthew.d.roper@intel.com"><matthew.d.roper@intel.com></a>
<br>
---
<br>
drivers/gpu/drm/drm_cache.c | 5 +++++
<br>
1 file changed, 5 insertions(+)
<br>
<br>
diff --git a/drivers/gpu/drm/drm_cache.c
b/drivers/gpu/drm/drm_cache.c
<br>
index c3e6e615bf09..81c28714f930 100644
<br>
--- a/drivers/gpu/drm/drm_cache.c
<br>
+++ b/drivers/gpu/drm/drm_cache.c
<br>
@@ -174,6 +174,11 @@ drm_clflush_virt_range(void *addr, unsigned
long length)
<br>
if (wbinvd_on_all_cpus())
<br>
pr_err("Timed out waiting for cache flush\n");
<br>
+
<br>
+#elif defined(CONFIG_ARM64)
<br>
+ void *end = addr + length;
<br>
+ caches_clean_inval_pou((unsigned long)addr, (unsigned
long)end);
<br>
+
<br>
#else
<br>
WARN_ONCE(1, "Architecture has no drm_cache.c support\n");
<br>
#endif
<br>
</blockquote>
</blockquote>
</body>
</html>