Skip to content

Commit

Permalink
mips/ide: flush dcache also if icache does not snoop dcache
Browse files Browse the repository at this point in the history
If this is not done then the new just read data which remains in dcache
will not make it into icache on time. Thus the CPU loads invalid data
and executes crap. The result is that the user is not able to execute
anything from its IDE based media while reading plain data is still
working well.

This problem has been reported as Debian #404951
http://bugs.debian.org/404951
http://comments.gmane.org/gmane.linux.ide/45092

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/2820/
  • Loading branch information
Sebastian Andrzej Siewior authored and Ralf Baechle committed Jan 24, 2014
1 parent 3c06b12 commit d386476
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/mips/include/asm/mach-generic/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
static inline void __ide_flush_prologue(void)
{
#ifdef CONFIG_SMP
if (cpu_has_dc_aliases)
if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc)
preempt_disable();
#endif
}

static inline void __ide_flush_epilogue(void)
{
#ifdef CONFIG_SMP
if (cpu_has_dc_aliases)
if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc)
preempt_enable();
#endif
}

static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
{
if (cpu_has_dc_aliases) {
if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc) {
unsigned long end = addr + size;

while (addr < end) {
Expand Down

0 comments on commit d386476

Please sign in to comment.