Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/rtas: Serialize firmware activation sequences

Use rtas_ibm_activate_firmware_lock to prevent interleaving call
sequences of the ibm,activate-firmware RTAS function, which typically
requires multiple calls to complete the update. While the spec does
not specifically prohibit interleaved sequences, there's almost
certainly no advantage to allowing them.

Reviewed-by: "Aneesh Kumar K.V (IBM)" <aneesh.kumar@kernel.org>
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231212-papr-sys_rtas-vs-lockdown-v6-7-e9eafd0c8c6c@linux.ibm.com

authored by

Nathan Lynch and committed by
Michael Ellerman
dc7637c4 adf7a019

+4
+4
arch/powerpc/kernel/rtas.c
··· 1734 1734 return; 1735 1735 } 1736 1736 1737 + mutex_lock(&rtas_ibm_activate_firmware_lock); 1738 + 1737 1739 do { 1738 1740 fwrc = rtas_call(token, 0, 1, NULL); 1739 1741 } while (rtas_busy_delay(fwrc)); 1742 + 1743 + mutex_unlock(&rtas_ibm_activate_firmware_lock); 1740 1744 1741 1745 if (fwrc) 1742 1746 pr_err("ibm,activate-firmware failed (%i)\n", fwrc);