parisc: Fix patch code locking and flushing
authorJohn David Anglin <dave.anglin@bell.net>
Tue, 29 Mar 2022 18:54:36 +0000 (18:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 19:01:03 +0000 (21:01 +0200)
commit1753a49e266d8f0433e60d4b59f12c2b2497646a
treee8c3962a047e5c862f34bac2d53e9e4400296ae9
parentf7c35220305f273bddc0bdaf1e453b4ca280f145
parisc: Fix patch code locking and flushing

[ Upstream commit a9fe7fa7d874a536e0540469f314772c054a0323 ]

This change fixes the following:

1) The flags variable is not initialized. Always use raw_spin_lock_irqsave
and raw_spin_unlock_irqrestore to serialize patching.

2) flush_kernel_vmap_range is primarily intended for DMA flushes. Since
__patch_text_multiple is often called with interrupts disabled, it is
better to directly call flush_kernel_dcache_range_asm and
flush_kernel_icache_range_asm. This avoids an extra call.

3) The final call to flush_icache_range is unnecessary.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/parisc/kernel/patch.c