public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: fix taking the text_mutex twice during sifive errata patching
@ 2023-03-02 17:41 Conor Dooley
  2023-03-07 20:13 ` Geert Uytterhoeven
  2023-03-07 21:00 ` patchwork-bot+linux-riscv
  0 siblings, 2 replies; 6+ messages in thread
From: Conor Dooley @ 2023-03-02 17:41 UTC (permalink / raw)
  To: palmer; +Cc: conor, Conor Dooley, linux-riscv, paul.walmsley,
	Chris Hofstaedtler

From: Conor Dooley <conor.dooley@microchip.com>

Chris pointed out that some bonehead, *cough* me *cough*, added two
mutex_locks() to the SiFive errata patching. The second was meant to
have been a mutex_unlock().

Reported-by: Chris Hofstaedtler <zeha@debian.org>
Fixes: 9493e6f3ce02 ("RISC-V: take text_mutex during alternative patching")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
Palmer, you want to take this one for PR#2, or is it too late?
---
 arch/riscv/errata/sifive/errata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c
index da55cb247e89..31d2ebea4286 100644
--- a/arch/riscv/errata/sifive/errata.c
+++ b/arch/riscv/errata/sifive/errata.c
@@ -111,7 +111,7 @@ void __init_or_module sifive_errata_patch_func(struct alt_entry *begin,
 			mutex_lock(&text_mutex);
 			patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt),
 					  alt->alt_len);
-			mutex_lock(&text_mutex);
+			mutex_unlock(&text_mutex);
 			cpu_apply_errata |= tmp;
 		}
 	}
-- 
2.39.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-07 21:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-02 17:41 [PATCH] RISC-V: fix taking the text_mutex twice during sifive errata patching Conor Dooley
2023-03-07 20:13 ` Geert Uytterhoeven
2023-03-07 20:17   ` Conor Dooley
2023-03-07 20:38     ` Palmer Dabbelt
2023-03-07 20:52   ` Palmer Dabbelt
2023-03-07 21:00 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox