add more stability fixes for brcm47xx-2.6 on bcm4704 (from #1485)
[openwrt-10.03/.git] / target / linux / brcm47xx-2.6 / patches / 160-kmap_coherent.patch
1 --- ./arch/mips/mm/init.c.orig  2007-03-22 08:08:34.000000000 -0600
2 +++ ./arch/mips/mm/init.c       2007-03-22 08:09:04.000000000 -0600
3 @@ -207,7 +207,7 @@
4         struct page *page, unsigned long vaddr, void *dst, const void *src,
5         unsigned long len)
6  {
7 -       if (cpu_has_dc_aliases) {
8 +       if (cpu_has_dc_aliases && cpu_use_kmap_coherent) {
9                 void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
10                 memcpy(vto, src, len);
11                 kunmap_coherent(page);
12 @@ -223,7 +223,7 @@
13         struct page *page, unsigned long vaddr, void *dst, const void *src,
14         unsigned long len)
15  {
16 -       if (cpu_has_dc_aliases) {
17 +       if (cpu_has_dc_aliases && cpu_use_kmap_coherent) {
18                 void *vfrom =
19                         kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
20                 memcpy(dst, vfrom, len);
21 --- ./include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h.orig       2007-03-22 08:10:54.000000000 -0600
22 +++ ./include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h    2007-03-22 08:10:50.000000000 -0600
23 @@ -0,0 +1,13 @@
24 +/*
25 + * This file is subject to the terms and conditions of the GNU General Public
26 + * License.  See the file "COPYING" in the main directory of this archive
27 + * for more details.
28 + *
29 + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
30 + */
31 +#ifndef __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H
32 +#define __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H
33 +
34 +#define cpu_use_kmap_coherent  0
35 +
36 +#endif /* __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H */
37 --- ./include/asm-mips/cpu-features.h.orig      2007-03-22 08:09:16.000000000 -0600
38 +++ ./include/asm-mips/cpu-features.h   2007-03-22 08:09:52.000000000 -0600
39 @@ -98,6 +98,9 @@
40  #ifndef cpu_has_pindexed_dcache
41  #define cpu_has_pindexed_dcache        (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
42  #endif
43 +#ifndef cpu_use_kmap_coherent
44 +#define cpu_use_kmap_coherent 1
45 +#endif
46  
47  /*
48   * I-Cache snoops remote store.  This only matters on SMP.  Some multiprocessors