Skip to content

Commit 77a7f1b

Browse files
xxkentpavelvkozlov
authored andcommitted
ARC: Restore invalidate mode after flush operation
Fix an issue with using register ARC_REG_DC_CTRL
1 parent 0b6d186 commit 77a7f1b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

arch/arc/mm/cache-arcv3.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ static inline void __dc_op_before(const int op)
120120

121121
if (op == OP_INV) {
122122
val &= ~DC_CTRL_INV_MODE_FLUSH;
123+
} else {
124+
val |= DC_CTRL_INV_MODE_FLUSH;
123125
}
124126

125127
/*

arch/arc/mm/cache.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ static inline void __before_dc_op(const int op)
369369
*/
370370
if (op == OP_INV) {
371371
val &= ~DC_CTRL_INV_MODE_FLUSH;
372+
} else {
373+
val |= DC_CTRL_INV_MODE_FLUSH;
372374
}
373375

374376
#ifdef USE_RGN_FLSH
@@ -400,7 +402,7 @@ static inline void __after_dc_op(const int op)
400402
;
401403

402404
/* Switch back to default Invalidate mode */
403-
if (op == OP_INV)
405+
if (op == OP_FLUSH)
404406
write_aux_reg(ctl, reg | DC_CTRL_INV_MODE_FLUSH);
405407
}
406408
}

0 commit comments

Comments
 (0)