Skip to content

Commit dc7637c

Browse files
nathanlynchmpe
authored andcommitted
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)" <[email protected]> Signed-off-by: Nathan Lynch <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/20231212-papr-sys_rtas-vs-lockdown-v6-7-e9eafd0c8c6c@linux.ibm.com
1 parent adf7a01 commit dc7637c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/powerpc/kernel/rtas.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,10 +1734,14 @@ void rtas_activate_firmware(void)
17341734
return;
17351735
}
17361736

1737+
mutex_lock(&rtas_ibm_activate_firmware_lock);
1738+
17371739
do {
17381740
fwrc = rtas_call(token, 0, 1, NULL);
17391741
} while (rtas_busy_delay(fwrc));
17401742

1743+
mutex_unlock(&rtas_ibm_activate_firmware_lock);
1744+
17411745
if (fwrc)
17421746
pr_err("ibm,activate-firmware failed (%i)\n", fwrc);
17431747
}

0 commit comments

Comments
 (0)