[PATCH 5/7] microblaze: Remove disabling IRQ while pte_update() run

Michal Simek
2020-02-12T15:42:45Z

From: Stefan Asserhall <stefan.asserhall@xilinx.com>

There is no need to disable local IRQ for pte update. Use exclusive
load/store instruction for it.

Signed-off-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

arch/microblaze/include/asm/pgtable.h | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index 45b30878fc17..cf1e3095514b 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -372,20 +372,19 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
static inline unsigned long pte_update(pte_t *p, unsigned long clr,
unsigned long set)
{
- unsigned long flags, old, tmp;
-
- raw_local_irq_save(flags);
-
- __asm__ __volatile__( "lw %0, %2, r0 \n"
- "andn %1, %0, %3 \n"
- "or %1, %1, %4 \n"
- "sw %1, %2, r0 \n"
+ unsigned long old, tmp;
+
+ __asm__ __volatile__(
+ "1: lwx %0, %2, r0;\n"
+ " andn %1, %0, %3;\n"
+ " or %1, %1, %4;\n"
+ " swx %1, %2, r0;\n"
+ " addic %1, r0, 0;\n"
+ " bnei %1, 1b;\n"
: "=&r" (old), "=&r" (tmp)
: "r" ((unsigned long)(p + 1) - 4), "r" (clr), "r" (set)
: "cc");

- raw_local_irq_restore(flags);
-
return old;
}

--
2.25.0