diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-25 10:28:29 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-25 10:28:29 +0000 |
commit | 29209ec1e96b9c60ad9844225eb6adc7442114b9 (patch) | |
tree | 71aeca682f34e7c5d753f2bda8ce78d72d464a58 | |
parent | 584601ebf0f406951603031f478b8a3ead22bc01 (diff) | |
download | master-187ad058-29209ec1e96b9c60ad9844225eb6adc7442114b9.tar.gz master-187ad058-29209ec1e96b9c60ad9844225eb6adc7442114b9.tar.bz2 master-187ad058-29209ec1e96b9c60ad9844225eb6adc7442114b9.zip |
kernel: fix a small bug in the MIPS highmem fix
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48482 3c298f89-4303-0410-b956-a3cf2f4a3e73
4 files changed, 20 insertions, 8 deletions
diff --git a/target/linux/generic/patches-4.3/101-MIPS-fix-cache-flushing-for-highmem-pages.patch b/target/linux/generic/patches-4.3/101-MIPS-fix-cache-flushing-for-highmem-pages.patch index d7220af9af..6a6c581bc5 100644 --- a/target/linux/generic/patches-4.3/101-MIPS-fix-cache-flushing-for-highmem-pages.patch +++ b/target/linux/generic/patches-4.3/101-MIPS-fix-cache-flushing-for-highmem-pages.patch @@ -79,17 +79,23 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org> addr = (unsigned long) page_address(page); flush_data_cache_page(addr); -@@ -142,7 +161,12 @@ void __update_cache(struct vm_area_struc +@@ -142,12 +161,17 @@ void __update_cache(struct vm_area_struc if (unlikely(!pfn_valid(pfn))) return; page = pfn_to_page(pfn); - if (page_mapping(page) && Page_dcache_dirty(page)) { -+ if (!Page_dcache_dirty(page)) ++ if (!Page_dcache_dirty(page) || !page_mapping(page)) + return; + + if (PageHighMem(page)) { + flush_highmem_page(page); -+ } else if (page_mapping(page)) { ++ } else { addr = (unsigned long) page_address(page); if (exec || pages_do_alias(addr, address & PAGE_MASK)) flush_data_cache_page(addr); +- ClearPageDcacheDirty(page); + } ++ ClearPageDcacheDirty(page); + } + + unsigned long _page_cachable_default; diff --git a/target/linux/generic/patches-4.3/309-mips_fuse_workaround.patch b/target/linux/generic/patches-4.3/309-mips_fuse_workaround.patch index 811dd6b808..14d7962b94 100644 --- a/target/linux/generic/patches-4.3/309-mips_fuse_workaround.patch +++ b/target/linux/generic/patches-4.3/309-mips_fuse_workaround.patch @@ -1,6 +1,6 @@ --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c -@@ -38,6 +38,7 @@ void (*__flush_cache_vunmap)(void); +@@ -39,6 +39,7 @@ void (*__flush_cache_vunmap)(void); void (*__flush_kernel_vmap_range)(unsigned long vaddr, int size); EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range); diff --git a/target/linux/generic/patches-4.4/101-MIPS-fix-cache-flushing-for-highmem-pages.patch b/target/linux/generic/patches-4.4/101-MIPS-fix-cache-flushing-for-highmem-pages.patch index d7220af9af..6a6c581bc5 100644 --- a/target/linux/generic/patches-4.4/101-MIPS-fix-cache-flushing-for-highmem-pages.patch +++ b/target/linux/generic/patches-4.4/101-MIPS-fix-cache-flushing-for-highmem-pages.patch @@ -79,17 +79,23 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org> addr = (unsigned long) page_address(page); flush_data_cache_page(addr); -@@ -142,7 +161,12 @@ void __update_cache(struct vm_area_struc +@@ -142,12 +161,17 @@ void __update_cache(struct vm_area_struc if (unlikely(!pfn_valid(pfn))) return; page = pfn_to_page(pfn); - if (page_mapping(page) && Page_dcache_dirty(page)) { -+ if (!Page_dcache_dirty(page)) ++ if (!Page_dcache_dirty(page) || !page_mapping(page)) + return; + + if (PageHighMem(page)) { + flush_highmem_page(page); -+ } else if (page_mapping(page)) { ++ } else { addr = (unsigned long) page_address(page); if (exec || pages_do_alias(addr, address & PAGE_MASK)) flush_data_cache_page(addr); +- ClearPageDcacheDirty(page); + } ++ ClearPageDcacheDirty(page); + } + + unsigned long _page_cachable_default; diff --git a/target/linux/generic/patches-4.4/309-mips_fuse_workaround.patch b/target/linux/generic/patches-4.4/309-mips_fuse_workaround.patch index 811dd6b808..14d7962b94 100644 --- a/target/linux/generic/patches-4.4/309-mips_fuse_workaround.patch +++ b/target/linux/generic/patches-4.4/309-mips_fuse_workaround.patch @@ -1,6 +1,6 @@ --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c -@@ -38,6 +38,7 @@ void (*__flush_cache_vunmap)(void); +@@ -39,6 +39,7 @@ void (*__flush_cache_vunmap)(void); void (*__flush_kernel_vmap_range)(unsigned long vaddr, int size); EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range); |