Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

RE: RZA1 qspi_app kernel NULL pointer dereference with large files

$
0
0

Thanks for the test script. I'll give it a try...but not until I cleans some other things off my plate first.

> I think the L2 cache flushing is something I need. Can you shed some light on how to do that? Thanks alot!


Here is the basic idea (disclaimer...these are my notes of what to to try but I haven't gotten to it yet). You are more than welcome to give it a try.

1. Change the cache routines from "static" to "extern" in arch/arm/include/asm/glue-cache.h

--- a/arch/arm/include/asm/glue-cache.h
+++ b/arch/arm/include/asm/glue-cache.h
@@ -130,22 +130,22 @@
 #endif
 
 #ifndef __ASSEMBLER__
-static inline void nop_flush_icache_all(void) { }
-static inline void nop_flush_kern_cache_all(void) { }
-static inline void nop_flush_kern_cache_louis(void) { }
-static inline void nop_flush_user_cache_all(void) { }
-static inline void nop_flush_user_cache_range(unsigned long a,
+extern inline void nop_flush_icache_all(void) { }
+extern inline void nop_flush_kern_cache_all(void) { }
+extern inline void nop_flush_kern_cache_louis(void) { }
+extern inline void nop_flush_user_cache_all(void) { }
+extern inline void nop_flush_user_cache_range(unsigned long a,
 		unsigned long b, unsigned int c) { }
 
-static inline void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
-static inline int nop_coherent_user_range(unsigned long a,
+extern inline void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
+extern inline int nop_coherent_user_range(unsigned long a,
 		unsigned long b) { return 0; }
-static inline void nop_flush_kern_dcache_area(void *a, size_t s) { }
+extern inline void nop_flush_kern_dcache_area(void *a, size_t s) { }
 
-static inline void nop_dma_flush_range(const void *a, const void *b) { }
+extern inline void nop_dma_flush_range(const void *a, const void *b) { }
 
-static inline void nop_dma_map_area(const void *s, size_t l, int f) { }
-static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
+extern inline void nop_dma_map_area(const void *s, size_t l, int f) { }
+extern inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
 #endif
 
 #ifndef MULTI_CACHE


2. To the qspi_flash driver, add at the top:

#include <asm/cacheflush.h>


3. Before each read/erase/write:

* disable interrupts
* call "flush_cache_all();"
* do the erase/write/read operation

If you try it, let me know how it goes (good/bad)


Viewing all articles
Browse latest Browse all 1583

Trending Articles