Commit 0d6d82b6 authored by Paul Mundt's avatar Paul Mundt Committed by Linus Torvalds

[PATCH] sh: Use pfn_valid() for lazy dcache write-back on SH7705

SH7705 in extended cache mode has some left-over VALID_PAGE() cruft that it
checks when doing lazy dcache write-back.  This has been gone for some time
(the last bits were in the discontig code, which should now also be gone --
this also fixes up a build error in the non-discontig case).

pfn_valid() gives the desired behaviour, so we switch to that.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 65463b73
...@@ -40,12 +40,17 @@ void update_mmu_cache(struct vm_area_struct * vma, ...@@ -40,12 +40,17 @@ void update_mmu_cache(struct vm_area_struct * vma,
return; return;
#if defined(CONFIG_SH7705_CACHE_32KB) #if defined(CONFIG_SH7705_CACHE_32KB)
struct page *page; {
page = pte_page(pte); struct page *page = pte_page(pte);
if (VALID_PAGE(page) && !test_bit(PG_mapped, &page->flags)) { unsigned long pfn = pte_pfn(pte);
unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
__flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE); if (pfn_valid(pfn) && !test_bit(PG_mapped, &page->flags)) {
__set_bit(PG_mapped, &page->flags); unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
__flush_wback_region((void *)P1SEGADDR(phys),
PAGE_SIZE);
__set_bit(PG_mapped, &page->flags);
}
} }
#endif #endif
...@@ -80,7 +85,7 @@ void __flush_tlb_page(unsigned long asid, unsigned long page) ...@@ -80,7 +85,7 @@ void __flush_tlb_page(unsigned long asid, unsigned long page)
*/ */
addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000); addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000);
data = (page & 0xfffe0000) | asid; /* VALID bit is off */ data = (page & 0xfffe0000) | asid; /* VALID bit is off */
if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) { if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) {
addr |= MMU_PAGE_ASSOC_BIT; addr |= MMU_PAGE_ASSOC_BIT;
ways = 1; /* we already know the way .. */ ways = 1; /* we already know the way .. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment