public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Cache alignment warnings on Tegra (ARM)
@ 2012-09-12 16:19 Tom Warren
  2012-09-12 16:49 ` Stephen Warren
  0 siblings, 1 reply; 29+ messages in thread
From: Tom Warren @ 2012-09-12 16:19 UTC (permalink / raw)
  To: u-boot

Folks,

Stephen Warren has posted an internal bug regarding the cache
alignment 'warnings' seen on Tegra20 boards when accessing MMC. Here's
the gist:

Executing "mmc dev 0" still yields cache warnings:

Tegra20 (Harmony) # mmc dev 0
ERROR: v7_dcache_inval_range- stop address is not aligned- 0x3fb69908
mmc0 is current device

I carry the patch below to turn these off, but I'd like to drop it.

commit 37bccb3c67897a8944c458d511dac06389ea8f1e
Author: Stephen Warren <swarren@nvidia.com >
Date: Mon Apr 30 11:39:27 2012 -0600

HACK: Disable cache alignment warnings

They are very annoying and noisy

diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index 1b4e808..9031ea1 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -185,8 +185,10 @@ static void v7_dcache_inval_range(u32 start, u32
stop, u32 line_len)
* invalidate the first cache-line
*/
if (start & (line_len- 1)) {
+#if 0
printf("ERROR: %s- start address is not aligned- 0x%08x\n",
__func__, start);
+#endif
/* move to next cache line */
start = (start + line_len- 1) & ~(line_len- 1);
}
@@ -196,8 +198,10 @@ static void v7_dcache_inval_range(u32 start, u32
stop, u32 line_len)
* invalidate the last cache-line
*/
if (stop & (line_len- 1)) {
+#if 0
printf("ERROR: %s- stop address is not aligned- 0x%08x\n",
__func__, stop);
+#endif
/* align to the beginning of this cache line */
stop &= ~(line_len- 1);
}
diff --git a/arch/arm/lib/cache-pl310.c b/arch/arm/lib/cache-pl310.c
index 21d13f7..d8a343c 100644
--- a/arch/arm/lib/cache-pl310.c
+++ b/arch/arm/lib/cache-pl310.c
@@ -94,8 +94,10 @@ void v7_outer_cache_inval_range(u32 start, u32 stop)
* invalidate the first cache-line
*/
if (start & (line_size- 1)) {
+#if 0
printf("ERROR: %s- start address is not aligned- 0x%08x\n",
__func__, start);
+#endif
/* move to next cache line */
start = (start + line_size- 1) & ~(line_size- 1);
}
@@ -105,8 +107,10 @@ void v7_outer_cache_inval_range(u32 start, u32 stop)
* invalidate the last cache-line
*/
if (stop & (line_size- 1)) {
+#if 0
printf("ERROR: %s- stop address is not aligned- 0x%08x\n",
__func__, stop);
+#endif
/* align to the beginning of this cache line */
stop &= ~(line_size- 1);
}

There have been patches in the past (IIRC) that have tried to ensure
all callers (FS, MMC driver, USB driver, etc.) force their buffers to
the appropriate alignment, but I don't know that we can ever correct
every instance, now or in the future.

Can we start a discussion about what we can do about this warning?
Adding an appropriate #ifdef (CONFIG_SYS_NO_CACHE_ALIGNMENT_WARNINGS,
etc.) where Stephen put his #if 0's would be one approach, or changing
the printf() to a debug(), perhaps. As far as I can tell, these
alignment 'errors' don't seem to produce bad data in the transfer.

Thanks,

Tom

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

end of thread, other threads:[~2012-09-19  5:46 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12 16:19 [U-Boot] Cache alignment warnings on Tegra (ARM) Tom Warren
2012-09-12 16:49 ` Stephen Warren
2012-09-12 22:38   ` Marek Vasut
2012-09-12 23:10     ` Stephen Warren
2012-09-12 23:42       ` Marek Vasut
2012-09-14 15:53         ` Simon Glass
2012-09-15 20:01           ` Thierry Reding
2012-09-15 20:11             ` Marek Vasut
2012-09-15 20:41               ` Thierry Reding
2012-09-15 20:56                 ` Marek Vasut
2012-09-16  2:45                 ` Simon Glass
2012-09-16  6:49                   ` Thierry Reding
2012-09-17 21:39                     ` Simon Glass
2012-09-18 14:54                       ` Thierry Reding
2012-09-18 18:24                         ` Simon Glass
2012-09-18 18:37                           ` Marek Vasut
2012-09-18 19:00                             ` Thierry Reding
2012-09-18 19:21                               ` Marek Vasut
2012-09-18 19:29                                 ` Thierry Reding
2012-09-18 19:36                                   ` Marek Vasut
2012-09-18 20:04                                     ` Thierry Reding
2012-09-18 20:28                                       ` Simon Glass
2012-09-18 21:21                                         ` Marek Vasut
2012-09-18 22:42                                           ` Simon Glass
2012-09-18 22:44                                             ` Marek Vasut
2012-09-19  5:45                                               ` Thierry Reding
2012-09-18 21:20                                       ` Marek Vasut
2012-09-19  5:46                                         ` Thierry Reding
2012-09-15 20:19             ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox