From: Alexey Brodkin Date: Fri, 7 Jul 2017 09:25:14 +0000 (+0300) Subject: ARCv2: SLC: Make sure busy bit is set properly for region ops X-Git-Tag: v4.12.10~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=763ad31728e81aeb6f0dc49d5ddf8503670e1c55;p=thirdparty%2Fkernel%2Fstable.git ARCv2: SLC: Make sure busy bit is set properly for region ops commit b37174d95b0251611a80ef60abf03752e9d66d67 upstream. c70c473396cb "ARCv2: SLC: Make sure busy bit is set properly on SLC flushing" fixes problem for entire SLC operation where the problem was initially caught. But given a nature of the issue it is perfectly possible for busy bit to be read incorrectly even when region operation was started. So extending initial fix for regional operation as well. Signed-off-by: Alexey Brodkin Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c index a867575a758b9..bebc24cb79126 100644 --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c @@ -697,6 +697,9 @@ noinline void slc_op(phys_addr_t paddr, unsigned long sz, const int op) write_aux_reg(ARC_REG_SLC_RGN_END, (paddr + sz + l2_line_sz - 1)); write_aux_reg(ARC_REG_SLC_RGN_START, paddr); + /* Make sure "busy" bit reports correct stataus, see STAR 9001165532 */ + read_aux_reg(ARC_REG_SLC_CTRL); + while (read_aux_reg(ARC_REG_SLC_CTRL) & SLC_CTRL_BUSY); spin_unlock_irqrestore(&lock, flags);