Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Peter Horton <phorton@bitbox.co.uk>
To: anemo@mba.ocn.ne.jp
Cc: linux-mips@linux-mips.org
Subject: Re: missing flush_dcache_page call in 2.4 kernel
Date: Thu, 25 Mar 2004 14:50:09 +0000	[thread overview]
Message-ID: <4062F1A1.9070005@bitbox.co.uk> (raw)
In-Reply-To: <20040325143319.GA873@linux-mips.org>

Ralf Baechle wrote:

>On Thu, Mar 25, 2004 at 10:42:29PM +0900, Atsushi Nemoto wrote:
>
>  
>
>>I noticed that reading from file with mmap sometimes return wrong data
>>on 2.4 kernel.
>>
>>This is a test program to reproduce the problem.
>>    
>>
>
>This seems to be the same problem as reported by Peter Horton as while
>ago; in his case that was with PIO IDE.
>
>  
>
Looks like it.

The fix we're using on Cobalt's at the moment is below (required for 
2.4.x and 2.6.x).

Fixing it this way fixes the problem with both page cache pages and swap 
pages.

For more details see the threads "Kernel 2.4.23 on Cobalt Qube2 - area 
of problem" and "Instability / caching problems on Qube 2 - solved ?" 
from December last year.

P.

diff -urN linux.cvs/arch/mips/mm/c-r4k.c linux/arch/mips/mm/c-r4k.c
--- linux.cvs/arch/mips/mm/c-r4k.c	Mon Jan 12 18:19:51 2004
+++ linux/arch/mips/mm/c-r4k.c	Sun Feb  1 13:35:55 2004
@@ -400,8 +400,10 @@
 	 * If there's no context yet, or the page isn't executable, no icache
 	 * flush is needed.
 	 */
+#ifndef CONFIG_MIPS_COBALT
 	if (!(vma->vm_flags & VM_EXEC))
 		return;
+#endif
 
 	/*
 	 * Tricky ...  Because we don't know the virtual address we've got the
@@ -425,6 +427,11 @@
 		r4k_blast_dcache_page(addr);
 		ClearPageDcacheDirty(page);
 	}
+
+#ifdef CONFIG_MIPS_COBALT
+	if (!(vma->vm_flags & VM_EXEC))
+		return;
+#endif
 
 	/*
 	 * We're not sure of the virtual address(es) involved here, so

  reply	other threads:[~2004-03-25 14:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-25 13:42 missing flush_dcache_page call in 2.4 kernel Atsushi Nemoto
2004-03-25 14:33 ` Ralf Baechle
2004-03-25 14:50   ` Peter Horton [this message]
2004-03-26  3:22     ` Atsushi Nemoto
2004-03-26 18:43       ` Peter Horton
2004-03-26 19:27         ` Maciej W. Rozycki
2004-03-27 13:49         ` Atsushi Nemoto
2004-03-28 13:04           ` Peter Horton
2004-03-30  6:38             ` Atsushi Nemoto
2004-03-30  9:48               ` Peter Horton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4062F1A1.9070005@bitbox.co.uk \
    --to=phorton@bitbox.co.uk \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox