--- zzzz-none-000/linux-4.4.271/arch/arm/mm/cache-l2x0.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/arch/arm/mm/cache-l2x0.c 2023-04-19 10:22:27.000000000 +0000 @@ -16,6 +16,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#if defined(CONFIG_AVM_FASTIRQ) +#include +#define CLIENT_FIQ_PRIO FIQ_PRIO_MONITOR +#endif + #include #include #include @@ -46,6 +52,10 @@ struct outer_cache_fns outer_cache; }; +#if defined(CONFIG_AVM_FASTIRQ) +#include +#endif + #define CACHE_LINE_SIZE 32 static void __iomem *l2x0_base; @@ -280,10 +290,10 @@ { unsigned long flags; - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); __l2c_op_way(base + reg); __l2c220_cache_sync(base); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } static unsigned long l2c220_op_pa_range(void __iomem *reg, unsigned long start, @@ -301,8 +311,8 @@ } if (blk_end < end) { - raw_spin_unlock_irqrestore(lock, flags); - raw_spin_lock_irqsave(lock, flags); + rte_raw_spin_unlock_irqrestore(lock, flags); + rte_raw_spin_lock_irqsave(lock, flags); } } @@ -314,7 +324,7 @@ void __iomem *base = l2x0_base; unsigned long flags; - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); if ((start | end) & (CACHE_LINE_SIZE - 1)) { if (start & (CACHE_LINE_SIZE - 1)) { start &= ~(CACHE_LINE_SIZE - 1); @@ -333,7 +343,7 @@ start, end, flags); l2c_wait_mask(base + L2X0_INV_LINE_PA, 1); __l2c220_cache_sync(base); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } static void l2c220_clean_range(unsigned long start, unsigned long end) @@ -347,12 +357,12 @@ return; } - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); flags = l2c220_op_pa_range(base + L2X0_CLEAN_LINE_PA, start, end, flags); l2c_wait_mask(base + L2X0_CLEAN_INV_LINE_PA, 1); __l2c220_cache_sync(base); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } static void l2c220_flush_range(unsigned long start, unsigned long end) @@ -366,12 +376,12 @@ return; } - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); flags = l2c220_op_pa_range(base + L2X0_CLEAN_INV_LINE_PA, start, end, flags); l2c_wait_mask(base + L2X0_CLEAN_INV_LINE_PA, 1); __l2c220_cache_sync(base); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } static void l2c220_flush_all(void) @@ -383,9 +393,9 @@ { unsigned long flags; - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); __l2c220_cache_sync(l2x0_base); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } static void l2c220_enable(void __iomem *base, unsigned num_lock) @@ -477,7 +487,7 @@ unsigned long flags; /* Erratum 588369 for both clean+invalidate operations */ - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); l2c_set_debug(base, 0x03); if (start & (CACHE_LINE_SIZE - 1)) { @@ -494,7 +504,7 @@ } l2c_set_debug(base, 0x00); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } __l2c210_op_pa_range(base + L2X0_INV_LINE_PA, start, end); @@ -507,7 +517,7 @@ unsigned long flags; void __iomem *base = l2x0_base; - raw_spin_lock_irqsave(lock, flags); + rte_raw_spin_lock_irqsave(lock, flags); while (start < end) { unsigned long blk_end = start + min(end - start, 4096UL); @@ -520,11 +530,11 @@ l2c_set_debug(base, 0x00); if (blk_end < end) { - raw_spin_unlock_irqrestore(lock, flags); - raw_spin_lock_irqsave(lock, flags); + rte_raw_spin_unlock_irqrestore(lock, flags); + rte_raw_spin_lock_irqsave(lock, flags); } } - raw_spin_unlock_irqrestore(lock, flags); + rte_raw_spin_unlock_irqrestore(lock, flags); __l2c210_cache_sync(base); } @@ -533,12 +543,12 @@ void __iomem *base = l2x0_base; unsigned long flags; - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); l2c_set_debug(base, 0x03); __l2c_op_way(base + L2X0_CLEAN_INV_WAY); l2c_set_debug(base, 0x00); __l2c210_cache_sync(base); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } static void __init l2c310_save(void __iomem *base) @@ -1350,10 +1360,10 @@ while (start < end) { range_end = aurora_range_end(start, end); - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); writel_relaxed(start, base + AURORA_RANGE_BASE_ADDR_REG); writel_relaxed(range_end - CACHE_LINE_SIZE, base + offset); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); writel_relaxed(0, base + AURORA_SYNC_REG); start = range_end; @@ -1388,9 +1398,9 @@ unsigned long flags; /* clean all ways */ - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); __l2c_op_way(base + L2X0_CLEAN_INV_WAY); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); writel_relaxed(0, base + AURORA_SYNC_REG); } @@ -1405,12 +1415,12 @@ void __iomem *base = l2x0_base; unsigned long flags; - raw_spin_lock_irqsave(&l2x0_lock, flags); + rte_raw_spin_lock_irqsave(&l2x0_lock, flags); __l2c_op_way(base + L2X0_CLEAN_INV_WAY); writel_relaxed(0, base + AURORA_SYNC_REG); l2c_write_sec(0, base, L2X0_CTRL); dsb(st); - raw_spin_unlock_irqrestore(&l2x0_lock, flags); + rte_raw_spin_unlock_irqrestore(&l2x0_lock, flags); } static void aurora_save(void __iomem *base)