Revert "sh: Kill off now redundant local irq disabling."

Previous thread: sh: Add I2C device support for EcoVec24 by Linux Kernel Mailing List on Friday, September 18, 2009 - 11:08 am. (1 message)

Next thread: sh: USB disable process is needed if romImage boot for EcoVec24 by Linux Kernel Mailing List on Friday, September 18, 2009 - 11:08 am. (1 message)
From: Linux Kernel Mailing List
Date: Friday, September 18, 2009 - 11:08 am

Gitweb:     http://git.kernel.org/linus/983f4c514c4c9ddac1077a2c805fd16cbe3f7487
Commit:     983f4c514c4c9ddac1077a2c805fd16cbe3f7487
Parent:     ade315d83c1d53b3c6b820134cb16601351810fe
Author:     Paul Mundt <lethal@linux-sh.org>
AuthorDate: Tue Sep 1 21:12:55 2009 +0900
Committer:  Paul Mundt <lethal@linux-sh.org>
CommitDate: Tue Sep 1 21:12:55 2009 +0900

    Revert "sh: Kill off now redundant local irq disabling."
    
    This reverts commit 64a6d72213dd810dd55bd0a503c36150af41c3c3.
    
    Unfortunately we can't use on_each_cpu() for all of the cache ops, as
    some of them only require preempt disabling. This seems to be the same
    issue that impacts the mips r4k caches, where this code was based on.
    This fixes up a deadlock that showed up in some IRQ context cases.
    
    Signed-off-by: Paul Mundt <lethal@linux-sh.org>
---
 arch/sh/mm/cache-sh2a.c   |    6 +++-
 arch/sh/mm/cache-sh4.c    |   61 +++++++++++++++++++++++++-------------------
 arch/sh/mm/cache-sh5.c    |   29 +++++++++++++++++----
 arch/sh/mm/cache-sh7705.c |    8 ++++++
 4 files changed, 71 insertions(+), 33 deletions(-)

diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c
index d783361..975899d 100644
--- a/arch/sh/mm/cache-sh2a.c
+++ b/arch/sh/mm/cache-sh2a.c
@@ -102,10 +102,12 @@ static void sh2a_flush_icache_range(void *args)
 	struct flusher_data *data = args;
 	unsigned long start, end;
 	unsigned long v;
+	unsigned long flags;
 
 	start = data->addr1 & ~(L1_CACHE_BYTES-1);
 	end = (data->addr2 + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1);
 
+	local_irq_save(flags);
 	jump_to_uncached();
 
 	for (v = start; v < end; v+=L1_CACHE_BYTES) {
@@ -120,10 +122,12 @@ static void sh2a_flush_icache_range(void *args)
 			}
 		}
 		/* I-Cache invalidate */
-		ctrl_outl(addr, CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008);
+		ctrl_outl(addr,
+			  CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008);
 	}
 
 	back_to_cached();
+	local_irq_restore(flags);
 }
 
 void __init ...
Previous thread: sh: Add I2C device support for EcoVec24 by Linux Kernel Mailing List on Friday, September 18, 2009 - 11:08 am. (1 message)

Next thread: sh: USB disable process is needed if romImage boot for EcoVec24 by Linux Kernel Mailing List on Friday, September 18, 2009 - 11:08 am. (1 message)