Skip to content

Commit 10814c1

Browse files
abrodkingregkh
authored andcommitted
ARCv2: PAE40: Explicitly set MSB counterpart of SLC region ops addresses
commit 7d79cee2c6540ea64dd917a14e2fd63d4ac3d3c0 upstream. It is necessary to explicitly set both SLC_AUX_RGN_START1 and SLC_AUX_RGN_END1 which hold MSB bits of the physical address correspondingly of region start and end otherwise SLC region operation is executed in unpredictable manner Without this patch, SLC flushes on HSDK (IOC disabled) were taking seconds. Reported-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> [vgupta: PAR40 regs only written if PAE40 exist] Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6b1c81d commit 10814c1

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

arch/arc/include/asm/cache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ extern int ioc_exists;
8888
#define ARC_REG_SLC_FLUSH 0x904
8989
#define ARC_REG_SLC_INVALIDATE 0x905
9090
#define ARC_REG_SLC_RGN_START 0x914
91+
#define ARC_REG_SLC_RGN_START1 0x915
9192
#define ARC_REG_SLC_RGN_END 0x916
93+
#define ARC_REG_SLC_RGN_END1 0x917
9294

9395
/* Bit val in SLC_CONTROL */
9496
#define SLC_CTRL_IM 0x040

arch/arc/mm/cache.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ noinline void slc_op(phys_addr_t paddr, unsigned long sz, const int op)
543543
static DEFINE_SPINLOCK(lock);
544544
unsigned long flags;
545545
unsigned int ctrl;
546+
phys_addr_t end;
546547

547548
spin_lock_irqsave(&lock, flags);
548549

@@ -572,8 +573,16 @@ noinline void slc_op(phys_addr_t paddr, unsigned long sz, const int op)
572573
* END needs to be setup before START (latter triggers the operation)
573574
* END can't be same as START, so add (l2_line_sz - 1) to sz
574575
*/
575-
write_aux_reg(ARC_REG_SLC_RGN_END, (paddr + sz + l2_line_sz - 1));
576-
write_aux_reg(ARC_REG_SLC_RGN_START, paddr);
576+
end = paddr + sz + l2_line_sz - 1;
577+
if (is_pae40_enabled())
578+
write_aux_reg(ARC_REG_SLC_RGN_END1, upper_32_bits(end));
579+
580+
write_aux_reg(ARC_REG_SLC_RGN_END, lower_32_bits(end));
581+
582+
if (is_pae40_enabled())
583+
write_aux_reg(ARC_REG_SLC_RGN_START1, upper_32_bits(paddr));
584+
585+
write_aux_reg(ARC_REG_SLC_RGN_START, lower_32_bits(paddr));
577586

578587
while (read_aux_reg(ARC_REG_SLC_CTRL) & SLC_CTRL_BUSY);
579588

0 commit comments

Comments
 (0)