Skip to content

Commit

Permalink
powerpc/rtas: Serialize firmware activation sequences
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nathanlynch authored and mpe committed Dec 13, 2023
1 parent adf7a01 commit dc7637c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,10 +1734,14 @@ void rtas_activate_firmware(void)
return;
}

mutex_lock(&rtas_ibm_activate_firmware_lock);

do {
fwrc = rtas_call(token, 0, 1, NULL);
} while (rtas_busy_delay(fwrc));

mutex_unlock(&rtas_ibm_activate_firmware_lock);

if (fwrc)
pr_err("ibm,activate-firmware failed (%i)\n", fwrc);
}
Expand Down

0 comments on commit dc7637c

Please sign in to comment.