nios2 fix for v4.4-rc3
nios2: fix cache coherency -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJWWH/qAAoJEFWoEK+e3syCt3YP/2dW6s/aMrsTyyAtMF5YEHhx 9xCSvkU8cXe9RFg9TUTdulRRP4z9LBB5+azVx2rbdsr3tvjH99PG/rYGIQ8kiCyx UibGu6QeWtQBnDtXqe5nffLTBK3JzuOxOiVRw+R6UW/Vzo5z0TbubWNBJBzC7fyr zf0TRtmeRU+/V9V+7TFIrpzI8htomH/b37q1mpWLfys8cEaTg0AApsBpr6PwFMi3 zMiFqlObd0G5ZRs1j4OO3EMaDg+baEAn8oSzBT4x/wqhqnFg5Sc3AtsW2jl5Wg1u xRCJU+p68xNzXvIdq2hBbaON6iUUbhxdPW92Qxx6grjHmV6jmtvwCLj5roWc83Sd VCDKWc62P0ZpILMH2DgR9RPvmtSe6gnRoVHbqWe6/N6hGXx+ltNj3IGcWag2OAMx /CFtZeIMyIQvo2QrVd8h1AhdhHHH2yCaQyqplGr3ZtNzJeArpRssGsl1PTrEQIXw ie12ECSGePaLnYcxQWABbl4KAj65qtk+oBimNFMVIVPzlFsH5RWL6RjaUbLLJ5ci mVAyuYlCUSL9CByUiMPOmOfFMUCa/BAGc46Fv3LfXAINYCF2lXMtdlz6f5CKXdZB 6rvKD8bYlZBEQ8sCMohtJV6UDGw9nmF7XLqmSOotfDo1c4hbmB1eavQwngXxH+YY FYutttwGqNWM8GyuPPtb =sBUF -----END PGP SIGNATURE----- Merge tag 'nios2-v4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 Pull nios2 fix from Ley Foon Tan: "nios2: fix cache coherency" * tag 'nios2-v4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2: nios2: fix cache coherency
This commit is contained in:
commit
5a44ed0d30
|
@ -23,22 +23,6 @@ static void __flush_dcache(unsigned long start, unsigned long end)
|
|||
end += (cpuinfo.dcache_line_size - 1);
|
||||
end &= ~(cpuinfo.dcache_line_size - 1);
|
||||
|
||||
for (addr = start; addr < end; addr += cpuinfo.dcache_line_size) {
|
||||
__asm__ __volatile__ (" flushda 0(%0)\n"
|
||||
: /* Outputs */
|
||||
: /* Inputs */ "r"(addr)
|
||||
/* : No clobber */);
|
||||
}
|
||||
}
|
||||
|
||||
static void __flush_dcache_all(unsigned long start, unsigned long end)
|
||||
{
|
||||
unsigned long addr;
|
||||
|
||||
start &= ~(cpuinfo.dcache_line_size - 1);
|
||||
end += (cpuinfo.dcache_line_size - 1);
|
||||
end &= ~(cpuinfo.dcache_line_size - 1);
|
||||
|
||||
if (end > start + cpuinfo.dcache_size)
|
||||
end = start + cpuinfo.dcache_size;
|
||||
|
||||
|
@ -112,7 +96,7 @@ static void flush_aliases(struct address_space *mapping, struct page *page)
|
|||
|
||||
void flush_cache_all(void)
|
||||
{
|
||||
__flush_dcache_all(0, cpuinfo.dcache_size);
|
||||
__flush_dcache(0, cpuinfo.dcache_size);
|
||||
__flush_icache(0, cpuinfo.icache_size);
|
||||
}
|
||||
|
||||
|
@ -182,7 +166,7 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page)
|
|||
*/
|
||||
unsigned long start = (unsigned long)page_address(page);
|
||||
|
||||
__flush_dcache_all(start, start + PAGE_SIZE);
|
||||
__flush_dcache(start, start + PAGE_SIZE);
|
||||
}
|
||||
|
||||
void flush_dcache_page(struct page *page)
|
||||
|
@ -268,7 +252,7 @@ void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
|
|||
{
|
||||
flush_cache_page(vma, user_vaddr, page_to_pfn(page));
|
||||
memcpy(dst, src, len);
|
||||
__flush_dcache_all((unsigned long)src, (unsigned long)src + len);
|
||||
__flush_dcache((unsigned long)src, (unsigned long)src + len);
|
||||
if (vma->vm_flags & VM_EXEC)
|
||||
__flush_icache((unsigned long)src, (unsigned long)src + len);
|
||||
}
|
||||
|
@ -279,7 +263,7 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
|
|||
{
|
||||
flush_cache_page(vma, user_vaddr, page_to_pfn(page));
|
||||
memcpy(dst, src, len);
|
||||
__flush_dcache_all((unsigned long)dst, (unsigned long)dst + len);
|
||||
__flush_dcache((unsigned long)dst, (unsigned long)dst + len);
|
||||
if (vma->vm_flags & VM_EXEC)
|
||||
__flush_icache((unsigned long)dst, (unsigned long)dst + len);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue