Commit 0d6d82b6712c808e461090dd483f111f72b3b38b

Authored by Paul Mundt
Committed by Linus Torvalds
1 parent 65463b73b1

[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: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 12 additions and 7 deletions Side-by-side Diff

arch/sh/mm/tlb-sh3.c
... ... @@ -40,12 +40,17 @@
40 40 return;
41 41  
42 42 #if defined(CONFIG_SH7705_CACHE_32KB)
43   - struct page *page;
44   - page = pte_page(pte);
45   - if (VALID_PAGE(page) && !test_bit(PG_mapped, &page->flags)) {
46   - unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
47   - __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE);
48   - __set_bit(PG_mapped, &page->flags);
  43 + {
  44 + struct page *page = pte_page(pte);
  45 + unsigned long pfn = pte_pfn(pte);
  46 +
  47 + if (pfn_valid(pfn) && !test_bit(PG_mapped, &page->flags)) {
  48 + unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
  49 +
  50 + __flush_wback_region((void *)P1SEGADDR(phys),
  51 + PAGE_SIZE);
  52 + __set_bit(PG_mapped, &page->flags);
  53 + }
49 54 }
50 55 #endif
51 56  
... ... @@ -80,7 +85,7 @@
80 85 */
81 86 addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000);
82 87 data = (page & 0xfffe0000) | asid; /* VALID bit is off */
83   -
  88 +
84 89 if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) {
85 90 addr |= MMU_PAGE_ASSOC_BIT;
86 91 ways = 1; /* we already know the way .. */