[kernel] r7141 - in dists/sid/linux-2.6/debian: patches patches/series

Kyle McMartin kyle at costa.debian.org
Fri Aug 11 23:24:00 UTC 2006


Author: kyle
Date: Fri Aug 11 23:23:59 2006
New Revision: 7141

Added:
   dists/sid/linux-2.6/debian/patches/pa8800-abstract-kmap.patch
   dists/sid/linux-2.6/debian/patches/pa8800-kmap-implementation.patch
   dists/sid/linux-2.6/debian/patches/series/7
Modified:
   dists/sid/linux-2.6/debian/changelog

Log:
Fix pa8800... mostly.


Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Fri Aug 11 23:23:59 2006
@@ -4,6 +4,9 @@
   * arm/iop32x: Enable CONFIG_BLK_DEV_OFFBOARD.
   * arm/iop32x: Build IDE as modules.
 
+  [ Kyle McMartin ]
+  * Apply patch to fix pa8800 (mostly...)
+
  -- Martin Michlmayr <tbm at cyrius.com>  Fri, 11 Aug 2006 22:49:46 +0200
 
 linux-2.6 (2.6.17-6) unstable; urgency=low

Added: dists/sid/linux-2.6/debian/patches/pa8800-abstract-kmap.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/pa8800-abstract-kmap.patch	Fri Aug 11 23:23:59 2006
@@ -0,0 +1,28 @@
+[PATCH] add kmap API abstraction
+
+This patch allows the kmap/kunmap API to be abstracted for implementation
+purposes by architectures that don't implement highmem.  The purpose
+of this is for those architectures that need to perform arch specific
+coherence operations on kmap/kunmap.
+
+Signed-off-by: James Bottomley <James.Bottomley at SteelEye.com>
+Index: linux-2.6/include/linux/highmem.h
+===================================================================
+--- linux-2.6.orig/include/linux/highmem.h	2006-07-26 17:51:09.000000000 -0700
++++ linux-2.6/include/linux/highmem.h	2006-07-26 17:51:18.000000000 -0700
+@@ -29,6 +29,7 @@
+ 
+ static inline unsigned int nr_free_highpages(void) { return 0; }
+ 
++#ifndef ARCH_HAS_KMAP
+ static inline void *kmap(struct page *page)
+ {
+ 	might_sleep();
+@@ -41,6 +42,7 @@
+ #define kunmap_atomic(addr, idx)	do { } while (0)
+ #define kmap_atomic_pfn(pfn, idx)	page_address(pfn_to_page(pfn))
+ #define kmap_atomic_to_page(ptr)	virt_to_page(ptr)
++#endif
+ 
+ #endif /* CONFIG_HIGHMEM */
+ 

Added: dists/sid/linux-2.6/debian/patches/pa8800-kmap-implementation.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/pa8800-kmap-implementation.patch	Fri Aug 11 23:23:59 2006
@@ -0,0 +1,162 @@
+[PATCH] parisc specific kmap API implementation for pa8800
+
+This patch fixes the pa8800 at a gross level (there are still other
+subtle incoherency issues which can still cause crashes and HPMCs).
+
+What it does is try to force eject inequivalent aliases before they
+become visible to the L2 cache (which is where we get the incoherence
+problems).
+
+A new function (parisc_requires_coherency) is introduced in
+asm/processor.h to identify the pa8x00 processors (8800 and 8900)
+which have the issue.
+
+Signed-off-by: James Bottomley <James.Bottomley at SteelEye.com>
+Index: linux-2.6/arch/parisc/kernel/cache.c
+===================================================================
+--- linux-2.6.orig/arch/parisc/kernel/cache.c	2006-08-02 06:28:46.000000000 -0700
++++ linux-2.6/arch/parisc/kernel/cache.c	2006-08-02 06:35:42.000000000 -0700
+@@ -91,7 +91,8 @@
+ 
+ 		flush_kernel_dcache_page(page);
+ 		clear_bit(PG_dcache_dirty, &page->flags);
+-	}
++	} else if (parisc_requires_coherency())
++		flush_kernel_dcache_page(page);
+ }
+ 
+ void
+@@ -370,3 +371,35 @@
+ 
+ 	printk(KERN_INFO "Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus());
+ }
++
++extern void purge_kernel_dcache_page(unsigned long);
++extern void clear_user_page_asm(void *page, unsigned long vaddr);
++
++void
++clear_user_page(void *page, unsigned long vaddr, struct page *pg)
++{
++	purge_kernel_dcache_page((unsigned long)page);
++	purge_tlb_start();
++	pdtlb_kernel(page);
++	purge_tlb_end();
++	clear_user_page_asm(page, vaddr);
++}
++
++void flush_kernel_dcache_page_addr(void *addr)
++{
++	flush_kernel_dcache_page_asm(addr);
++	purge_tlb_start();
++	pdtlb_kernel(addr);
++	purge_tlb_end();
++}
++EXPORT_SYMBOL(flush_kernel_dcache_page_addr);
++
++#ifdef CONFIG_PA8X00
++
++void kunmap_parisc(void *addr)
++{
++	if (parisc_requires_coherency())
++		flush_kernel_dcache_page_addr(addr);
++}
++EXPORT_SYMBOL(kunmap_parisc);
++#endif
+Index: linux-2.6/include/asm-parisc/cacheflush.h
+===================================================================
+--- linux-2.6.orig/include/asm-parisc/cacheflush.h	2006-08-02 06:28:45.000000000 -0700
++++ linux-2.6/include/asm-parisc/cacheflush.h	2006-08-02 06:37:00.000000000 -0700
+@@ -191,16 +191,38 @@
+ }
+ #define ARCH_HAS_FLUSH_ANON_PAGE
+ 
+-static inline void
+-flush_kernel_dcache_page(struct page *page)
++#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
++void flush_kernel_dcache_page_addr(void *addr);
++static inline void flush_kernel_dcache_page(struct page *page)
+ {
+-	flush_kernel_dcache_page_asm(page_address(page));
++	flush_kernel_dcache_page_addr(page_address(page));
+ }
+-#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
+ 
+ #ifdef CONFIG_DEBUG_RODATA
+ void mark_rodata_ro(void);
+ #endif
+ 
++#ifdef CONFIG_PA8X00
++/* Only pa8800, pa8900 needs this */
++#define ARCH_HAS_KMAP
++
++void kunmap_parisc(void *addr);
++
++static inline void *kmap(struct page *page)
++{
++	might_sleep();
++	return page_address(page);
++}
++
++#define kunmap(page)			kunmap_parisc(page_address(page))
++
++#define kmap_atomic(page, idx)		page_address(page)
++
++#define kunmap_atomic(addr, idx)	kunmap_parisc(addr)
++
++#define kmap_atomic_pfn(pfn, idx)	page_address(pfn_to_page(pfn))
++#define kmap_atomic_to_page(ptr)	virt_to_page(ptr)
++#endif
++
+ #endif /* _PARISC_CACHEFLUSH_H */
+ 
+Index: linux-2.6/include/asm-parisc/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-parisc/page.h	2006-08-02 06:29:39.000000000 -0700
++++ linux-2.6/include/asm-parisc/page.h	2006-08-02 06:29:46.000000000 -0700
+@@ -34,24 +34,16 @@
+ 
+ struct page;
+ 
+-extern void purge_kernel_dcache_page(unsigned long);
+ extern void copy_user_page_asm(void *to, void *from);
+-extern void clear_user_page_asm(void *page, unsigned long vaddr);
+ 
+ static inline void
+ copy_user_page(void *vto, void *vfrom, unsigned long vaddr, struct page *pg)
+ {
++	/* no coherency needed (all in kmap/kunmap) */
+ 	copy_user_page_asm(vto, vfrom);
+-	flush_kernel_dcache_page_asm(vto);
+-	/* XXX: ppc flushes icache too, should we? */
+ }
+ 
+-static inline void
+-clear_user_page(void *page, unsigned long vaddr, struct page *pg)
+-{
+-	purge_kernel_dcache_page((unsigned long)page);
+-	clear_user_page_asm(page, vaddr);
+-}
++void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
+ 
+ /*
+  * These are used to make use of C type-checking..
+Index: linux-2.6/include/asm-parisc/processor.h
+===================================================================
+--- linux-2.6.orig/include/asm-parisc/processor.h	2006-08-02 06:39:20.000000000 -0700
++++ linux-2.6/include/asm-parisc/processor.h	2006-08-02 06:50:34.000000000 -0700
+@@ -332,6 +332,15 @@
+ 
+ #define cpu_relax()	barrier()
+ 
++/* Used as a macro to identify the combined VIPT/PIPT cached
++ * CPUs which require a guarantee of coherency (no inequivalent
++ * aliases with different data, whether clean or not) to operate */
++static inline int parisc_requires_coherency(void)
++{
++	/* FIXME: also pa8900 - when we see one */
++	return boot_cpu_data.cpu_type == mako;
++}
++
+ #endif /* __ASSEMBLY__ */
+ 
+ #endif /* __ASM_PARISC_PROCESSOR_H */

Added: dists/sid/linux-2.6/debian/patches/series/7
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/series/7	Fri Aug 11 23:23:59 2006
@@ -0,0 +1,2 @@
++ pa8800-abstract-kmap.patch
++ pa8800-kmap-implementation.patch



More information about the Kernel-svn-changes mailing list