lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/7] microblaze: Remove disabling IRQ while pte_update() run
Date
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
\
 
 \ /
  Last update: 2020-02-12 16:43    [W:0.152 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site